@@ -65,7 +65,7 @@ static void lp_core_i2c_format_cmd(uint32_t cmd_idx, uint8_t op_code, uint8_t ac
6565 i2c_ll_master_write_cmd_reg (dev , hw_cmd , cmd_idx );
6666}
6767
68- static inline esp_err_t lp_core_i2c_wait_for_interrupt (uint32_t intr_mask , int32_t ticks_to_wait )
68+ static inline esp_err_t lp_core_i2c_wait_for_interrupt (uint32_t intr_mask , int32_t cycles_to_wait )
6969{
7070 uint32_t intr_status = 0 ;
7171 uint32_t to = 0 ;
@@ -96,13 +96,13 @@ static inline esp_err_t lp_core_i2c_wait_for_interrupt(uint32_t intr_mask, int32
9696 break ;
9797 }
9898
99- if (ticks_to_wait > -1 ) {
100- /* If the ticks_to_wait value is not -1, keep track of ticks and
99+ if (cycles_to_wait > -1 ) {
100+ /* If the cycles_to_wait value is not -1, keep track of cycles and
101101 * break from the loop once the timeout is reached.
102102 */
103103 ulp_lp_core_delay_cycles (1 );
104104 to ++ ;
105- if (to >= ticks_to_wait ) {
105+ if (to >= cycles_to_wait ) {
106106 /* Timeout. Clear interrupt bits and return an error */
107107 i2c_ll_clear_intr_mask (dev , intr_mask );
108108 return ESP_ERR_TIMEOUT ;
@@ -142,7 +142,7 @@ void lp_core_i2c_master_set_ack_check_en(i2c_port_t lp_i2c_num, bool ack_check_e
142142
143143esp_err_t lp_core_i2c_master_read_from_device (i2c_port_t lp_i2c_num , uint16_t device_addr ,
144144 uint8_t * data_rd , size_t size ,
145- int32_t ticks_to_wait )
145+ int32_t cycles_to_wait )
146146{
147147 (void )lp_i2c_num ;
148148
@@ -215,7 +215,7 @@ esp_err_t lp_core_i2c_master_read_from_device(i2c_port_t lp_i2c_num, uint16_t de
215215 i2c_ll_start_trans (dev );
216216
217217 /* Wait for the transfer to complete */
218- ret = lp_core_i2c_wait_for_interrupt (intr_mask , ticks_to_wait );
218+ ret = lp_core_i2c_wait_for_interrupt (intr_mask , cycles_to_wait );
219219 if (ret != ESP_OK ) {
220220 /* Transaction error. Abort. */
221221 return ret ;
@@ -233,7 +233,7 @@ esp_err_t lp_core_i2c_master_read_from_device(i2c_port_t lp_i2c_num, uint16_t de
233233
234234esp_err_t lp_core_i2c_master_write_to_device (i2c_port_t lp_i2c_num , uint16_t device_addr ,
235235 const uint8_t * data_wr , size_t size ,
236- int32_t ticks_to_wait )
236+ int32_t cycles_to_wait )
237237{
238238 (void )lp_i2c_num ;
239239
@@ -306,7 +306,7 @@ esp_err_t lp_core_i2c_master_write_to_device(i2c_port_t lp_i2c_num, uint16_t dev
306306 i2c_ll_start_trans (dev );
307307
308308 /* Wait for the transfer to complete */
309- ret = lp_core_i2c_wait_for_interrupt (intr_mask , ticks_to_wait );
309+ ret = lp_core_i2c_wait_for_interrupt (intr_mask , cycles_to_wait );
310310 if (ret != ESP_OK ) {
311311 /* Transaction error. Abort. */
312312 return ret ;
@@ -325,7 +325,7 @@ esp_err_t lp_core_i2c_master_write_to_device(i2c_port_t lp_i2c_num, uint16_t dev
325325esp_err_t lp_core_i2c_master_write_read_device (i2c_port_t lp_i2c_num , uint16_t device_addr ,
326326 const uint8_t * data_wr , size_t write_size ,
327327 uint8_t * data_rd , size_t read_size ,
328- int32_t ticks_to_wait )
328+ int32_t cycles_to_wait )
329329{
330330 (void )lp_i2c_num ;
331331
@@ -393,7 +393,7 @@ esp_err_t lp_core_i2c_master_write_read_device(i2c_port_t lp_i2c_num, uint16_t d
393393 i2c_ll_start_trans (dev );
394394
395395 /* Wait for the transfer to complete */
396- ret = lp_core_i2c_wait_for_interrupt (intr_mask , ticks_to_wait );
396+ ret = lp_core_i2c_wait_for_interrupt (intr_mask , cycles_to_wait );
397397 if (ret != ESP_OK ) {
398398 /* Transaction error. Abort. */
399399 return ret ;
@@ -462,7 +462,7 @@ esp_err_t lp_core_i2c_master_write_read_device(i2c_port_t lp_i2c_num, uint16_t d
462462 i2c_ll_start_trans (dev );
463463
464464 /* Wait for the transfer to complete */
465- ret = lp_core_i2c_wait_for_interrupt (intr_mask , ticks_to_wait );
465+ ret = lp_core_i2c_wait_for_interrupt (intr_mask , cycles_to_wait );
466466 if (ret != ESP_OK ) {
467467 /* Transaction error. Abort. */
468468 return ret ;
0 commit comments