Procházet zdrojové kódy

Fixes for -Wundef

thanks Willy-JL
MX před 1 rokem
rodič
revize
56e3d02c9e
1 změnil soubory, kde provedl 5 přidání a 5 odebrání
  1. 5 5
      scenes/scope_scene_run.c

+ 5 - 5
scenes/scope_scene_run.c

@@ -294,7 +294,7 @@ void AdcDmaTransferHalf_Callback() {
 
 
 void Activate_ADC(void) {
 void Activate_ADC(void) {
     __IO uint32_t wait_loop_index = 0U;
     __IO uint32_t wait_loop_index = 0U;
-#if(USE_TIMEOUT == 1)
+#if defined(USE_TIMEOUT) && (USE_TIMEOUT == 1)
     uint32_t Timeout = 0U; /* Variable used for timeout management */
     uint32_t Timeout = 0U; /* Variable used for timeout management */
 #endif /* USE_TIMEOUT */
 #endif /* USE_TIMEOUT */
     if(LL_ADC_IsEnabled(ADC1) == 0) {
     if(LL_ADC_IsEnabled(ADC1) == 0) {
@@ -307,12 +307,12 @@ void Activate_ADC(void) {
         }
         }
         LL_ADC_StartCalibration(ADC1, LL_ADC_SINGLE_ENDED);
         LL_ADC_StartCalibration(ADC1, LL_ADC_SINGLE_ENDED);
 
 
-#if(USE_TIMEOUT == 1)
+#if defined(USE_TIMEOUT) && (USE_TIMEOUT == 1)
         Timeout = ADC_CALIBRATION_TIMEOUT_MS;
         Timeout = ADC_CALIBRATION_TIMEOUT_MS;
 #endif /* USE_TIMEOUT */
 #endif /* USE_TIMEOUT */
 
 
         while(LL_ADC_IsCalibrationOnGoing(ADC1) != 0) {
         while(LL_ADC_IsCalibrationOnGoing(ADC1) != 0) {
-#if(USE_TIMEOUT == 1)
+#if defined(USE_TIMEOUT) && (USE_TIMEOUT == 1)
             if(LL_SYSTICK_IsActiveCounterFlag()) {
             if(LL_SYSTICK_IsActiveCounterFlag()) {
                 if(Timeout-- == 0) {
                 if(Timeout-- == 0) {
                 }
                 }
@@ -324,11 +324,11 @@ void Activate_ADC(void) {
             wait_loop_index--;
             wait_loop_index--;
         }
         }
         LL_ADC_Enable(ADC1);
         LL_ADC_Enable(ADC1);
-#if(USE_TIMEOUT == 1)
+#if defined(USE_TIMEOUT) && (USE_TIMEOUT == 1)
         Timeout = ADC_ENABLE_TIMEOUT_MS;
         Timeout = ADC_ENABLE_TIMEOUT_MS;
 #endif /* USE_TIMEOUT */
 #endif /* USE_TIMEOUT */
         while(LL_ADC_IsActiveFlag_ADRDY(ADC1) == 0) {
         while(LL_ADC_IsActiveFlag_ADRDY(ADC1) == 0) {
-#if(USE_TIMEOUT == 1)
+#if defined(USE_TIMEOUT) && (USE_TIMEOUT == 1)
             /* Check Systick counter flag to decrement the time-out value */
             /* Check Systick counter flag to decrement the time-out value */
             if(LL_SYSTICK_IsActiveCounterFlag()) {
             if(LL_SYSTICK_IsActiveCounterFlag()) {
                 if(Timeout-- == 0) {
                 if(Timeout-- == 0) {