add optional callback rtos_idle_callback()

This commit is contained in:
hathach committed 2017-04-09 21:51:00 +07:00
1 parent a335699296
commit a454cb9f21
3 files changed
+9 -9

No files matched your search

+3 -2
View File
@@ -3,7 +3,8 @@
### Core
- Add HardwarePWM class to support up to 12 channels and compatible with Neopixel library
- Enable FreeRTOS's Idle hook to call waitForEvent()
- Add waitForEvent() as alias to __WFE() instruction
- Enable FreeRTOS's Idle hook, add rtos_idle_callback() as optional callback for user
- Add mutex to prevent uart conflict
#### New Example
@@ -25,7 +26,7 @@
- change BLECentral startScanning()/stopScanning()/connect() return type from `err_t` to `bool`
- change BLECharacteristic notify() return type from `err_t` to `bool`
- change BLEHid report function return type from `err_t` to `bool`
- change BLEMid send/sendSplit
- change BLEMid send/sendSplit return type from `err_t` to `bool`
- New BLE Serivce
- Apple Notification Center Service (ANCS)
- Central BLE UART
+2
View File
@@ -113,6 +113,8 @@ uint32_t setLoopStacksize(void);
// Hint instruction to tell CPU go to low power mode
#define waitForEvent() __WFE()
extern void rtos_idle_callback(void) ATTR_WEAK;
/*
* digitalPinToTimer(..) is AVR-specific and is not defined for nRF52
* architecture. If you need to check if a pin supports PWM you must
+4 -7
View File
@@ -82,18 +82,15 @@ bool SchedulerRTOS::startLoop(taskfunc_t task, const char* name, uint32_t stack_
return pdPASS == xTaskCreate( _redirect_task, name, stack_size, (void*) task, TASK_PRIO_NORMAL, &handle);
}
extern "C"
{
void vApplicationIdleHook( void )
{
// Enter low-power mode will turn of hardware PWM
// Only go there if no PWM device is active.
if ( !(PWM0.begun() || PWM1.begun() || PWM2.begun() ) )
{
waitForEvent();
}
// Internal background task
// Weak symbol do nothing if is not implementation
rtos_idle_callback();
}
}