Subversion Repositories FlightCtrl

Rev

Rev 763 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 763 Rev 790
Line 1... Line 1...
1
#include <inttypes.h>
1
#include <inttypes.h>
2
#include "led.h"
2
#include "led.h"
3
#include "fc.h"
3
#include "fc.h"
Line 4... Line 4...
4
 
4
 
5
uint16_t LED_OffTime = 0;
5
uint16_t LED1_Time = 0;
Line 6... Line 6...
6
uint16_t LED_OnTime = 0;
6
uint16_t LED2_Time = 0;
7
 
7
 
8
 
8
 
Line 18... Line 18...
18
 
18
 
19
// called in UpdateMotors() every 2ms
19
// called in UpdateMotors() every 2ms
20
void LED_Update(void)
20
void LED_Update(void)
21
{
21
{
-
 
22
        static uint16_t J16_blinkcount = 0;
Line -... Line 23...
-
 
23
        static uint16_t J17_blinkcount = 0;
-
 
24
 
-
 
25
        if (LED1_Time < 20) J16_ON;
22
        static uint16_t J16_blinkcount = 0;
26
        else if(LED1_Time < 220)
23
 
27
        {
24
        if(J16_blinkcount < LED_OnTime) J16_ON;
28
                if((2 * J16_blinkcount) < LED1_Time) J16_ON;
-
 
29
                else J16_OFF;
-
 
30
                if(J16_blinkcount++ >= LED1_Time) J16_blinkcount = 0;
-
 
31
        }
-
 
32
        else J16_ON;
-
 
33
 
-
 
34
        if (LED2_Time < 20) J17_OFF;
-
 
35
        else if(LED2_Time < 220)
-
 
36
        {
-
 
37
                if((2 * J17_blinkcount) < LED2_Time) J17_ON;
-
 
38
                else J17_OFF;
-
 
39
                if(J17_blinkcount++ >= LED2_Time) J17_blinkcount = 0;
25
        else J16_OFF;
40
        }