Subversion Repositories Projects

Compare Revisions

Ignore whitespace Rev 1198 → Rev 1199

/C-OSD/C-Epilepsy/main.h
0,0 → 1,112
/****************************************************************************
* Copyright (C) 2011 by Claas Anders "CaScAdE" Rathje *
* admiralcascade@gmail.com *
* Project-URL: http://www.mylifesucks.de/oss/c-epilepsy/ *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
****************************************************************************/
 
#ifndef _MAIN_H
#define _MAIN_H
 
 
#ifndef MCU
#define MCU atmega644p
//#ifndef __AVR_ATmega644P__
//#define __AVR_ATmega644P__
//#endif
#endif
 
#define EPI10AQ41 01 /* the grey one done by akku by hand */
#define EPI10 10
#define EPI11 11
 
//#define HWVERSION HW_10AQ41
 
#ifndef HWVERSION
#define HWVERSION EPI11
#endif
 
#if HWVERSION == EPI10AQ41
 
#define LEDGREEN_ON PORTB |= (1 << PB1);
#define LEDGREEN_OFF PORTB &= ~(1 << PB1);
#define LEDGREEN_TOGGLE PORTB ^= (1 << PB1);
#define LEDRED_ON PORTB |= (1 << PB2);
#define LEDRED_OFF PORTB &= ~(1 << PB2);
#define LEDRED_TOGGLE PORTB ^= (1 << PB2);
 
#elif HWVERSION == EPI10
 
#define LEDGREEN_ON PORTD |= (1 << PD7);
#define LEDGREEN_OFF PORTD &= ~(1 << PD7);
#define LEDGREEN_TOGGLE PORTD ^= (1 << PD7);
#define LEDRED_ON PORTD |= (1 << PD3);
#define LEDRED_OFF PORTD &= ~(1 << PD3);
#define LEDRED_TOGGLE PORTD ^= (1 << PD3);
 
#else
 
#define LEDGREEN_ON PORTD |= (1 << PD7);
#define LEDGREEN_OFF PORTD &= ~(1 << PD7);
#define LEDGREEN_TOGGLE PORTD ^= (1 << PD7);
#define LEDRED_ON PORTD &= ~(1 << PD7);
#define LEDRED_OFF PORTD |= (1 << PD7);
#define LEDRED_TOGGLE PORTD ^= (1 << PD7);
 
#endif
 
 
#include <avr/eeprom.h>
#include <avr/io.h>
#include <avr/interrupt.h>
#include <avr/pgmspace.h>
#include <avr/wdt.h>
#include <inttypes.h>
//#include <math.h>
#include <stdint.h>
#include <stdlib.h>
#include <util/delay.h>
#include <string.h>
#include "timer0.h"
#include "timer1.h"
#include "led_out.h"
#include "player.h"
#include "usart0.h"
#include "usart1.h"
#include "mk-data-structs.h"
#include "epi_helpers.h"
#include "integer_math.h"
#include "nc_handler.h"
#include "buttons.h"
#include "eeprom.h"
 
#ifndef BUILDDATE
#define BUILDDATE "DEVEL-BUILD" // build date, this is testing...
#endif
 
#ifndef FCONLY
#define FCONLY 0 // set to 1 if you do NOT have a NaviCtrl and the Epilepsy is
#endif // connected to the FC directly
 
 
extern const uint8_t COLORS [][6];
extern uint8_t main_mode;
extern volatile uint8_t CEPILEPSYFLAGS;
 
#define CEPI_DIRTYEEPROM 1
 
 
#endif