fix(periph_ctrl): fix reset function in periph_ctrl.c

This commit is contained in:
michael 2017-10-17 11:52:50 +08:00
parent 8e31a36562
commit 88f602a0e0

View file

@ -46,10 +46,8 @@ void periph_module_disable(periph_module_t periph)
void periph_module_reset(periph_module_t periph) void periph_module_reset(periph_module_t periph)
{ {
portENTER_CRITICAL(&periph_spinlock); portENTER_CRITICAL(&periph_spinlock);
uint32_t rst_en = get_rst_en_mask(periph); DPORT_SET_PERI_REG_MASK(get_rst_en_reg(periph), get_rst_en_mask(periph));
uint32_t mask = get_clk_en_mask(periph); DPORT_CLEAR_PERI_REG_MASK(get_rst_en_reg(periph), get_rst_en_mask(periph));
DPORT_SET_PERI_REG_MASK(rst_en, mask);
DPORT_CLEAR_PERI_REG_MASK(rst_en, mask);
portEXIT_CRITICAL(&periph_spinlock); portEXIT_CRITICAL(&periph_spinlock);
} }