move waitForEvent() to wiring, increase configMINIMAL_STACK_SIZE from 60 to 100
This commit is contained in:
1 parent
a81184d9ce
commit
3f83bb06ac
3 files changed
+20
-4
No files matched your search
@@ -111,9 +111,6 @@ uint32_t setLoopStacksize(void);
|
||||
#define portModeRegister(port) ( &(NRF_GPIO->DIRSET) )
|
||||
#define digitalPinHasPWM(P) ( true )
|
||||
|
||||
// Hint instruction to tell CPU go to low power mode
|
||||
#define waitForEvent() __WFE() // sd_app_evt_wait()
|
||||
|
||||
/*
|
||||
* digitalPinToTimer(..) is AVR-specific and is not defined for nRF52
|
||||
* architecture. If you need to check if a pin supports PWM you must
|
||||
|
||||
@@ -97,7 +97,7 @@
|
||||
#define configCPU_CLOCK_HZ ( SystemCoreClock )
|
||||
#define configTICK_RATE_HZ 10000
|
||||
#define configMAX_PRIORITIES ( 5 )
|
||||
#define configMINIMAL_STACK_SIZE ( 60 )
|
||||
#define configMINIMAL_STACK_SIZE ( 100 )
|
||||
#define configTOTAL_HEAP_SIZE ( 4096 ) /* not used since we use malloc */
|
||||
#define configMAX_TASK_NAME_LEN ( 8 )
|
||||
#define configUSE_16_BIT_TICKS 0
|
||||
|
||||
@@ -27,6 +27,25 @@ extern void init(void);
|
||||
extern void enterSerialDfu(void);
|
||||
extern void enterOTADfu(void);
|
||||
|
||||
// Hint instruction to tell CPU go to low power mode
|
||||
#if 1
|
||||
#define waitForEvent() __WFE()
|
||||
#else
|
||||
ATTR_ALWAYS_INLINE static inline void waitForEvent(void)
|
||||
{
|
||||
// Set bit 7 and bits 4..0 in the mask to one (0x ...00 1001 1111)
|
||||
enum { FPU_EXCEPTION_MASK = 0x0000009F };
|
||||
|
||||
/* Clear exceptions and PendingIRQ from the FPU unit */
|
||||
__set_FPSCR(__get_FPSCR() & ~(FPU_EXCEPTION_MASK));
|
||||
(void) __get_FPSCR();
|
||||
NVIC_ClearPendingIRQ(FPU_IRQn);
|
||||
|
||||
/* Call SoftDevice Wait For event */
|
||||
(void) sd_app_evt_wait();
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
Reference in new issue
Block a user