30,7 → 30,6 |
#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" |
65,7 → 64,6 |
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 |
377,9 → 375,7 |
#else |
if (rxd_buffer[2] == 'O') { // NC OSD Data |
Decode64(); |
//naviData = *((NaviData_t*)pRxData); |
memcpy((char*)(&naviData), (char*)pRxData, sizeof(NaviData_t)); |
rxd_buffer_locked = 0; |
naviData = *((NaviData_t*)pRxData); |
|
#ifdef SHIFTBYminus45 |
naviData.AngleNick = (int8_t)(((int16_t)naviData.AngleRoll + (int16_t)naviData.AngleNick) / 2); |
399,13 → 395,7 |
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 |
440,7 → 430,7 |
usart0_puts(conv_array); |
usart0_puts("\r\n"); |
#endif |
|
rxd_buffer_locked = 0; |
} |
// handle keypress |
if (s1_pressed()) { |
461,13 → 451,6 |
//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 |
477,7 → 460,7 |
|
// do not spam too much |
if (!(COSD_FLAGS_RUNTIME & COSD_DATARECEIVED)) { |
_delay_ms(100); |
_delay_ms(300); |
} |
} |
|