kopia lustrzana https://github.com/espressif/esp-idf
Change i2c_struct to force 32bit access
rodzic
0d0e2851f3
commit
c31ba2b21b
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
Ładowanie…
Reference in New Issue