diff --git a/Multiprotocol/Multiprotocol.ino b/Multiprotocol/Multiprotocol.ino index c908b69..6d0378a 100644 --- a/Multiprotocol/Multiprotocol.ino +++ b/Multiprotocol/Multiprotocol.ino @@ -880,98 +880,7 @@ uint16_t limit_channel_100(uint8_t ch) // return; // } -#if defined(TELEMETRY) - - void Serial_write(uint8_t data) - { - cli(); // disable global int - if(++tx_head>=TXBUFFER_SIZE) - tx_head=0; - tx_buff[tx_head]=data; - #ifdef XMEGA - USARTC0.CTRLA = (USARTC0.CTRLA & 0xFC) | 0x01 ; - #else - #if defined STM32_board - USART3_BASE->CR1 |= USART_CR1_TXEIE; - #else - UCSR0B |= (1<CR1 |= USART_CR1_PCE_BIT; - USART3_BASE->CR1 &= ~ USART_CR1_RE;//disable - USART2_BASE->CR1 &= ~ USART_CR1_TE;//disable transmit - #else - #include - UBRR0H = UBRRH_VALUE; - UBRR0L = UBRRL_VALUE; - UCSR0A = 0 ; // Clear X2 bit - //Set frame format to 8 data bits, even parity, 2 stop bits - UCSR0C = (1<SR & USART_SR_TXE) { - #endif - if(tx_head!=tx_tail) - { - if(++tx_tail>=TXBUFFER_SIZE)//head - tx_tail=0; - #ifdef XMEGA - USARTC0.DATA = tx_buff[tx_tail] ; - #else - #if defined STM32_board - USART3_BASE->DR=tx_buff[tx_tail];//clears TXE bit - #else - UDR0=tx_buff[tx_tail]; - #endif - #endif - } - if (tx_tail == tx_head) - #ifdef XMEGA - USARTC0.CTRLA &= ~0x03 ; - #else - #if defined STM32_board - USART3_BASE->CR1 &= ~USART_CR1_TXEIE;//disable interrupt - } - #else - UCSR0B &= ~(1<