Change i2c_struct to force 32bit access

pull/7041/head
me-no-dev 2021-05-13 11:26:14 +03:00
rodzic 0d0e2851f3
commit c31ba2b21b
2 zmienionych plików z 4 dodań i 4 usunięć

Wyświetl plik

@ -571,7 +571,7 @@ static inline void i2c_ll_get_scl_timing(i2c_dev_t *hw, int *high_period, int *l
static inline void i2c_ll_write_txfifo(i2c_dev_t *hw, uint8_t *ptr, uint8_t len)
{
for (int i = 0; i< len; i++) {
hw->fifo_data.val = ptr[i];
hw->fifo_data.data = ptr[i];
}
}
@ -587,7 +587,7 @@ static inline void i2c_ll_write_txfifo(i2c_dev_t *hw, uint8_t *ptr, uint8_t len)
static inline void i2c_ll_read_rxfifo(i2c_dev_t *hw, uint8_t *ptr, uint8_t len)
{
for(int i = 0; i < len; i++) {
ptr[i] = hw->fifo_data.val;
ptr[i] = hw->fifo_data.data;
}
}

Wyświetl plik

@ -116,8 +116,8 @@ typedef volatile struct {
} fifo_conf;
union {
struct {
uint8_t data;
uint8_t reserved[3];
uint32_t data : 8;
uint32_t reserved8 : 24;
};
uint32_t val;
} fifo_data;