Subversion Repositories FlightCtrl

Compare Revisions

Ignore whitespace Rev 2727 → Rev 2728

/trunk/uart.c
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)
/trunk/uart.h
26,7 → 26,7
extern unsigned char MotorTest[16];
extern unsigned char SwitchMultiplexerToUpdate; // the Uart-Multiplexer on the FC V3.0
extern unsigned char SerialChannelDataOkay; // timeout
extern unsigned int Baudrate;
extern unsigned int Baudrate_100;
 
struct str_DebugOut
{
143,7 → 143,7
};
 
extern struct str_VersionInfo VersionInfo;
#define MAX_BD_RATES 9
#define MAX_BD_RATES 11
extern const unsigned int BAUDRATES[MAX_BD_RATES];
 
//#define USART0_BAUD 9600