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.
utils.cpp@6:ab9f3695633f, 2019-09-29 (annotated)
- Committer:
- GaspardD
- Date:
- Sun Sep 29 20:07:54 2019 +0000
- Revision:
- 6:ab9f3695633f
- Parent:
- 5:8bbe640528bc
- Child:
- 8:f23601373e8b
jules guesde mc gyver;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
GaspardD | 1:8faddee0e52f | 1 | #include "utils.h" |
GaspardD | 1:8faddee0e52f | 2 | |
GaspardD | 1:8faddee0e52f | 3 | bool b_UTILS_flag_button = false; |
GaspardD | 1:8faddee0e52f | 4 | bool b_UTILS_flag_emergency_stop = false; |
GaspardD | 4:efa207509f63 | 5 | Timer timerSinceStart; |
GaspardD | 6:ab9f3695633f | 6 | bool b_chassis_with_pushbutton; |
GaspardD | 6:ab9f3695633f | 7 | s_Section* s_UTILS_currentSection = NULL; |
GaspardD | 4:efa207509f63 | 8 | |
GaspardD | 1:8faddee0e52f | 9 | Serial pc(USBTX, USBRX); |
GaspardD | 6:ab9f3695633f | 10 | Serial odroid(PC_10, PC_11,115200); |
GaspardD | 1:8faddee0e52f | 11 | InterruptIn button(USER_BUTTON); |
GaspardD | 5:8bbe640528bc | 12 | DigitalIn chassisMode(PE_11); |
GaspardD | 1:8faddee0e52f | 13 | |
GaspardD | 1:8faddee0e52f | 14 | |
GaspardD | 4:efa207509f63 | 15 | void it_pressed() |
GaspardD | 4:efa207509f63 | 16 | { |
GaspardD | 4:efa207509f63 | 17 | if(timerSinceStart.read_ms() > 500) { |
GaspardD | 4:efa207509f63 | 18 | timerSinceStart.reset(); |
GaspardD | 4:efa207509f63 | 19 | pc.printf("Button pressed\r\n"); |
GaspardD | 4:efa207509f63 | 20 | b_UTILS_flag_button = true; |
GaspardD | 4:efa207509f63 | 21 | b_UTILS_flag_emergency_stop = false; |
GaspardD | 4:efa207509f63 | 22 | } |
GaspardD | 4:efa207509f63 | 23 | return; |
GaspardD | 1:8faddee0e52f | 24 | } |