Subversion Repositories Projects

Compare Revisions

Ignore whitespace Rev 1800 → Rev 1801

/C-OSD/trunk/main.c
30,6 → 30,7
#include <avr/interrupt.h>
#include <util/delay.h>
#include <avr/pgmspace.h>
#include <string.h>
#include "max7456_software_spi.h"
#ifdef ANTENNATRACKTEST
#include "usart0.h"
64,6 → 65,7
volatile str_DebugOut debugData;
#else
volatile NaviData_t naviData;
volatile Data3D_t data3d;
#endif
 
// cache old vars for blinking attribute, checkup is faster than full
375,7 → 377,9
#else
if (rxd_buffer[2] == 'O') { // NC OSD Data
Decode64();
naviData = *((NaviData_t*)pRxData);
//naviData = *((NaviData_t*)pRxData);
memcpy((char*)(&naviData), (char*)pRxData, sizeof(NaviData_t));
rxd_buffer_locked = 0;
 
#ifdef SHIFTBYminus45
naviData.AngleNick = (int8_t)(((int16_t)naviData.AngleRoll + (int16_t)naviData.AngleNick) / 2);
395,7 → 399,13
osd_ncmode();
}
//seconds_since_last_data = 0;
}
// } else if (rxd_buffer[2] == 'C') { // 3D and Stick Data
// Decode64();
// memcpy((char*)(&data3d), (char*)pRxData, sizeof(Data3D_t));
// rxd_buffer_locked = 0;
} else {
rxd_buffer_locked = 0;
}
#endif
 
// ONLY FOR TESTING
430,7 → 440,7
usart0_puts(conv_array);
usart0_puts("\r\n");
#endif
rxd_buffer_locked = 0;
}
// handle keypress
if (s1_pressed()) {
451,6 → 461,13
//usart1_request_mk_data(1, 'o', 100);
usart1_puts_pgm(PSTR(REQUEST_OSD_DATA));
 
 
// request 3D Data from NC every 100ms
//usart1_request_mk_data(1, 'c', 100);
// _delay_ms(10);
// usart1_puts_pgm(PSTR(REQUEST_3DDATA));
 
// and disable debug...
//usart1_request_mk_data(0, 'd', 0);
#endif
460,7 → 477,7
 
// do not spam too much
if (!(COSD_FLAGS_RUNTIME & COSD_DATARECEIVED)) {
_delay_ms(300);
_delay_ms(100);
}
}