mbed-os github

Dependencies:   ADS1015 Faulhaber HTU21D_mod MS5837_potless Sensor_Head_RevB_3 USBDevice_dfu Utilsdfu beep

Fork of ARNSRS_testDFU by POTLESS

Files at this revision

API Documentation at this revision

Comitter:
potless
Date:
Fri May 04 08:13:31 2018 +0000
Parent:
43:5ae8baf28e32
Child:
45:61ba3cc4fc55
Commit message:
version carte ARNSRS sans format flash

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Thu May 03 08:44:07 2018 +0000
+++ b/main.cpp	Fri May 04 08:13:31 2018 +0000
@@ -28,8 +28,8 @@
 #define PIN_V_PILES_DIGI PC_3
 #define PIN_V_USB_DIGI PA_0
 
-#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(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);}
 
 //PinName pwm, PinName nSleep, PinName fwd, PinName rev, PinName channelA, PinName channelB, int pulsesPerRev, int Rapport, Encoding encoding = X2_ENCODING
@@ -37,14 +37,14 @@
 Faulhaber Servo_Fuite("Servo_Fuite", PWM_SERVO_FUITE, nSleep_SERVO_FUITE, FWD_SERVO_FUITE, REV_SERVO_FUITE, Channel_A_SERVO_FUITE, Channel_B_SERVO_FUITE, 16, 207, Faulhaber::X2_ENCODING);
 
 //Moniteur série, Serial 2
-Serial serialMonit(PC_10, PC_11, 115200);
-//Serial serialMonit(PA_2, PA_3,115200);
+Serial serialMonit(PC_10, PC_11, 115200); // UART 3 pour windev nucleo - version définitive sur uart3 pour carte ARNSRS
+//Serial serialMonit(PA_2, PA_3,115200); // UART2 à décommenter pour carte ARNSRS
 
 //Communication avec l'IHM
 //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);
+//Serial serial(USBTX, USBRX, 115200);
 
 //Init de la lib ARNSRS;
 SENSOR_HEAD_REV_B sensors;
@@ -374,17 +374,17 @@
 
     while(serialMonit.readable()) {
         if ((indexParam  == sizeParam) || newParamFlag  == true) { //éviter la saturation du buffer
-            NVIC_DisableIRQ(USART3_IRQn);
+            NVIC_DisableIRQ(USART2_IRQn);  // USART 2 pour carte ARNSRS
             char char_flush = serialMonit.getc();
-            NVIC_EnableIRQ(USART3_IRQn);
+            NVIC_EnableIRQ(USART2_IRQn); // USART 2 pour carte ARNSRS
         } else {
-            NVIC_DisableIRQ(USART3_IRQn);
+            NVIC_DisableIRQ(USART2_IRQn); // USART 2 pour carte ARNSRS
             param [indexParam ++] = serialMonit.getc();//chargement du buffer dans le message
             if ((indexParam == sizeParam) || (param[indexParam - 1] == '\n')) {//le message est complet ou nouvelle ligne ou autre si on veut...
                 param[indexParam] = 0;
                 newParamFlag  = true;
             }
-            NVIC_EnableIRQ(USART3_IRQn);
+            NVIC_EnableIRQ(USART2_IRQn); // USART 2 pour carte ARNSRS
         }
     }
 }
@@ -765,9 +765,9 @@
        
         //Vers le moniteur série
         if (FLAG_AFF) {
-            NVIC_DisableIRQ(USART3_IRQn);
+            NVIC_DisableIRQ(USART3_IRQn); // USART 2 si ARNSRS mais plus utilisé
             Affichage();
-            NVIC_EnableIRQ(USART3_IRQn);
+            NVIC_EnableIRQ(USART3_IRQn); // USART 2 si ARNSRS mais plus utilisé
         }
 
         //Enregistrement de la chaine