TRR 2018 / Mbed 2 deprecated biniou-TRR2019

Dependencies:   mbed MPU6050

utils.cpp

Committer:
GaspardD
Date:
2019-09-29
Revision:
6:ab9f3695633f
Parent:
5:8bbe640528bc
Child:
8:f23601373e8b

File content as of revision 6:ab9f3695633f:

#include "utils.h"

bool b_UTILS_flag_button = false;
bool b_UTILS_flag_emergency_stop = false;
Timer timerSinceStart;
bool b_chassis_with_pushbutton;
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);


void it_pressed()
{
    if(timerSinceStart.read_ms() > 500) {
        timerSinceStart.reset();
        pc.printf("Button pressed\r\n");
        b_UTILS_flag_button = true;
        b_UTILS_flag_emergency_stop = false;
    }
    return;
}