Bare-metal configuration with EventQueue for a Bluepill board.
Warning
It does not work with the Mbed Online Compiler.
Follow these steps to import and compile it with Mbed CLI:
mbed import https://os.mbed.com/users/hudakz/code/Baremetal_EventQue_Bluepill mbed compile -t GCC_ARM -m bluepill
main.cpp
- Committer:
- hudakz
- Date:
- 2020-06-04
- Revision:
- 4:b57198581ca4
- Parent:
- 3:f25880700bda
File content as of revision 4:b57198581ca4:
#include "mbed.h" DigitalOut led1(LED1); InterruptIn button(PA_8, PullUp); EventQueue eventQueue; void onButtonFall(void) { printf("Button pushed\r\n"); } void toggleLED() { led1 = !led1; } int main() { button.fall(eventQueue.event(onButtonFall)); eventQueue.call_every(500, toggleLED); eventQueue.dispatch_forever(); }