Skip to content

Commit fdb4048

Browse files
committed
fix CRYPTOCELL_IRQn prevent go to sleep causing high power
1 parent c1a4352 commit fdb4048

File tree

4 files changed

+13
-2
lines changed

4 files changed

+13
-2
lines changed

cores/nRF5/freertos/portable/CMSIS/nrf52/port_cmsis_systick.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,12 @@ void vPortSuppressTicksAndSleep( TickType_t xExpectedIdleTime )
189189
(void) __get_FPSCR();
190190
NVIC_ClearPendingIRQ(FPU_IRQn);
191191
#endif
192+
193+
#ifdef NRF_CRYPTOCELL
194+
// manually clear CryptoCell else it could prevent low power mode
195+
NVIC_ClearPendingIRQ(CRYPTOCELL_IRQn);
196+
#endif
197+
192198
#ifdef SOFTDEVICE_PRESENT // TODO
193199
uint8_t sd_en = 0;
194200
(void) sd_softdevice_is_enabled(&sd_en);

cores/nRF5/wiring.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,11 @@ void waitForEvent(void)
9696
uint8_t sd_en = 0;
9797
(void) sd_softdevice_is_enabled(&sd_en);
9898

99+
#ifdef NRF_CRYPTOCELL
100+
// manually clear CryptoCell else it could prevent low power mode
101+
NVIC_ClearPendingIRQ(CRYPTOCELL_IRQn);
102+
#endif
103+
99104
if ( sd_en )
100105
{
101106
(void) sd_app_evt_wait();

libraries/Bluefruit52Lib/src/bluefruit.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ class AdafruitBluefruit
179179
*------------------------------------------------------------------*/
180180
void setMultiprotocolSemaphore(SemaphoreHandle_t mprot_event_semaphore)
181181
{
182-
_mprot_event_sem= mprot_event_semaphore;
182+
_mprot_event_sem= mprot_event_semaphore;
183183
}
184184
#endif
185185

0 commit comments

Comments
 (0)