mirror of
https://github.com/espressif/esp-idf
synced 2025-03-10 09:39:10 -04:00
GCC compiler can generate 8-bit stores when modifying bitfields of volatile structs (https://github.com/espressif/esp-idf/issues/597). In the specific case of I2C driver, this resulted in byte_num field to be written using s8i. However the peripheral requires 32-bit writes, and ignores 8-bit writes. This change modifies the code to compose the 32-bit command register value first, and then write the complete value to the hardware.