mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
periph_ctrl: port*_CRITICAL vanilla FreeRTOS compliance
Signed-off-by: Sachin Parekh <sachin.parekh@espressif.com>
This commit is contained in:
parent
5c6b9adf11
commit
e9898b1280
@ -29,26 +29,26 @@ static uint32_t get_rst_en_reg(periph_module_t periph);
|
||||
|
||||
void periph_module_enable(periph_module_t periph)
|
||||
{
|
||||
portENTER_CRITICAL(&periph_spinlock);
|
||||
portENTER_CRITICAL_SAFE(&periph_spinlock);
|
||||
DPORT_SET_PERI_REG_MASK(get_clk_en_reg(periph), get_clk_en_mask(periph));
|
||||
DPORT_CLEAR_PERI_REG_MASK(get_rst_en_reg(periph), get_rst_en_mask(periph, true));
|
||||
portEXIT_CRITICAL(&periph_spinlock);
|
||||
portEXIT_CRITICAL_SAFE(&periph_spinlock);
|
||||
}
|
||||
|
||||
void periph_module_disable(periph_module_t periph)
|
||||
{
|
||||
portENTER_CRITICAL(&periph_spinlock);
|
||||
portENTER_CRITICAL_SAFE(&periph_spinlock);
|
||||
DPORT_CLEAR_PERI_REG_MASK(get_clk_en_reg(periph), get_clk_en_mask(periph));
|
||||
DPORT_SET_PERI_REG_MASK(get_rst_en_reg(periph), get_rst_en_mask(periph, false));
|
||||
portEXIT_CRITICAL(&periph_spinlock);
|
||||
portEXIT_CRITICAL_SAFE(&periph_spinlock);
|
||||
}
|
||||
|
||||
void periph_module_reset(periph_module_t periph)
|
||||
{
|
||||
portENTER_CRITICAL(&periph_spinlock);
|
||||
portENTER_CRITICAL_SAFE(&periph_spinlock);
|
||||
DPORT_SET_PERI_REG_MASK(get_rst_en_reg(periph), get_rst_en_mask(periph, false));
|
||||
DPORT_CLEAR_PERI_REG_MASK(get_rst_en_reg(periph), get_rst_en_mask(periph, false));
|
||||
portEXIT_CRITICAL(&periph_spinlock);
|
||||
portEXIT_CRITICAL_SAFE(&periph_spinlock);
|
||||
}
|
||||
|
||||
static uint32_t get_clk_en_mask(periph_module_t periph)
|
||||
|
Loading…
x
Reference in New Issue
Block a user