83,12 → 83,21 |
/** |
* send a <string> throught usart1 |
*/ |
void usart1_puts(char *s) { |
/*void usart1_puts(char *s) { |
while (*s) { |
usart1_putc(*s); |
s++; |
} |
} |
}*/ |
|
|
/** |
* send a PGM<string> throught usart1 |
*/ |
void usart1_puts_pgm(const char* string) { |
while (pgm_read_byte(string) != 0x00) |
usart1_putc(pgm_read_byte(string++)); |
} |
|
/** |
* transmit interrupt handler |
114,8 → 123,14 |
static uint8_t usart_rx_ok = 0; |
uint8_t crc1, crc2; |
// the rxd buffer is unlocked |
if (usart_rx_ok == 0) { |
if ((c2 == '#') && (c1 == 'b' || c1 == 'c') && (c == 'D' || c == 'V' || c == 'O')) { |
if (usart_rx_ok == 0) { |
// if ((c2 == '#') && (c1 == 'b' || c1 == 'c') && (c == 'D' || c == 'V' || c == 'O')) { |
if ((c2 == '#') && (c1 == 'b' || c1 == 'c') && |
#if FCONLY |
(c == 'V' || c == 'D')) { // version and debug |
#else |
(c == 'V' || c == 'O')) { // version and OSD |
#endif |
usart_rx_ok = 1; |
rxd_buffer[ptr_rxd_buffer++] = c2; |
crc = c2; |
204,7 → 219,7 |
* portions taken and adapted from |
* http://svn.mikrokopter.de/mikrowebsvn/filedetails.php?repname=FlightCtrl&path=%2Ftags%2FV0.72p%2Fuart.c |
*/ |
void sendMKData(unsigned char cmd, unsigned char addr, unsigned char *snd, unsigned char len) { |
/*void sendMKData(unsigned char cmd, unsigned char addr, unsigned char *snd, unsigned char len) { |
unsigned int pt = 0; |
unsigned char a, b, c; |
unsigned char ptr = 0; |
242,7 → 257,7 |
txd_buffer[i++] = '\r'; |
|
usart1_puts((char*) txd_buffer); |
} |
}*/ |
|
/** |
* short script to directly send a request thorugh usart including en- and disabling it |
249,7 → 264,7 |
* where <address> is the address of the receipient, <label> is which data set to request |
* and <ms> represents the milliseconds delay between data |
*/ |
void usart1_request_mk_data(uint8_t address, char label, uint8_t ms) { |
/*void usart1_request_mk_data(uint8_t address, char label, uint8_t ms) { |
// re-enable TXD pin |
usart1_EnableTXD(); |
|
259,6 → 274,6 |
while (!(UCSR1A & (1 << UDRE1))); |
// disable TXD pin again |
usart1_DisableTXD(); |
} |
}*/ |
|
#endif |