77,7 → 77,7 |
#define MASK_SET_DEFAULT_PARAMS 0x40 |
#define MASK_SET_SAVE_EEPROM 0x80 |
|
const unsigned int BAUDRATES[MAX_BD_RATES] = {1200,2400,4800,9600,14400,19200,28800,38400,57600}; |
const unsigned int BAUDRATES[MAX_BD_RATES] = {12,24,48,96,144,192,288,384,576,1152,2560}; |
|
unsigned char GetExternalControl = 0,DebugDisplayAnforderung1 = 0, DebugDisplayAnforderung = 0,DebugDataAnforderung = 0,GetVersionAnforderung = 0, GetPPMChannelAnforderung = 0; |
unsigned char DisplayLine = 0; |
113,7 → 113,7 |
unsigned volatile char ReceiverUpdateModeActive = 0; // 1 = Update 2 = JetiBox-Simulation |
unsigned char SwitchMultiplexerToUpdate = 0; // the Uart-Multiplexer on the FC V3.0 |
unsigned char SerialChannelDataOkay = 0; // timeout |
unsigned int Baudrate = 57600; |
unsigned int Baudrate_100 = 576; |
|
#ifdef REDUNDANT_FC_SLAVE |
unsigned char SerialMotorRequest = 0; |
735,11 → 735,12 |
FromNcBaudrateIndex = GetParamByte(EE_BAUDRATE); |
if(FromNcBaudrateIndex < MAX_BD_RATES && GetParamByte(EE_BAUDRATE_CRC) == FromNcBaudrateIndex + 1) // EEprom-Data Valid |
{ |
Baudrate = BAUDRATES[FromNcBaudrateIndex]; |
Baudrate_100 = BAUDRATES[FromNcBaudrateIndex]; |
} |
else FromNcBaudrateIndex = 8; |
|
ubrr = (unsigned int) ((unsigned long) F_CPU/(8 * (unsigned long)Baudrate) - 1); |
ubrr = 5 + ((unsigned int) ((unsigned long) F_CPU/(80 * (unsigned long)Baudrate_100) - 10)); // (+5 / 10) = Runden |
ubrr /= 10; |
//Enable TXEN im Register UCR TX-Data Enable & RX Enable |
UCSR0B = (1 << TXEN0) | (1 << RXEN0); |
// UART Double Speed (U2X) |