/trunk/libfc1284.a |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/trunk/libfc644.a |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/trunk/main.c |
---|
424,7 → 424,9 |
if(++second == 49) |
{ |
second = 0; |
#if (defined(__AVR_ATmega1284__) || defined(__AVR_ATmega1284P__)) |
if(ShowSettingNameTime) ShowSettingNameTime--; |
#endif |
if(FC_StatusFlags & FC_STATUS_FLY) FlugSekunden++; |
else timer2 = 1450; // 0,5 Minuten aufrunden |
if(modell_fliegt < 1024) |
/trunk/makefile |
---|
6,7 → 6,7 |
#------------------------------------------------------------------- |
VERSION_MAJOR = 0 |
VERSION_MINOR = 91 |
VERSION_PATCH = 3 |
VERSION_PATCH = 5 |
VERSION_SERIAL_MAJOR = 11 # Serial Protocol |
VERSION_SERIAL_MINOR = 0 # Serial Protocol |
NC_SPI_COMPATIBLE = 55 # Navi-Kompatibilität |
/trunk/spi.c |
---|
186,8 → 186,9 |
ToNaviCtrl.Param.Byte[8] = Motor[motorindex].MaxPWM; |
ToNaviCtrl.Param.Byte[9] = Motor[motorindex].State; |
ToNaviCtrl.Param.Byte[10] = Motor[motorindex].Temperature; |
ToNaviCtrl.Param.Byte[11] = Motor[motorindex++].Current; |
motorindex %= 12; |
ToNaviCtrl.Param.Byte[11] = Motor[motorindex].Current; |
if(Mixer.Motor[++motorindex][0] == 0) // next motor is not used ? |
while(Mixer.Motor[motorindex][0] == 0 && motorindex) motorindex = (motorindex + 1) % 12; |
break; |
case SPI_FCCMD_PARAMETER1: |
ToNaviCtrl.Param.Byte[0] = (unsigned char) BattLowVoltageWarning; //0.1V |
/trunk/timer0.c |
---|
60,6 → 60,7 |
volatile unsigned int cntKompass = 0; |
volatile unsigned int beeptime = 0; |
volatile unsigned char SendSPI = 0, ServoActive = 0, CalculateServoSignals = 1; |
unsigned char JustMK3MagConnected = 0; |
uint16_t RemainingPulse = 0; |
volatile int16_t ServoNickOffset = (255 / 2) * MULTIPLYER * 16; // initial value near center positon |
volatile int16_t ServoRollOffset = (255 / 2) * MULTIPLYER * 16; // initial value near center positon |
85,7 → 86,7 |
ISR(TIMER0_OVF_vect) // 9,7kHz |
{ |
static unsigned char cnt_1ms = 1,cnt = 0, compass_active = 0; |
static unsigned char cnt_1ms = 1,cnt = 0; |
unsigned char pieper_ein = 0; |
if(SendSPI) SendSPI--; |
if(SpektrumTimer) SpektrumTimer--; |
97,7 → 98,7 |
cnt_1ms %= 2; |
if(!cnt_1ms) UpdateMotor = 1; |
if(!(PINC & 0x10)) compass_active = 1; |
if(!(PINC & 0x10)) JustMK3MagConnected = 1; |
if(beeptime) |
{ |
129,11 → 130,11 |
} |
#endif |
} |
if(compass_active && !NaviDataOkay && Parameter_GlobalConfig & CFG_KOMPASS_AKTIV) |
if(JustMK3MagConnected && !NaviDataOkay && Parameter_GlobalConfig & CFG_KOMPASS_AKTIV) |
{ |
if(PINC & 0x10) |
{ |
if(++cntKompass > 1000) compass_active = 0; |
if(++cntKompass > 1000) JustMK3MagConnected = 0; |
} |
else |
{ |
/trunk/timer0.h |
---|
22,3 → 22,4 |
extern volatile int16_t ServoNickValue; |
extern volatile int16_t ServoRollValue; |
extern signed int NickServoValue; |
extern unsigned char JustMK3MagConnected; |
/trunk/uart.c |
---|
733,16 → 733,6 |
SendOutData('G',MeineSlaveAdresse, 1, (unsigned char *) &ExternControl, sizeof(ExternControl)); |
GetExternalControl = 0; |
} |
if((CheckDelay(Kompass_Timer)) && UebertragungAbgeschlossen) |
{ |
WinkelOut.Winkel[0] = (int) (IntegralNick / (EE_Parameter.GyroAccFaktor * 4)); // etwa in 0.1 Grad |
WinkelOut.Winkel[1] = (int) (IntegralRoll / (EE_Parameter.GyroAccFaktor * 4)); // etwa in 0.1 Grad |
WinkelOut.UserParameter[0] = Parameter_UserParam1; |
WinkelOut.UserParameter[1] = Parameter_UserParam2; |
SendOutData('k', MK3MAG_ADDRESS, 1, (unsigned char *) &WinkelOut,sizeof(WinkelOut)); |
if(WinkelOut.CalcState > 4) WinkelOut.CalcState = 6; // wird dann in SPI auf Null gesetzt |
Kompass_Timer = SetDelay(99); |
} |
if(((DebugDataIntervall>0 && CheckDelay(Debug_Timer)) || DebugDataAnforderung) && UebertragungAbgeschlossen) |
{ |
CopyDebugValues(); |
773,13 → 763,22 |
SendOutData('B', FC_ADDRESS, 1, (uint8_t*)&ConfirmFrame, sizeof(ConfirmFrame)); |
ConfirmFrame = 0; |
} |
if(GetPPMChannelAnforderung && UebertragungAbgeschlossen) |
{ |
SendOutData('P', FC_ADDRESS, 1, (unsigned char *) &PPM_in, sizeof(PPM_in)); |
GetPPMChannelAnforderung = 0; |
} |
if((CheckDelay(Kompass_Timer)) && UebertragungAbgeschlossen) |
{ |
WinkelOut.Winkel[0] = (int) (IntegralNick / (EE_Parameter.GyroAccFaktor * 4)); // etwa in 0.1 Grad |
WinkelOut.Winkel[1] = (int) (IntegralRoll / (EE_Parameter.GyroAccFaktor * 4)); // etwa in 0.1 Grad |
WinkelOut.UserParameter[0] = Parameter_UserParam1; |
WinkelOut.UserParameter[1] = Parameter_UserParam2; |
SendOutData('k', MK3MAG_ADDRESS, 1, (unsigned char *) &WinkelOut,sizeof(WinkelOut)); |
if(WinkelOut.CalcState > 4) WinkelOut.CalcState = 6; // wird dann in SPI auf Null gesetzt |
if(!NaviDataOkay) Kompass_Timer = SetDelay(99); |
else Kompass_Timer = SetDelay(999); |
} |
#ifdef DEBUG // only include functions if DEBUG is defined |
if(SendDebugOutput && UebertragungAbgeschlossen) |
{ |
787,7 → 786,6 |
SendDebugOutput = 0; |
} |
#endif |
} |