Subversion Repositories Projects

Compare Revisions

Ignore whitespace Rev 782 → Rev 783

/C-OSD/trunk/usart1.c
28,7 → 28,7
 
volatile uint8_t rxd_buffer_locked = 0;
volatile uint8_t rxd_buffer[RXD_BUFFER_LEN];
volatile uint8_t txd_buffer[TXD_BUFFER_LEN];
//volatile uint8_t txd_buffer[TXD_BUFFER_LEN];
volatile uint8_t ReceivedBytes = 0;
volatile uint8_t *pRxData = 0;
volatile uint8_t RxDataLen = 0;
127,9 → 127,9
 
if ((c2 == '#') && (c1 == 'b' || c1 == 'c') &&
#if FCONLY
(c == 'V' || c == 'D')) { // version and debug
(c == 'V' || c == 'D' || c == 'Q')) { // version, debug, settings
#else
(c == 'V' || c == 'O')) { // version and OSD
(c == 'V' || c == 'O' || c == 'Q')) { // version, OSD, settings
#endif
usart_rx_ok = 1;
rxd_buffer[ptr_rxd_buffer++] = c2;
211,7 → 211,42
}
pRxData = &rxd_buffer[3];
RxDataLen = ptrOut - 3;
}
 
 
/**
* Request Data through usart1 until a answer is received
*/
void usart1_request_blocking(unsigned char answer, const char* message) {
rxd_buffer[2] = answer + 1;
while (rxd_buffer[2] != answer) {
rxd_buffer_locked = 0;
usart1_EnableTXD();
usart1_puts_pgm(message);
usart1_DisableTXD();
static uint8_t wait = 0;
wait = 0;
while (rxd_buffer_locked == 0 && wait < 150) {
wait++;
_delay_ms(10);
}
}
Decode64();
}
 
/**
* Request UART Redirect from NC to itself
*/
void usart1_request_nc_uart(void) {
usart1_EnableTXD();
usart1_putc(0x1B);
usart1_putc(0x1B);
usart1_putc(0x55);
usart1_putc(0xAA);
usart1_putc(0x00);
usart1_DisableTXD();
}
 
 
/**
* request Data through USART in special MK format by adding checksum and