Subversion Repositories FlightCtrl

Rev

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

Rev 1910 Rev 2099
Line 14... Line 14...
14
#define J5HIGH    PORTD |= (1<<PORTD3)
14
#define J5HIGH    PORTD |= (1<<PORTD3)
15
#define J5LOW     PORTD &= ~(1<<PORTD3)
15
#define J5LOW     PORTD &= ~(1<<PORTD3)
16
#define J5TOGGLE  PORTD ^= (1<<PORTD3)
16
#define J5TOGGLE  PORTD ^= (1<<PORTD3)
Line 17... Line 17...
17
 
17
 
18
// invert means: An "1" bit in digital debug data make a LOW on the output.
18
// invert means: An "1" bit in digital debug data make a LOW on the output.
Line 19... Line 19...
19
#define OUTPUT_INVERT 0
19
#define DIGITAL_DEBUG_INVERT 0
20
 
20
 
21
#define OUTPUT_HIGH(num)        {PORTC |=  (4 << (num));}
-
 
22
#define OUTPUT_LOW(num)         {PORTC &= ~(4 << (num));}
21
#define OUTPUT_HIGH(num)        {PORTC |=  (4 << (num));}
Line 23... Line 22...
23
#define OUTPUT_SET(num, state)  {if (OUTPUT_INVERT) { if(state) OUTPUT_LOW(num) else OUTPUT_HIGH(num)} else {if(state) OUTPUT_HIGH(num) else OUTPUT_LOW(num)}}
22
#define OUTPUT_LOW(num)         {PORTC &= ~(4 << (num));}
24
#define OUTPUT_TOGGLE(num) (    {PORTC ^=  (4 << (num));}
23
#define OUTPUT_TOGGLE(num) (    {PORTC ^=  (4 << (num));}
25
 
24
 
Line 42... Line 41...
42
 * }
41
 * }
43
 *
42
 *
44
 * Digital debugs may be added as desired, and removed when the mystery
43
 * Digital debugs may be added as desired, and removed when the mystery
45
 * at hand is resolved.
44
 * at hand is resolved.
46
 */
45
 */
47
#define DEBUG_NONE 0
-
 
48
 
-
 
49
#define DEBUG_LEDTEST_ON  1000
-
 
50
#define DEBUG_LEDTEST_OFF 1001
-
 
Line 51... Line 46...
51
 
46
 
52
#define DEBUG_MAINLOOP_TIMER 1
47
#define DEBUG_MAINLOOP_TIMER 1
53
#define DEBUG_HEIGHT_DIFF 2
48
#define DEBUG_HEIGHT_DIFF    2
54
#define DEBUG_HOVERTHROTTLE 4
49
#define DEBUG_FLIGHTCLIP     4
55
#define DEBUG_ACC0THORDER 8
50
#define DEBUG_ACC0THORDER    8
56
#define DEBUG_COMMANDREPEATED 16
51
#define DEBUG_COMPASS       16
57
#define DEBUG_PRESSURERANGE 32
52
#define DEBUG_PRESSURERANGE 32
58
#define DEBUG_CLIP 64
53
#define DEBUG_CLIP          64
-
 
54
#define DEBUG_SENSORLIMIT  128
-
 
55
 
-
 
56
#define OUTPUTFLAGS_INVERT_0         1 // Inverted: 1 means low output on atmega. Does not affect on-board LED (if used with the OUTPUTOPTIONS_USE_ONBOARD_LEDS option)
-
 
57
#define OUTPUTFLAGS_INVERT_1         2 // Inverted: 1 means low output on atmega. Does not affect on-board LED (if used with the OUTPUTOPTIONS_USE_ONBOARD_LEDS option)
-
 
58
#define OUTPUTFLAGS_FLASH_0_AT_BEEP  4 // Flash LED when beeper beeps
-
 
59
#define OUTPUTFLAGS_FLASH_1_AT_BEEP  8 // Flash LED when beeper beeps
-
 
60
#define OUTPUTFLAGS_USE_ONBOARD_LEDS 16 // Control on-board LEDs in addition to outputs
-
 
61
#define OUTPUTFLAGS_TEST_OFF         32 // For testing: Turn off both outputs
-
 
62
#define OUTPUTFLAGS_TEST_ON          64 // For testing: Turn on both outputs
-
 
63
 
-
 
64
// For practical reasons put here instead of in uart0.h
-
 
65
typedef struct {
-
 
66
    uint8_t digital[2];
-
 
67
    uint16_t analog[32]; // debug values
-
 
68
}__attribute__((packed)) DebugOut_t;
-
 
69
 
Line 59... Line 70...
59
#define DEBUG_SENSORLIMIT 128
70
extern DebugOut_t debugOut;
60
 
71
 
61
/*
72
/*
62
 * Set to 0 for using outputs as the usual flashing lights.
73
 * Set to 0 for using outputs as the usual flashing lights.
63
 * Set to one of the DEBUG_... defines h for using the outputs as debug lights.
74
 * Set to one of the DEBUG_... defines h for using the outputs as debug lights.
Line 64... Line 75...
64
 */
75
 */
-
 
76
#define DIGITAL_DEBUG_MASK 0
65
#define DIGITAL_DEBUG_MASK DEBUG_NONE
77
 
66
 
78
void output_init(void);
67
void output_init(void);
79
void outputSet(uint8_t num, uint8_t state);
68
void output_update(void);
80
void output_update(void);
69
void beep(uint16_t millis);
-
 
70
void beepNumber(uint8_t numbeeps);
81
void beep(uint16_t millis);
Line 71... Line 82...
71
void beepRCAlarm(void);
82
void beepNumber(uint8_t numbeeps);