Diff of /leds.c [0dfe08] .. [3d07ba] Maximize Restore

  Switch to side-by-side view

--- a/leds.c
+++ b/leds.c
@@ -20,8 +20,6 @@
 
 unsigned char leds_status, leds_left, leds_right;
 unsigned char updatevuflag;
-unsigned char blinkinterval;
-unsigned char freetimer;
 
 
 void InitLEDS()
@@ -30,17 +28,12 @@
   PORT_LEDS->CR1 = 0xFF;
   PORT_MUX->DDR |= PIN_MUX_STATUS | PIN_MUX_LEFT | PIN_MUX_RIGHT;
   PORT_MUX->CR1 |= PIN_MUX_STATUS | PIN_MUX_LEFT | PIN_MUX_RIGHT;
-  PORT_ONAIR->DDR |= PIN_ONAIR;
-  PORT_ONAIR->CR1 |= PIN_ONAIR;
-
-  GPIOA->ODR |= BIT(3);
   
 #ifdef LEDS_PROFILE_ON
   GPIOG->DDR = GPIO_PIN_0;
   GPIOG->CR1 = GPIO_PIN_0;
 #endif
   
-  SetOnAirLED(0,0);
   
   TIM4_DeInit();
   TIM4_TimeBaseInit(TIM4_PRESCALER_128,255);
@@ -48,43 +41,15 @@
   TIM4_Cmd(ENABLE);
 }
 
-void SetOnAirLED(unsigned char onoff, unsigned char blinkhz)
-{
-  if(blinkhz == 0)
-  {
-    if(onoff)
-    {
-      PORT_ONAIR->ODR |= PIN_ONAIR;
-    } else {
-      PORT_ONAIR->ODR &= ~PIN_ONAIR;
-    }
-    
-    blinkinterval = 0;
-  } else {
-    blinkinterval = (unsigned char)(TIM4_HZ / 2 / (unsigned short)blinkhz);
-  }
-}
-
-#if defined(__ICCSTM8__)
 #pragma vector = TIM4_OVR_UIF_vector 
 __interrupt void TIM_Update_vector(void)
-#elif defined(SDCC)
-void TIM_Update_vector(void) __interrupt(TIM4_OVR_UIF_vector)
-#endif
-
 {
-  static unsigned char turn=0;
-  static unsigned char updatecounter=0;
-  static unsigned char onairblink_cnt=0; 
-#ifdef STATISTICS_DISPLAY_BUFFER_STATUS
-  static int buffer_rolling_median=0;
-#endif
+  static char turn=0;
+  static char updatecounter=0;
 
 #ifdef LEDS_PROFILE_ON
   GPIOG->ODR = GPIO_PIN_0;
 #endif
-  
-  freetimer++;
   
   updatecounter++;
   
@@ -92,16 +57,6 @@
   {
     updatevuflag = 1;
     updatecounter = 0;
-  }
-  
-  if(blinkinterval)
-  {
-    onairblink_cnt++;
-    if(onairblink_cnt > blinkinterval)
-    {
-      PORT_ONAIR->ODR = PORT_ONAIR->ODR ^ PIN_ONAIR;
-      onairblink_cnt = 0;
-    }
   }
   
   PORT_MUX->ODR &= ~( PIN_MUX_STATUS | PIN_MUX_LEFT | PIN_MUX_RIGHT );
@@ -118,12 +73,7 @@
     break;
   case 2:
     PORT_MUX->ODR |= PIN_MUX_RIGHT;
-#ifdef STATISTICS_DISPLAY_BUFFER_STATUS
-    if(buffer_status) buffer_rolling_median = (buffer_rolling_median * 4) / 5 + buffer_status / 5;
-    PORT_LEDS->ODR = buffer_rolling_median / 16;
-#else
     PORT_LEDS->ODR=leds_right;
-#endif
     break;
   }
   
@@ -132,18 +82,8 @@
    
   TIM4_ClearITPendingBit(TIM4_IT_UPDATE);  
  
-#ifdef STATISTICS_DATA_RATE
-  if(data_rate_counter >= 112)
-  {
-    data_rate = data_rate_sumup << 5;
-    data_rate_sumup = 0;
-    data_rate_counter = 0;
-  }
-  data_rate_counter++;
-#endif
-  
 #ifdef LEDS_PROFILE_ON
   GPIOG->ODR = 0;
 #endif
  
-}
+}