Subversion Repositories FlightCtrl

Rev

Rev 2348 | Rev 2380 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2348 Rev 2370
Line 3... Line 3...
3
 
3
 
4
uint16_t LED1_Timing = 0;
4
uint16_t LED1_Timing = 0;
5
uint16_t LED2_Timing = 0;
5
uint16_t LED2_Timing = 0;
6
unsigned char J16Blinkcount = 0, J16Mask = 1;
6
unsigned char J16Blinkcount = 0, J16Mask = 1;
-
 
7
unsigned char J17Blinkcount = 0, J17Mask = 1;
Line 7... Line 8...
7
unsigned char J17Blinkcount = 0, J17Mask = 1;
8
unsigned char NC_Wait_for_LED = 0;  // signal to NC: Wait for the LAD PAtter before switching to the next WP
8
 
9
 
9
// initializes the LED control outputs J16, J17
10
// initializes the LED control outputs J16, J17
10
void LED_Init(void)
11
void LED_Init(void)
Line 54... Line 55...
54
// Output 1
55
// Output 1
55
 if(!J16Warn)    
56
 if(!J16Warn)    
56
  {
57
  {
57
  if((EE_Parameter.BitConfig & CFG_MOTOR_BLINK1) && !MotorenEin) {if(EE_Parameter.BitConfig & CFG_MOTOR_OFF_LED1) J16_ON; else J16_OFF;}
58
  if((EE_Parameter.BitConfig & CFG_MOTOR_BLINK1) && !MotorenEin) {if(EE_Parameter.BitConfig & CFG_MOTOR_OFF_LED1) J16_ON; else J16_OFF;}
58
  else
59
  else
59
  if((EE_Parameter.J16Timing > 247) && (Parameter_J16Timing > 220)) {if(J16Bitmask & 128) J16_ON; else J16_OFF; J16Mask = 1;}
60
  if((EE_Parameter.J16Timing > 247) && (Parameter_J16Timing > 220)) {if(J16Bitmask & 128) J16_ON; else J16_OFF; J16Mask = 1; NC_Wait_for_LED = 0;}  // Manual overwrite
60
  else
61
  else
61
  if((EE_Parameter.J16Timing > 247) && (Parameter_J16Timing == 5))  {if(J16Bitmask & 128) J16_OFF; else J16_ON; J16Mask = 1;}
62
  if((EE_Parameter.J16Timing > 247) && (Parameter_J16Timing == 5))  {if(J16Bitmask & 128) J16_OFF; else J16_ON; J16Mask = 1; NC_Wait_for_LED = 0;}  // Manual overwrite
62
  else
63
  else
63
  if(!J16Blinkcount--)
64
  if(!J16Blinkcount--)
64
   {
65
   {
65
    if(EE_Parameter.GlobalConfig3 & CFG3_USE_NC_FOR_OUT1)
66
    if(EE_Parameter.GlobalConfig3 & CFG3_USE_NC_FOR_OUT1)
66
         {
67
         {
67
          J16Blinkcount = from_nc / 2;
68
          J16Blinkcount = from_nc / 2;
68
          if(!from_nc) { if(J16Bitmask & 128) J16_OFF; else J16_ON; J16Mask = 0; } // Ausschalten
69
          if(!from_nc) { NC_Wait_for_LED = 0; if(J16Bitmask & 128) J16_OFF; else J16_ON; J16Mask = 0; } // Ausschalten
69
          else
70
          else
70
           {
71
           {
-
 
72
        NC_Wait_for_LED = 1;
71
        if(J16Mask == 0)
73
        if(J16Mask == 0)
72
                 {
74
                 {
73
                  from_nc = 0;
75
                  from_nc = 0;
-
 
76
//                NC_Wait_for_LED = 0;
74
                  J16Mask = 128;
77
                  J16Mask = 128;
75
                  if(J16Bitmask & 128) J16_OFF; else J16_ON; // Ausschalten
78
                  if(J16Bitmask & 128) J16_OFF; else J16_ON; // Ausschalten
76
                 }
79
                 }
77
                else
80
                else
78
                 {
81
                 {
-
 
82
//if(FromNC_WP_EventChannel != -127)  
79
          if(J16Mask & J16Bitmask) J16_ON; else J16_OFF;
83
          if(J16Mask & J16Bitmask) J16_ON; else J16_OFF;
80
                  J16Mask /= 2;
84
                  J16Mask /= 2;
81
                 }
85
                 }
82
           }   
86
           }   
83
         }
87
         }
84
        else
88
        else
85
         {
89
         {
86
          J16Blinkcount = Parameter_J16Timing / 2;
90
          J16Blinkcount = Parameter_J16Timing / 2;
87
      if(J16Mask == 1) { from_nc = 0; J16Mask = 128; } else J16Mask /= 2;
91
      if(J16Mask == 1) { from_nc = 0; J16Mask = 128; } else J16Mask /= 2;
88
      if(J16Mask & J16Bitmask) J16_ON; else J16_OFF;
92
      if(J16Mask & J16Bitmask) J16_ON; else J16_OFF;
-
 
93
          NC_Wait_for_LED = 0;
89
         }
94
         }
90
   }
95
   }
91
  }
96
  }
92
  else  // warning case
97
  else  // warning case
93
  if(!J16Blinkcount--)
98
  if(!J16Blinkcount--)