mirror of
https://github.com/espressif/esp-idf
synced 2025-03-10 01:29:21 -04:00
fix(ulp-i2c): fixed ulp i2c not working from main cpu if compiled with 0S or O2
Compiler would optimize register write to use s8i which do not work for IO registers Closes https://github.com/espressif/esp-idf/issues/12214
This commit is contained in:
parent
b1e85404f1
commit
cb3a98f9d5
@ -12,6 +12,7 @@
|
|||||||
#include "soc/sens_reg.h"
|
#include "soc/sens_reg.h"
|
||||||
#include "soc/clk_tree_defs.h"
|
#include "soc/clk_tree_defs.h"
|
||||||
#include "hal/i2c_ll.h"
|
#include "hal/i2c_ll.h"
|
||||||
|
#include "hal/misc.h"
|
||||||
#include "driver/rtc_io.h"
|
#include "driver/rtc_io.h"
|
||||||
#include "freertos/FreeRTOS.h"
|
#include "freertos/FreeRTOS.h"
|
||||||
#include "freertos/task.h"
|
#include "freertos/task.h"
|
||||||
@ -215,7 +216,8 @@ static void ulp_riscv_i2c_format_cmd(uint32_t cmd_idx, uint8_t op_code, uint8_t
|
|||||||
i2c_dev->command[cmd_idx].ack_en = ack_check_en; // I2C controller verifies that the ACK bit sent by the
|
i2c_dev->command[cmd_idx].ack_en = ack_check_en; // I2C controller verifies that the ACK bit sent by the
|
||||||
// slave device matches the ACK expected bit during WRITE.
|
// slave device matches the ACK expected bit during WRITE.
|
||||||
// Ignored during RSTART, STOP, END and READ cmds.
|
// Ignored during RSTART, STOP, END and READ cmds.
|
||||||
i2c_dev->command[cmd_idx].byte_num = byte_num; // Byte Num
|
HAL_FORCE_MODIFY_U32_REG_FIELD(i2c_dev->command[cmd_idx], byte_num, byte_num); // Byte Num
|
||||||
|
|
||||||
#elif CONFIG_IDF_TARGET_ESP32S3
|
#elif CONFIG_IDF_TARGET_ESP32S3
|
||||||
/* Reset cmd register */
|
/* Reset cmd register */
|
||||||
i2c_dev->i2c_cmd[cmd_idx].val = 0;
|
i2c_dev->i2c_cmd[cmd_idx].val = 0;
|
||||||
@ -230,7 +232,7 @@ static void ulp_riscv_i2c_format_cmd(uint32_t cmd_idx, uint8_t op_code, uint8_t
|
|||||||
i2c_dev->i2c_cmd[cmd_idx].i2c_ack_en = ack_check_en; // I2C controller verifies that the ACK bit sent by the
|
i2c_dev->i2c_cmd[cmd_idx].i2c_ack_en = ack_check_en; // I2C controller verifies that the ACK bit sent by the
|
||||||
// slave device matches the ACK expected bit during WRITE.
|
// slave device matches the ACK expected bit during WRITE.
|
||||||
// Ignored during RSTART, STOP, END and READ cmds.
|
// Ignored during RSTART, STOP, END and READ cmds.
|
||||||
i2c_dev->i2c_cmd[cmd_idx].i2c_byte_num = byte_num; // Byte Num
|
HAL_FORCE_MODIFY_U32_REG_FIELD(i2c_dev->i2c_cmd[cmd_idx], i2c_byte_num, byte_num); // Byte Num
|
||||||
#endif // CONFIG_IDF_TARGET_ESP32S2
|
#endif // CONFIG_IDF_TARGET_ESP32S2
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user