Subversion Repositories FlightCtrl

Compare Revisions

Ignore whitespace Rev 2664 → Rev 2665

/trunk/uart.c
112,6 → 112,10
unsigned char SwitchMultiplexerToUpdate = 0; // the Uart-Multiplexer on the FC V3.0
unsigned char SerialChannelDataOkay = 0; // timeout
 
#ifdef REDUNDANT_FC_SLAVE
unsigned char SerialMotorRequest = 0;
#endif
 
const unsigned char ANALOG_TEXT[32][16] PROGMEM =
{
//1234567890123456
617,9 → 621,10
Motor[tempchar1].MaxPWM = RedundantMotor[tempchar1].State;
Motor[tempchar1].Temperature = RedundantMotor[tempchar1].TemperatureInDeg;
Motor[tempchar1].State |= MOTOR_STATE_PRESENT_MASK;
//DebugOut.Analog[16] = RedundantMotor[tempchar1].BitSate;
//DebugOut.Analog[17]++;
//DebugOut.Analog[18] = tempchar1;
//DebugOut.Analog[]++;
//DebugOut.Analog[] = RedundantMotor[tempchar1].BitSate;
//DebugOut.Analog[] = tempchar1;
SerialMotorRequest = 0; // allow to request the next answer
break;
#endif
// 't' comand placed here only for compatibility to BL
919,14 → 924,23
//if(UebertragungAbgeschlossen || MotorenEin)
if(UebertragungAbgeschlossen && (CheckDelay(Kompass_Timer)))
{
static unsigned char who, request;
static unsigned char who;
unsigned char SendRedundantMotor[MAX_MOTORS], i;
if(!request) { who = (who+1) % RequiredMotors; request = 1;} // nur in jedem 2. Zykus abfragen, weil die Antwort zu lang ist
else request = 0;
cli();
if(!SerialMotorRequest)
{
who = (who+1) % RequiredMotors;
SendRedundantMotor[0] = who+1;
SerialMotorRequest = 5; // nur in jedem 5. Zykus abfragen, weil die Antwort zu lang ist -> oder sobald der Regler geantwortet hat.
}
else
{
SerialMotorRequest--;
SendRedundantMotor[0] = 0; // keinen Regler abfragen
}
sei();
for(i=0; i<RequiredMotors; i++)
{
if(request) SendRedundantMotor[0] = who+1;
else SendRedundantMotor[0] = 0;
if(PC_MotortestActive) SendRedundantMotor[0] |= 0x80;
SendRedundantMotor[i+1] = Motor[i].SetPoint;
}