mbed-os github
Dependencies: ADS1015 Faulhaber HTU21D_mod MS5837_potless Sensor_Head_RevB_3 USBDevice_dfu Utilsdfu beep
Fork of ARNSRS_testDFU by
Diff: main.cpp
- Revision:
- 69:9afe54d53bb0
- Parent:
- 68:7f4ab9c03b32
- Child:
- 70:0ae5fd4f826c
diff -r 7f4ab9c03b32 -r 9afe54d53bb0 main.cpp --- a/main.cpp Thu Jul 12 10:01:34 2018 +0000 +++ b/main.cpp Thu Jul 12 13:27:37 2018 +0000 @@ -34,7 +34,8 @@ //#define OUTPUT(...) { NVIC_DisableIRQ(USART3_IRQn); serialMonit.printf(__VA_ARGS__); fflush(stdout);NVIC_EnableIRQ(USART3_IRQn);} //#define OUTPUT(...) { NVIC_DisableIRQ(USART2_IRQn); serialMonit.printf(__VA_ARGS__); fflush(stdout);NVIC_EnableIRQ(USART2_IRQn);} //#define OUTPUT(...) { NVIC_DisableIRQ(OTG_FS_IRQn);serialMonit.printf(__VA_ARGS__); fflush(stdout);NVIC_EnableIRQ(OTG_FS_IRQn);} -#define TRACEUR(...) { serialMonit.printf(__VA_ARGS__); fflush(stdout);} +#define TRACEUR_DEBUG(...) { printf(__VA_ARGS__); fflush(stdout);} +//#define TRACEUR(...) { serialMonit.printf(__VA_ARGS__); fflush(stdout);} #define OUTPUT(...) { serialMonit.printf(__VA_ARGS__); fflush(stdout);} #define IHM(...) { NVIC_DisableIRQ(USART3_IRQn); display.printf(__VA_ARGS__); fflush(stdout);NVIC_EnableIRQ(USART3_IRQn);} @@ -284,6 +285,8 @@ void USB_unplugged() { DEBUG(" La prise USB a été débranchée.\n"); + + __disable_irq(); buzzer.beep(1000,0.1); wait_ms(100); @@ -322,7 +325,7 @@ save_position(); - wait(1); + //wait(1); //Arrêt des enregistrements FLAG_REC = false; @@ -408,12 +411,11 @@ } void Traceur_Arduino() { - - //Important pour PIG +/* + //Important pour PID TRACEUR("%d, ", ppO2); TRACEUR("%d, ", consigne); - /* //TODO à commenter je pense... TRACEUR("%d, " , co2); TRACEUR("%d, ", (int)OTU); @@ -425,12 +427,31 @@ TRACEUR("%d, " , CellO2_2); TRACEUR("%f, " , volet_poumon_Position); TRACEUR("%f, " , volet_fuite_Position); + + + //Toujours finir par \r\n + TRACEUR("\r\n"); +*/ + //Important pour PID + TRACEUR_DEBUG("%d, ", ppO2); + TRACEUR_DEBUG("%d, ", consigne); + + /* + //TODO à commenter je pense... + TRACEUR_DEBUG("%d, " , co2); + TRACEUR_DEBUG("%d, ", (int)OTU); + TRACEUR_DEBUG("%f, ", pression); + TRACEUR_DEBUG("%f, ", Temp1); + TRACEUR_DEBUG("%f, ", Temp2); + TRACEUR_DEBUG("%d, ", Humid); + TRACEUR_DEBUG("%d, " , CellO2_1); + TRACEUR_DEBUG("%d, " , CellO2_2); + TRACEUR_DEBUG("%f, " , volet_poumon_Position); + TRACEUR_DEBUG("%f, " , volet_fuite_Position); */ //Toujours finir par \r\n - TRACEUR("\r\n"); - - + TRACEUR_DEBUG("\r\n"); } //Passage en mode SECU @@ -660,7 +681,7 @@ OUTPUT(" Arrêt du tracé Arduino.\r\n"); } else { FLAG_TRACE = true; - OUTPUT(" Démarrage du tracé Arduino. Fremez le moniteur et ouvrez le traceur.\r\n"); + OUTPUT(" Démarrage du tracé Arduino.\r\n"); } } else if (0 == strcmp(com, "PING")) { Commande_IHM = 1;