Added Restart(by RESET) function from Standby mode only for some Nucleo boards (STM32 series)
Dependencies: LPC1114_WakeInterruptIn
Fork of WakeUp by
Example program using "Standby function" for Nucleo series is here.
/users/kenjiArai/code/Check_StandBy/
Revision 23:69a0c843e4bd, committed 2017-06-14
- Comitter:
- Sissors
- Date:
- Wed Jun 14 08:56:55 2017 +0000
- Parent:
- 22:49ca85e8822f
- Child:
- 24:65c04a02ad45
- Commit message:
- Switched WakeUp to use the new callback system, to remove warnings during compilation.; ; Attached normal functions should still work the same. Attaching member functions is now:; WakeUp::attach(callback(&object, &Class::function));
Changed in this revision
--- a/Device/WakeUp_Freescale.cpp Wed Nov 11 20:20:27 2015 +0000 +++ b/Device/WakeUp_Freescale.cpp Wed Jun 14 08:56:55 2017 +0000 @@ -3,7 +3,7 @@ #include "WakeUp.h" #include "us_ticker_api.h" -FunctionPointer WakeUp::callback; +Callback<void()> WakeUp::callback; float WakeUp::cycles_per_ms = 1.0; static uint16_t remainder_count;
--- a/Device/WakeUp_LPC11XX.cpp Wed Nov 11 20:20:27 2015 +0000 +++ b/Device/WakeUp_LPC11XX.cpp Wed Jun 14 08:56:55 2017 +0000 @@ -17,7 +17,7 @@ WakeInterruptIn IRQ_in(WakeUpPin); PwmOut pulse_out(WakeUpPin); -FunctionPointer WakeUp::callback; +Callback<void()> WakeUp::callback; float WakeUp::cycles_per_ms = 20.0; static uint32_t old_clk_sel = ~0;
--- a/Device/WakeUp_LPC11u24.cpp Wed Nov 11 20:20:27 2015 +0000 +++ b/Device/WakeUp_LPC11u24.cpp Wed Jun 14 08:56:55 2017 +0000 @@ -9,7 +9,7 @@ #include "WakeUp.h" -FunctionPointer WakeUp::callback; +Callback<void()> WakeUp::callback; float WakeUp::cycles_per_ms = 5.0; void WakeUp::set_ms(uint32_t ms)
--- a/Device/WakeUp_LPC812.cpp Wed Nov 11 20:20:27 2015 +0000 +++ b/Device/WakeUp_LPC812.cpp Wed Jun 14 08:56:55 2017 +0000 @@ -2,7 +2,7 @@ #include "WakeUp.h" -FunctionPointer WakeUp::callback; +Callback<void()> WakeUp::callback; float WakeUp::cycles_per_ms = 10.0; void WakeUp::set_ms(uint32_t ms)
--- a/Device/WakeUp_STM_RTC.cpp Wed Nov 11 20:20:27 2015 +0000 +++ b/Device/WakeUp_STM_RTC.cpp Wed Jun 14 08:56:55 2017 +0000 @@ -26,7 +26,7 @@ //Disabling the Backup Powerdomain does not seem to work nicely anymore if you want to use other RTC functions afterwards. //For now I have disabled it in code, if you find WakeUp increases your powerconsumption, try enabling it again (code is still there, just commented) -FunctionPointer WakeUp::callback; +Callback<void()> WakeUp::callback; void WakeUp::set_ms(uint32_t ms) {
--- a/WakeUp.h Wed Nov 11 20:20:27 2015 +0000 +++ b/WakeUp.h Wed Jun 14 08:56:55 2017 +0000 @@ -66,18 +66,12 @@ * This means that clock speed dependent functions, such as printf * might end up distorted. * - * Also supports normal way to attach member functions - * (not documented for simplicity) + * It uses the new Callback system to attach functions. * * @param *function function to call */ - static void attach(void (*function)(void)) { - callback.attach(function); - } - - template<typename T> - static void attach(T *object, void (T::*member)(void)) { - callback.attach(object, member); + static void attach(Callback<void()> function) { + callback = function; } /** @@ -92,7 +86,7 @@ private: - static FunctionPointer callback; + static Callback<void()> callback; static void irq_handler(void); static float cycles_per_ms; }; \ No newline at end of file