Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed WakeUp_STM32
main.cpp@0:0ae81c915caf, 2021-11-11 (annotated)
- Committer:
- cspista
- Date:
- Thu Nov 11 14:51:50 2021 +0000
- Revision:
- 0:0ae81c915caf
Final version
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| cspista | 0:0ae81c915caf | 1 | #include "mbed.h" |
| cspista | 0:0ae81c915caf | 2 | #include "WakeUp_STM32.h" // see at https://os.mbed.com/users/kenjiArai/code/WakeUp_STM32/ |
| cspista | 0:0ae81c915caf | 3 | |
| cspista | 0:0ae81c915caf | 4 | DigitalOut myled(LED1); |
| cspista | 0:0ae81c915caf | 5 | |
| cspista | 0:0ae81c915caf | 6 | int main() { |
| cspista | 0:0ae81c915caf | 7 | uint32_t loop_count = 1; |
| cspista | 0:0ae81c915caf | 8 | while(true) { |
| cspista | 0:0ae81c915caf | 9 | // In run mode Imax = 44 mA |
| cspista | 0:0ae81c915caf | 10 | myled = !myled; |
| cspista | 0:0ae81c915caf | 11 | wait(0.25); |
| cspista | 0:0ae81c915caf | 12 | if (++loop_count > 4) { |
| cspista | 0:0ae81c915caf | 13 | WakeUp::standby_then_reset(30000); // 30sec |
| cspista | 0:0ae81c915caf | 14 | // In standby mode I = 3.7 uA |
| cspista | 0:0ae81c915caf | 15 | while(true) {;} // never executing this line |
| cspista | 0:0ae81c915caf | 16 | } |
| cspista | 0:0ae81c915caf | 17 | } |
| cspista | 0:0ae81c915caf | 18 | } |