Subversion Repositories Projects

Compare Revisions

Ignore whitespace Rev 507 → Rev 514

/C-OSD/trunk/main.c
37,10 → 37,12
#include "spi.h"
#include "buttons.h"
#include "ppm.h"
#if !(ALLCHARSDEBUG|(WRITECHARS != -1))
#include "osd_ncmode_default.h"
#include "osd_ncmode_minimal.h"
#include "osd_fcmode_default.h"
 
#if WRITECHARS != -1
#include "characters.h"
#endif
 
/* TODO:
81,6 → 83,8
// Flags
uint8_t COSD_FLAGS = 0, COSD_FLAGS2 = 0;
 
#if !(ALLCHARSDEBUG|(WRITECHARS != -1))
 
// stats for after flight
int16_t max_Altimeter = 0;
uint8_t min_UBat = 255;
126,7 → 130,6
/* ##########################################################################
* Different display mode function pointers
* ##########################################################################*/
#if !(ALLCHARSDEBUG|(WRITECHARS != -1))
const char str_1[] PROGMEM = "default";
const char str_2[] PROGMEM = "minimal";
 
186,15 → 189,32
* MAIN
* ##########################################################################*/
int main(void) {
// set up FLAGS
COSD_FLAGS = 0;
#if NTSC
COSD_FLAGS |= COSD_FLAG_NTSC;
#endif
#if HUD
COSD_FLAGS |= COSD_FLAG_HUD;
#endif
#if ARTHORIZON
COSD_FLAGS |= COSD_FLAG_ARTHORIZON;
#endif
#if BIGVARIO
COSD_FLAGS |= COSD_FLAG_BIGARIO;
#endif
#if STATS
COSD_FLAGS |= COSD_FLAG_STATS;
#endif
#if WARNINGS
COSD_FLAGS |= COSD_FLAG_WARNINGS;
#endif
#if FCONLY
COSD_FLAGS |= COSD_FLAG_FCMODE;
#endif
 
// set up FLAGS, compiler should flatten this one
COSD_FLAGS = (NTSC << 0);
COSD_FLAGS |= (HUD << 1);
COSD_FLAGS |= (ARTHORIZON << 2);
COSD_FLAGS |= (BIGVARIO << 3);
COSD_FLAGS |= (STATS << 4);
COSD_FLAGS |= (WARNINGS << 5);
 
 
// set up Atmega162 Ports
DDRA |= (1 << PA1); // PA1 output (/CS)
MAX_CS_HIGH
232,7 → 252,7
#if (WRITECHARS != -1)
// DISABLE display (VM0)
spi_send_byte(0x00, 0b00000000);
#include "characters.c"
learn_all_chars_pgm();
#else
// read out config for NTSC/PAL distinguishing
get_eeprom(0);
299,7 → 319,7
 
#if ALLCHARSDEBUG | (WRITECHARS != -1)
clear();
write_all_chars();
write_all_chars();
LED1_ON
LED2_ON
LED3_ON