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.
Diff: utils.cpp
- Revision:
- 8:f23601373e8b
- Parent:
- 6:ab9f3695633f
- Child:
- 9:1b54bac6d9a7
--- a/utils.cpp Sun Sep 29 20:22:43 2019 +0000
+++ b/utils.cpp Wed Oct 02 22:25:12 2019 +0000
@@ -1,24 +1,31 @@
#include "utils.h"
-bool b_UTILS_flag_button = false;
+bool b_UTILS_flag_button_ESC = false;
+bool b_UTILS_flag_button_SECTIONS = false;
bool b_UTILS_flag_emergency_stop = false;
-Timer timerSinceStart;
-bool b_chassis_with_pushbutton;
+Timer t_utils_timerSinceStart;
s_Section* s_UTILS_currentSection = NULL;
-Serial pc(USBTX, USBRX);
-Serial odroid(PC_10, PC_11,115200);
-InterruptIn button(USER_BUTTON);
-DigitalIn chassisMode(PE_11);
+Serial rs_UTILS_pc(USBTX, USBRX);
+Serial rs_UTILS_odroid(PC_10, PC_11,115200);
+InterruptIn b_UTILS_button(USER_BUTTON);
+InterruptIn b_UTILS_emergency_signal(PD_0);
void it_pressed()
{
- if(timerSinceStart.read_ms() > 500) {
- timerSinceStart.reset();
- pc.printf("Button pressed\r\n");
- b_UTILS_flag_button = true;
+ rs_UTILS_pc.printf("t_utils_timerSinceStart.read_ms(): %ld\r\n", t_utils_timerSinceStart.read_ms());
+ if(t_utils_timerSinceStart.read_ms() > 500) {
+ t_utils_timerSinceStart.reset();
+ rs_UTILS_pc.printf("Button pressed\r\n");
+ b_UTILS_flag_button_SECTIONS = true;
+ b_UTILS_flag_button_ESC = true;
b_UTILS_flag_emergency_stop = false;
}
return;
}
+
+void it_emergency_signal_recieved()
+{
+ b_UTILS_flag_emergency_stop = true;
+ }