Subversion Repositories FlightCtrl

Compare Revisions

Ignore whitespace Rev 1343 → Rev 1344

/trunk/main.c
199,6 → 199,10
 
printf("\n\r===================================");
printf("\n\rFlightControl\n\rHardware:%d.%d\n\rSoftware:V%d.%d%c ",PlatinenVersion/10,PlatinenVersion%10, VERSION_MAJOR, VERSION_MINOR,VERSION_PATCH + 'a');
printf("\n\rthe use of this software is only permitted \n\ron original MikroKopter-Hardware");
printf("\n\rwww.MikroKopter.de (c) HiSystems GmbH");
printf("\n\r===================================");
 
if(UCSR1A == 0x20 && UCSR1C == 0x06) // initial Values for 644P
{
Uart1Init();
341,17 → 345,15
LipoDetection(1);
printf("\n\r===================================\n\r");
//SpektrumBinding();
timer = SetDelay(100);
timer = SetDelay(1000);
while (1)
{
if(UpdateMotor && AdReady) // ReglerIntervall
{
UpdateMotor=0;
J3High;
if(WinkelOut.CalcState) CalMk3Mag();
else MotorRegler();
SendMotorData();
J3Low;
ROT_OFF;
if(SenderOkay) SenderOkay--;
else TIMSK1 |= _BV(ICIE1); // enable PPM-Input
393,7 → 395,7
else BearbeiteRxDaten();
if(CheckDelay(timer))
{
timer += 20;//SetDelay(20);
timer += 20;
if(PcZugriff) PcZugriff--;
else
{
425,10 → 427,11
timer2 = 0;
FlugMinuten++;
FlugMinutenGesamt++;
eeprom_write_byte(&EEPromArray[EEPROM_ADR_MINUTES2],FlugMinuten / 256); // ACC-NeutralWerte speichern
eeprom_write_byte(&EEPromArray[EEPROM_ADR_MINUTES2+1],FlugMinuten % 256); // ACC-NeutralWerte speichern
eeprom_write_byte(&EEPromArray[EEPROM_ADR_MINUTES],FlugMinutenGesamt / 256); // ACC-NeutralWerte speichern
eeprom_write_byte(&EEPromArray[EEPROM_ADR_MINUTES+1],FlugMinutenGesamt % 256); // ACC-NeutralWerte speichern
eeprom_write_byte(&EEPromArray[EEPROM_ADR_MINUTES2],FlugMinuten / 256);
eeprom_write_byte(&EEPromArray[EEPROM_ADR_MINUTES2+1],FlugMinuten % 256);
eeprom_write_byte(&EEPromArray[EEPROM_ADR_MINUTES],FlugMinutenGesamt / 256);
eeprom_write_byte(&EEPromArray[EEPROM_ADR_MINUTES+1],FlugMinutenGesamt % 256);
timer = SetDelay(20); // falls "timer += 20;" mal nicht geht
}
}
LED_Update();
/trunk/makefile
5,7 → 5,7
#-------------------------------------------------------------------
VERSION_MAJOR = 0
VERSION_MINOR = 75
VERSION_PATCH = 15
VERSION_PATCH = 16
 
VERSION_SERIAL_MAJOR = 10 # Serial Protocol
VERSION_SERIAL_MINOR = 1 # Serial Protocol
/trunk/mymath.c
102,24 → 102,5
return (root >> 1);
}
 
uint16_t c_sqrt_int(uint16_t a)
{
uint16_t rem = 0;
uint16_t root = 0;
uint8_t i;
for(i = 0; i < 16; i++)
{
root <<= 1;
rem = ((rem << 2) + (a >> 30));
a <<= 2;
root++;
if(root <= rem)
{
rem -= root;
root++;
}
else root--;
}
return (root >> 1);
}
 
 
/trunk/mymath.h
7,5 → 7,4
extern int16_t c_cos_8192(int16_t angle);
extern int16_t c_atan2(int16_t y, int16_t x);
extern uint32_t c_sqrt(uint32_t a);
extern uint16_t c_sqrt_int(uint16_t a);
#endif // _MYMATH_H