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@5:8bbe640528bc, 2019-09-29 (annotated)
- Committer:
- GaspardD
- Date:
- Sun Sep 29 17:09:48 2019 +0000
- Revision:
- 5:8bbe640528bc
- Parent:
- 4:efa207509f63
- Child:
- 6:ab9f3695633f
jumper detection
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 | 4:efa207509f63 | 6 | |
GaspardD | 1:8faddee0e52f | 7 | Serial pc(USBTX, USBRX); |
GaspardD | 1:8faddee0e52f | 8 | InterruptIn button(USER_BUTTON); |
GaspardD | 5:8bbe640528bc | 9 | DigitalIn chassisMode(PE_11); |
GaspardD | 1:8faddee0e52f | 10 | |
GaspardD | 1:8faddee0e52f | 11 | |
GaspardD | 4:efa207509f63 | 12 | void it_pressed() |
GaspardD | 4:efa207509f63 | 13 | { |
GaspardD | 4:efa207509f63 | 14 | if(timerSinceStart.read_ms() > 500) { |
GaspardD | 4:efa207509f63 | 15 | timerSinceStart.reset(); |
GaspardD | 4:efa207509f63 | 16 | pc.printf("Button pressed\r\n"); |
GaspardD | 4:efa207509f63 | 17 | b_UTILS_flag_button = true; |
GaspardD | 4:efa207509f63 | 18 | b_UTILS_flag_emergency_stop = false; |
GaspardD | 4:efa207509f63 | 19 | } |
GaspardD | 4:efa207509f63 | 20 | return; |
GaspardD | 1:8faddee0e52f | 21 | } |