]> granicus.if.org Git - esp-idf/commitdiff
periph_ctrl: port*_CRITICAL vanilla FreeRTOS compliance
authorSachin Parekh <sachin.parekh@espressif.com>
Mon, 25 Mar 2019 10:32:15 +0000 (16:02 +0530)
committerSachin Parekh <sachin.parekh@espressif.com>
Mon, 13 May 2019 11:09:19 +0000 (16:39 +0530)
Signed-off-by: Sachin Parekh <sachin.parekh@espressif.com>
components/driver/periph_ctrl.c

index f0a01a61ac2205e5a49934c4ce03312f2cbf2cc0..522c8d587f3d7ee6171f53d0f26f59dd556c8f46 100644 (file)
@@ -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)