Skip to content

Commit

Permalink
i2c: Correct hal functions iram placement and remove IRAM_ATTR for i2…
Browse files Browse the repository at this point in the history
…c_hw_fsm_reset

Closes #8422
Closes #7249

(cherry picked from commit 1ceb7c8)
  • Loading branch information
songruo authored and songruo committed Apr 18, 2022
1 parent 6c27359 commit a793553
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion components/driver/i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ static i2c_clk_alloc_t i2c_clk_alloc[I2C_SCLK_MAX] = {
static i2c_obj_t *p_i2c_obj[I2C_NUM_MAX] = {0};
static void i2c_isr_handler_default(void *arg);
static void IRAM_ATTR i2c_master_cmd_begin_static(i2c_port_t i2c_num);
static esp_err_t IRAM_ATTR i2c_hw_fsm_reset(i2c_port_t i2c_num);
static esp_err_t i2c_hw_fsm_reset(i2c_port_t i2c_num);

static void i2c_hw_disable(i2c_port_t i2c_num)
{
Expand Down
20 changes: 0 additions & 20 deletions components/hal/i2c_hal.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,26 +144,11 @@ bool i2c_hal_is_master_mode(i2c_hal_context_t *hal)
return i2c_ll_is_master_mode(hal->dev);
}

void i2c_hal_get_rxfifo_cnt(i2c_hal_context_t *hal, uint32_t *len)
{
*len = i2c_ll_get_rxfifo_cnt(hal->dev);
}

void i2c_hal_get_txfifo_cnt(i2c_hal_context_t *hal, uint32_t *len)
{
*len = i2c_ll_get_txfifo_len(hal->dev);
}

void i2c_hal_enable_slave_tx_it(i2c_hal_context_t *hal)
{
i2c_ll_slave_enable_tx_it(hal->dev);
}

void i2c_hal_disable_slave_tx_it(i2c_hal_context_t *hal)
{
i2c_ll_slave_disable_tx_it(hal->dev);
}

void i2c_hal_enable_slave_rx_it(i2c_hal_context_t *hal)
{
i2c_ll_slave_enable_rx_it(hal->dev);
Expand Down Expand Up @@ -218,8 +203,3 @@ void i2c_hal_master_init(i2c_hal_context_t *hal, int i2c_num)
i2c_ll_txfifo_rst(hal->dev);
i2c_ll_rxfifo_rst(hal->dev);
}

void i2c_hal_update_config(i2c_hal_context_t *hal)
{
i2c_ll_update(hal->dev);
}
20 changes: 20 additions & 0 deletions components/hal/i2c_hal_iram.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,23 @@ void i2c_hal_slave_handle_event(i2c_hal_context_t *hal, i2c_intr_event_t *event)
{
i2c_ll_slave_get_event(hal->dev, event);
}

void i2c_hal_disable_slave_tx_it(i2c_hal_context_t *hal)
{
i2c_ll_slave_disable_tx_it(hal->dev);
}

void i2c_hal_update_config(i2c_hal_context_t *hal)
{
i2c_ll_update(hal->dev);
}

void i2c_hal_get_rxfifo_cnt(i2c_hal_context_t *hal, uint32_t *len)
{
*len = i2c_ll_get_rxfifo_cnt(hal->dev);
}

void i2c_hal_get_txfifo_cnt(i2c_hal_context_t *hal, uint32_t *len)
{
*len = i2c_ll_get_txfifo_len(hal->dev);
}

0 comments on commit a793553

Please sign in to comment.