#include "USART1.h" // USARTs common settings : Speed and Timeouts const uint16_t USART_UBRR[8] PROGMEM={ (F_CPU/8UL)/19200-1, (F_CPU/8UL)/500000-1, (F_CPU/8UL)/2400-1, (F_CPU/8UL)/9600-1, (F_CPU/8UL)/115200-1, (F_CPU/8UL)/250000-1, (F_CPU/8UL)/1000000-1, /*(F_CPU/8UL)/10000000-1*/ 0}; // Fosc=16MHz : 19.2k, 500k, 2.4k, 9.6k, 115.2k, 250k, 1M, 1M const uint16_t USART_TIMEOUT[8] PROGMEM={ (IDIBUS_19200B_INTERFRAME_TIMEOUT_US/8*16), (IDIBUS_500K_INTERFRAME_TIMEOUT_US/8*16), (IDIBUS_2400B_INTERFRAME_TIMEOUT_US/8*16), (IDIBUS_9600B_INTERFRAME_TIMEOUT_US/8*16), (IDIBUS_115200B_INTERFRAME_TIMEOUT_US/8*16), (IDIBUS_250K_INTERFRAME_TIMEOUT_US/8*16), (IDIBUS_1M_INTERFRAME_TIMEOUT_US/8*16), (IDIBUS_1M_INTERFRAME_TIMEOUT_US/8*16) }; //-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ISR(USART1_TX_vect){ if (USART1STR.TxSendedCount == USART1STR.TxBufCount){ //UCSR1B &= ~((1< Z USART1_DRE_DDR&=~(1< Z } else { UDR1=USART1_TX_BUF[USART1STR.TxSendedCount]; USART1STR.TxSendedCount++; } } //-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ISR(USART1_RX_vect){ //TIMSK3=0; TCNT3=0; // Timeout Timer3 On, clkI/O/8 (From prescaller) TCCR3B=2; TIMSK3=1< Z USART1_RX_DDR&=~(1< Z USART1_DRE_DDR&=~(1< 0 UCSR1A=(1< USART1_BUF_SIZE) ) { return; } USART1_TX_DDR|=1< out USART1_DRE_DDR|=1<