Subversion Repositories FlightCtrl

Rev

Rev 1775 | Rev 1801 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

#ifndef _OUTPUT_H
#define _OUTPUT_H

#include <avr/io.h>

// This is for LEDs connected directly between +5V and the AVR port, without transistors.
// PORTbit = 0 --> LED on.
// To use the normal transistor set-up where 1 --> transistor conductive, reverse the
// ON and OFF statements.
#define OUTPUT_ON(num)          {PORTC |=  (4 << (num));}
#define OUTPUT_OFF(num)         {PORTC &= ~(4 << (num));}
#define OUTPUT_SET(num, state)  {if ((state)) OUTPUT_ON(num) else OUTPUT_OFF(num)}
#define OUTPUT_TOGGLE(num) (    {PORTC ^=  (4 << (num));}

#define DEBUG_LEDTEST 256
#define DEBUG_HEIGHT_SWITCH 1
#define DEBUG_HEIGHT_DIFF 2
#define DEBUG_HOVERTHROTTLE 4
#define DEBUG_ACC0THORDER 8
#define DEBUG_COMMANDREPEATED 16
#define DEBUG_PRESSURERANGE 32

void output_init(void);
void output_update(void);

#endif //_output_H