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@8:f23601373e8b, 2019-10-02 (annotated)
- Committer:
- GaspardD
- Date:
- Wed Oct 02 22:25:12 2019 +0000
- Revision:
- 8:f23601373e8b
- Parent:
- 6:ab9f3695633f
- Child:
- 9:1b54bac6d9a7
angle correction working
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 | 8:f23601373e8b | 3 | bool b_UTILS_flag_button_ESC = false; |
GaspardD | 8:f23601373e8b | 4 | bool b_UTILS_flag_button_SECTIONS = false; |
GaspardD | 1:8faddee0e52f | 5 | bool b_UTILS_flag_emergency_stop = false; |
GaspardD | 8:f23601373e8b | 6 | Timer t_utils_timerSinceStart; |
GaspardD | 6:ab9f3695633f | 7 | s_Section* s_UTILS_currentSection = NULL; |
GaspardD | 4:efa207509f63 | 8 | |
GaspardD | 8:f23601373e8b | 9 | Serial rs_UTILS_pc(USBTX, USBRX); |
GaspardD | 8:f23601373e8b | 10 | Serial rs_UTILS_odroid(PC_10, PC_11,115200); |
GaspardD | 8:f23601373e8b | 11 | InterruptIn b_UTILS_button(USER_BUTTON); |
GaspardD | 8:f23601373e8b | 12 | InterruptIn b_UTILS_emergency_signal(PD_0); |
GaspardD | 1:8faddee0e52f | 13 | |
GaspardD | 1:8faddee0e52f | 14 | |
GaspardD | 4:efa207509f63 | 15 | void it_pressed() |
GaspardD | 4:efa207509f63 | 16 | { |
GaspardD | 8:f23601373e8b | 17 | rs_UTILS_pc.printf("t_utils_timerSinceStart.read_ms(): %ld\r\n", t_utils_timerSinceStart.read_ms()); |
GaspardD | 8:f23601373e8b | 18 | if(t_utils_timerSinceStart.read_ms() > 500) { |
GaspardD | 8:f23601373e8b | 19 | t_utils_timerSinceStart.reset(); |
GaspardD | 8:f23601373e8b | 20 | rs_UTILS_pc.printf("Button pressed\r\n"); |
GaspardD | 8:f23601373e8b | 21 | b_UTILS_flag_button_SECTIONS = true; |
GaspardD | 8:f23601373e8b | 22 | b_UTILS_flag_button_ESC = true; |
GaspardD | 4:efa207509f63 | 23 | b_UTILS_flag_emergency_stop = false; |
GaspardD | 4:efa207509f63 | 24 | } |
GaspardD | 4:efa207509f63 | 25 | return; |
GaspardD | 1:8faddee0e52f | 26 | } |
GaspardD | 8:f23601373e8b | 27 | |
GaspardD | 8:f23601373e8b | 28 | void it_emergency_signal_recieved() |
GaspardD | 8:f23601373e8b | 29 | { |
GaspardD | 8:f23601373e8b | 30 | b_UTILS_flag_emergency_stop = true; |
GaspardD | 8:f23601373e8b | 31 | } |