Subversion Repositories FlightCtrl

Rev

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

Rev 1801 Rev 1805
Line 5... Line 5...
5
 
5
 
6
// This is for LEDs connected directly between +5V and the AVR port, without transistors.
6
// This is for LEDs connected directly between +5V and the AVR port, without transistors.
7
// PORTbit = 0 --> LED on.
7
// PORTbit = 0 --> LED on.
8
// To use the normal transistor set-up where 1 --> transistor conductive, reverse the 
8
// To use the normal transistor set-up where 1 --> transistor conductive, reverse the 
-
 
9
// ON and OFF statements.
-
 
10
 
-
 
11
// invert means: An "1" bit in digital debug data make a LOW on the output.
9
// ON and OFF statements.
12
#define DIGITAL_DEBUG_INVERT 1
10
#define OUTPUT_ON(num)          {PORTC |=  (4 << (num));}
13
#define OUTPUT_HIGH(num)        {PORTC |=  (4 << (num));}
11
#define OUTPUT_OFF(num)         {PORTC &= ~(4 << (num));}
14
#define OUTPUT_LOW(num)         {PORTC &= ~(4 << (num));}
12
#define OUTPUT_SET(num, state)  {if ((state)) OUTPUT_ON(num) else OUTPUT_OFF(num)}
15
#define OUTPUT_SET(num, state)  {if (DIGITAL_DEBUG_INVERT){if(state) OUTPUT_LOW(num) else OUTPUT_HIGH(num)} else {if(state) OUTPUT_HIGH(num) else OUTPUT_LOW(num)}}
Line 13... Line 16...
13
#define OUTPUT_TOGGLE(num) (    {PORTC ^=  (4 << (num));}
16
#define OUTPUT_TOGGLE(num) (    {PORTC ^=  (4 << (num));}
14
 
17
 
15
#define DEBUG_LEDTEST 256
18
#define DEBUG_LEDTEST 256