added suspendLoop for low power

This commit is contained in:
hathach committed 2017-09-27 15:48:15 +07:00
1 parent 8493fd6e7f
commit e84fd54027
3 files changed
+10 -2

No files matched your search

+2 -1
View File
@@ -5,7 +5,8 @@
### Core
- Make FreeRTOS run in tickless mode
- Added systemOff() to enter hibernate mode
- Added systemOff() to enter System Off mode
- Added suspendLoop() to disable loop() task to further save power
- Correct waitForEvent() function with SoftDevice enabled and disabled.
- Added RotaryEncoder support for both Hardware and Software Encoder.
- Ada Callback task is started along with loop task, used as worker thread to defer interrupt callback.
+1
View File
@@ -35,6 +35,7 @@ void yield( void ) ;
void setup( void ) ;
void loop( void ) ;
void suspendLoop(void);
uint32_t setLoopStacksize(void);
#include "WVariant.h"
+7 -1
View File
@@ -32,6 +32,8 @@ void Bluefruit_printInfo() {}
#include "SEGGER_SYSVIEW.h"
#endif
static TaskHandle_t _loopHandle;
// Weak empty variant initialization function.
// May be redefined by variant files.
@@ -92,7 +94,6 @@ int main( void )
#endif
// Create a task for loop()
TaskHandle_t _loopHandle;
xTaskCreate( loop_task, "loop", _loopStacksize, NULL, TASK_PRIO_LOW, &_loopHandle);
// Initialize callback task
@@ -105,3 +106,8 @@ int main( void )
return 0;
}
void suspendLoop(void)
{
vTaskSuspend(_loopHandle);
}