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.
Dependencies: ADS1015 Faulhaber HTU21D_mod MS5837_potless Sensor_Head_RevB_3 USBDevice_dfu Utilsdfu beep
Fork of ARNSRS_testDFU by
Diff: main.cpp
- Revision:
- 46:28298df0ac55
- Parent:
- 45:61ba3cc4fc55
- Child:
- 47:89a088bc8866
diff -r 61ba3cc4fc55 -r 28298df0ac55 main.cpp
--- a/main.cpp Sat May 05 17:21:12 2018 +0000
+++ b/main.cpp Tue May 15 14:22:53 2018 +0000
@@ -32,7 +32,7 @@
//#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 IHM(...) { NVIC_DisableIRQ(USART3_IRQn); display.printf(__VA_ARGS__); fflush(stdout);NVIC_EnableIRQ(USART3_IRQn);}
+#define IHM(...) { NVIC_DisableIRQ(USART3_IRQn); display.printf(__VA_ARGS__); fflush(stdout);NVIC_EnableIRQ(USART3_IRQn);}
//PinName pwm, PinName nSleep, PinName fwd, PinName rev, PinName channelA, PinName channelB, int pulsesPerRev, int Rapport, Encoding encoding = X2_ENCODING
Faulhaber Servo_Poumon("Servo_Poumon", PWM_SERVO_POUMON, nSleep_SERVO_POUMON, FWD_SERVO_POUMON, REV_SERVO_POUMON, Channel_A_SERVO_POUMON, Channel_B_SERVO_POUMON, 16, 207, Faulhaber::X2_ENCODING);
@@ -43,7 +43,7 @@
Serial serialMonit(PA_2, PA_3,115200); // UART2 à décommenter pour carte ARNSRS
//Communication avec l'IHM
-//Serial display(PC_4, PC_5, 115200);
+Serial display(PC_4, PC_5, 115200);
//Moniteur pour le debug avec une nucleo, a commenter avec la carte definitive
//Serial serial(USBTX, USBRX, 115200);
@@ -67,7 +67,7 @@
bool FLAG_WINDEV = false;
//Flag pour envoyer à l'IHM...
-bool FLAG_DISPLAY = false;
+bool FLAG_DISPLAY = true;
//Flag pour interrompre l'enregistrement si on veut...
bool FLAG_REC = true;
@@ -132,8 +132,7 @@
bool EN_MODE_SECU = false;
//Test des alim
-DigitalIn V_USB_DIGI(PIN_V_USB_DIGI);
-DigitalIn V_PILES_DIGI(PIN_V_PILES_DIGI);
+//DigitalIn V_PILES_DIGI(PIN_V_PILES_DIGI);
//Test voltage piles
AnalogIn V_PILES_ANALOG(PIN_V_PILES_ANALOG);
@@ -253,7 +252,7 @@
HAL_PWR_EnableWakeUpPin(PWR_WAKEUP_PIN2_LOW); // low parce qu'on veut que ça redémarre avec le user button TODO à passer sur High pour que ça redémarrage avec l'arrivée du hus sur l'USB
*/
HAL_PWREx_EnablePullUpPullDownConfig() ;
- HAL_PWREx_EnableGPIOPullDown(PWR_GPIO_A,PWR_GPIO_BIT_0);
+ HAL_PWREx_EnableGPIOPullDown(PWR_GPIO_A, PWR_GPIO_BIT_0);
HAL_PWR_DisableWakeUpPin(PWR_WAKEUP_PIN1); // pour PA_0
// Clear wake up Flag
@@ -714,14 +713,15 @@
//OUTPUT(" Cliquez sur le bouton help pour voir la liste des \r\n commandes administrateur disponibles.\r\n");
- //OUTPUT("$\r\n");
+ OUTPUT("$\r\n");
wait(0.5);
UTILS::Dir_Flash(&serialMonit);
- OUTPUT(" Flash OK\r\n");
serialMonit.attach(&callbackParam, Serial::RxIrq);
- E5V=1;
+ vusb_off_on.fall(&Stop_Sequence);
+
+ E5V = 1;
while (true) {
@@ -766,9 +766,9 @@
}
//Pour l'IHM
- //if (FLAG_DISPLAY) {
- // IHM("%s\r\n", to_store);
- //}
+ if (FLAG_DISPLAY) {
+ IHM("%s\r\n", to_store);
+ }
//Vers le moniteur série
if (FLAG_AFF) {
