Skip to content

Commit 746c485

Browse files
stevew817asmellby
authored andcommitted
[EFM32] Swap out INT_* functions with mbed critical sections
1 parent 641087c commit 746c485

File tree

3 files changed

+10
-12
lines changed

3 files changed

+10
-12
lines changed

hal/targets/hal/TARGET_Silicon_Labs/TARGET_EFM32/dma_api.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
#include "dma_api_HAL.h"
2626
#include "em_device.h"
2727
#include "em_cmu.h"
28-
#include "em_int.h"
2928

3029
#ifdef DMA_PRESENT
3130
#include "em_dma.h"
@@ -198,7 +197,6 @@ bool LDMAx_ChannelEnabled( int ch )
198197
EFM_ASSERT(ch < DMA_CHAN_COUNT);
199198
uint32_t chMask = 1 << ch;
200199
return (bool)(LDMA->CHEN & chMask);
201-
INT_Disable();
202200
}
203201

204202
#endif /* LDMA_PRESENT */

hal/targets/hal/TARGET_Silicon_Labs/TARGET_EFM32/lp_ticker.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
#include "rtc_api_HAL.h"
2929
#include "lp_ticker_api.h"
3030

31-
#include "em_int.h"
31+
#include "critical.h"
3232
#if (defined RTCC_COUNT) && (RTCC_COUNT > 0)
3333
#include "em_rtcc.h"
3434
#endif
@@ -38,21 +38,21 @@ static int rtc_reserved = 0;
3838
void lp_ticker_init()
3939
{
4040
if(!rtc_reserved) {
41-
INT_Disable();
41+
core_util_critical_section_enter();
4242
rtc_init_real(RTC_INIT_LPTIMER);
4343
rtc_set_comp0_handler((uint32_t)lp_ticker_irq_handler);
4444
rtc_reserved = 1;
45-
INT_Enable();
45+
core_util_critical_section_exit();
4646
}
4747
}
4848

4949
void lp_ticker_free()
5050
{
5151
if(rtc_reserved) {
52-
INT_Disable();
52+
core_util_critical_section_enter();
5353
rtc_free_real(RTC_INIT_LPTIMER);
5454
rtc_reserved = 0;
55-
INT_Enable();
55+
core_util_critical_section_exit();
5656
}
5757
}
5858

hal/targets/hal/TARGET_Silicon_Labs/TARGET_EFM32/sleep.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
#include "sleepmodes.h"
2929
#include "cmsis.h"
3030
#include "em_emu.h"
31-
#include "em_int.h"
31+
#include "critical.h"
3232

3333
uint32_t sleep_block_counter[NUM_SLEEP_MODES] = {0};
3434

@@ -80,9 +80,9 @@ void deepsleep(void)
8080
*/
8181
void blockSleepMode(sleepstate_enum minimumMode)
8282
{
83-
INT_Disable();
83+
core_util_critical_section_enter();
8484
sleep_block_counter[minimumMode]++;
85-
INT_Enable();
85+
core_util_critical_section_exit();
8686
}
8787

8888
/** Unblock the microcontroller from sleeping below a certain mode
@@ -94,11 +94,11 @@ void blockSleepMode(sleepstate_enum minimumMode)
9494
*/
9595
void unblockSleepMode(sleepstate_enum minimumMode)
9696
{
97-
INT_Disable();
97+
core_util_critical_section_enter();
9898
if(sleep_block_counter[minimumMode] > 0) {
9999
sleep_block_counter[minimumMode]--;
100100
}
101-
INT_Enable();
101+
core_util_critical_section_exit();
102102
}
103103

104104
#endif

0 commit comments

Comments
 (0)