Subversion Repositories FlightCtrl

Compare Revisions

Ignore whitespace Rev 2379 → Rev 2380

/trunk/eeprom.h
4,7 → 4,7
#include <inttypes.h>
#include "twimaster.h"
 
#define EEPARAM_REVISION 95 // is count up, if paramater stucture has changed (compatibility)
#define EEPARAM_REVISION 96 // is count up, if paramater stucture has changed (compatibility)
#define EEMIXER_REVISION 1 // is count up, if mixer stucture has changed (compatibility)
 
#define EEPROM_ADR_PARAM_BEGIN 0
52,6 → 52,7
#define CFG3_NO_GPSFIX_NO_START 0x10
#define CFG3_USE_NC_FOR_OUT1 0x20
#define CFG3_SPEAK_ALL 0x40
#define CFG3_SERVO_NICK_COMP_OFF 0x80
 
//GlobalConfig
#define CFG_HOEHENREGELUNG 0x01
/trunk/fc.c
2149,21 → 2149,22
else tmp_int += ((long)GierMischanteil * Mixer.Motor[i][3]) / 64L;
 
if(tmp_int > tmp_motorwert[i]) tmp_int = (tmp_motorwert[i] + tmp_int) / 2; // MotorSmoothing
// else tmp_int = 2 * tmp_int - tmp_motorwert[i]; // original MotorSmoothing
else
{
if(EE_Parameter.MotorSmooth == 0)
unsigned char smooth;
smooth = EE_Parameter.MotorSmooth;
if(!smooth && Motor[i].Version & MOTOR_STATE_FAST_MODE) smooth = 2;
if(smooth == 0)
{
tmp_int = 2 * tmp_int - tmp_motorwert[i]; // original MotorSmoothing
}
else // 1 means tmp_int = tmp_int;
if(EE_Parameter.MotorSmooth > 1)
if(smooth > 1)
{
// If >= 2 then allow >= 50% of the intended step down to rapidly reach the intended value.
tmp_int = tmp_int + ((tmp_motorwert[i] - tmp_int)/EE_Parameter.MotorSmooth);
tmp_int = tmp_int + ((tmp_motorwert[i] - tmp_int) / smooth);
}
}
 
LIMIT_MIN_MAX(tmp_int,(int) MIN_GAS * 4,(int) MAX_GAS * 4);
Motor[i].SetPoint = tmp_int / 4;
Motor[i].SetPointLowerBits = (tmp_int % 4)<<1; // (3 bits total)
/trunk/led.c
57,9 → 57,9
{
if((EE_Parameter.BitConfig & CFG_MOTOR_BLINK1) && !MotorenEin) {if(EE_Parameter.BitConfig & CFG_MOTOR_OFF_LED1) J16_ON; else J16_OFF;}
else
if((EE_Parameter.J16Timing > 247) && (Parameter_J16Timing > 220)) {if(J16Bitmask & 128) J16_ON; else J16_OFF; J16Mask = 1; NC_Wait_for_LED = 0;} // Manual overwrite
if((EE_Parameter.J16Timing > 247) && (Parameter_J16Timing > 220)) {if(J16Bitmask & 128) J16_OFF; else J16_ON; J16Mask = 1; NC_Wait_for_LED = 0;} // Manual overwrite
else
if((EE_Parameter.J16Timing > 247) && (Parameter_J16Timing == 5)) {if(J16Bitmask & 128) J16_OFF; else J16_ON; J16Mask = 1; NC_Wait_for_LED = 0;} // Manual overwrite
if((EE_Parameter.J16Timing > 247) && (Parameter_J16Timing == 5)) {if(J16Bitmask & 128) J16_ON; else J16_OFF; J16Mask = 1; NC_Wait_for_LED = 0;} // Manual overwrite
else
if(!J16Blinkcount--)
{
66,7 → 66,7
if(EE_Parameter.GlobalConfig3 & CFG3_USE_NC_FOR_OUT1)
{
J16Blinkcount = from_nc / 2;
if(!from_nc) { NC_Wait_for_LED = 0; if(J16Bitmask & 128) J16_OFF; else J16_ON; J16Mask = 0; } // Ausschalten
if(!from_nc) { NC_Wait_for_LED = 0; if(J16Bitmask & 128) J16_ON; else J16_OFF; J16Mask = 0; } // Ausschalten
else
{
NC_Wait_for_LED = 1;
73,9 → 73,8
if(J16Mask == 0)
{
from_nc = 0;
// NC_Wait_for_LED = 0;
J16Mask = 128;
if(J16Bitmask & 128) J16_OFF; else J16_ON; // Ausschalten
J16Mask = 64;
if(J16Bitmask & 128) J16_ON; else J16_OFF; // Ausschalten
}
else
{
107,15 → 106,15
{
if((EE_Parameter.BitConfig & CFG_MOTOR_BLINK2) && !MotorenEin) {if(EE_Parameter.BitConfig & CFG_MOTOR_OFF_LED2) J17_ON; else J17_OFF;}
else
if((EE_Parameter.J17Timing > 247) && (Parameter_J17Timing > 220)) {if(J17Bitmask & 128) J17_ON; else J17_OFF; J17Mask = 1;}
if((EE_Parameter.J17Timing > 247) && (Parameter_J17Timing > 220)) {if(J17Bitmask & 128) J17_OFF; else J17_ON; J17Mask = 1;}
else
if((EE_Parameter.J17Timing > 247) && (Parameter_J17Timing == 5)) {if(J17Bitmask & 128) J17_OFF; else J17_ON; J17Mask = 1;}
if((EE_Parameter.J17Timing > 247) && (Parameter_J17Timing == 5)) {if(J17Bitmask & 128) J17_ON; else J17_OFF; J17Mask = 1;}
else
if(!J17Blinkcount--)
{
J17Blinkcount = Parameter_J17Timing / 2;
if(J17Mask == 1) J17Mask = 128; else J17Mask /= 2;
if(J17Mask & J17Bitmask) J17_ON; else J17_OFF;
if(J17Mask == 1) J17Mask = 64; else J17Mask /= 2;
if(J17Mask & J17Bitmask) J17_OFF; else J17_ON;
}
}
else // warning case
/trunk/libfc1284.a
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/main.c
210,7 → 210,8
{
printf("%d",i+1);
FoundMotors++;
// if(Motor[i].Version & MOTOR_STATE_NEW_PROTOCOL_MASK) printf("(new) ");
// if(Motor[i].Version & MOTOR_STATE_FAST_MODE) printf("(fast)\n\r");
// else if(Motor[i].Version & MOTOR_STATE_NEW_PROTOCOL_MASK) printf("(new)\n\r");
}
}
for(i=0; i < MAX_MOTORS; i++)
/trunk/makefile
5,12 → 5,12
F_CPU = 20000000
#-------------------------------------------------------------------
VERSION_MAJOR = 2
VERSION_MINOR = 00
VERSION_PATCH = 3
VERSION_MINOR = 01
VERSION_PATCH = 0
VERSION_SERIAL_MAJOR = 11 # Serial Protocol
VERSION_SERIAL_MINOR = 0 # Serial Protocol
NC_SPI_COMPATIBLE = 55 # Navi-Kompatibilität
LIB_FC_COMPATIBLE = 4 # Library
NC_SPI_COMPATIBLE = 56 # Navi-Kompatibilität
LIB_FC_COMPATIBLE = 5 # Library
#-------------------------------------------------------------------
# ATMEGA644: 63487 is maximum
#-------------------------------------------------------------------
/trunk/menu.c
91,7 → 91,7
{
case 0:
LCD_printfxy(0,0,"+ MikroKopter +");
LCD_printfxy(0,1,"HW:V%d.%d SW:%d.%d%c V4",PlatinenVersion/10,PlatinenVersion%10, VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH +'a');
LCD_printfxy(0,1,"HW:V%d.%d SW:%d.%02d%c ",PlatinenVersion/10,PlatinenVersion%10, VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH +'a');
LCD_printfxy(0,2,"Setting:%d %s", ActiveParamSet,Mixer.Name);
 
if(VersionInfo.HardwareError[1] & FC_ERROR1_MIXER) LCD_printfxy(0,3,"Mixer Error!")
244,6 → 244,7
for(i=0;i<3;i++)
{
LCD_printfxy(0,i+1,"%3d %3d %3d %3d ",Motor[i*4].Current,Motor[i*4+1].Current,Motor[i*4+2].Current,Motor[i*4+3].Current);
// LCD_printfxy(0,i+1,"%3d %3d %3d %3d ",Motor[i*4].MaxPWM,Motor[i*4+1].MaxPWM,Motor[i*4+2].MaxPWM,Motor[i*4+3].MaxPWM);
if(4 + i * 4 >= RequiredMotors) break;
}
break;
/trunk/timer0.c
272,13 → 272,8
 
if(CalculateServoSignals == 1)
{
 
if(Parameter_UserParam1 < 100) // testweise
{
nick = (cosinus * IntegralNick) / 128L - (sinus * IntegralRoll) / 128L;
}
else nick = 0;
if(EE_Parameter.GlobalConfig3 & CFG3_SERVO_NICK_COMP_OFF) nick = 0;
else nick = (cosinus * IntegralNick) / 128L - (sinus * IntegralRoll) / 128L;
nick -= POI_KameraNick * 7;
nick = ((long)Parameter_ServoNickComp * nick) / 512L;
// offset (Range from 0 to 255 * 3 = 765)
/trunk/twimaster.c
298,8 → 298,14
{
if(BLFlags & BLFLAG_READ_VERSION)
{
if(!(FC_StatusFlags & FC_STATUS_MOTOR_RUN) && (Motor[motor_read].MaxPWM == 250) ) Motor[motor_read].Version |= MOTOR_STATE_NEW_PROTOCOL_MASK;
else Motor[motor_read].Version = 0;
// if(!(FC_StatusFlags & FC_STATUS_MOTOR_RUN) && ((Motor[motor_read].MaxPWM & 252) == 248)) Motor[motor_read].Version |= MOTOR_STATE_NEW_PROTOCOL_MASK;
// else Motor[motor_read].Version = 0;
if(!(FC_StatusFlags & FC_STATUS_MOTOR_RUN))
{
if((Motor[motor_read].MaxPWM & 252) == 248) Motor[motor_read].Version |= MOTOR_STATE_NEW_PROTOCOL_MASK;
else Motor[motor_read].Version = 0;
if(Motor[motor_read].MaxPWM == 248) Motor[motor_read].Version |= MOTOR_STATE_FAST_MODE;
}
}
if(++motor_read >= MAX_MOTORS)
{
/trunk/twimaster.h
19,7 → 19,9
#define MOTOR_STATE_PRESENT_MASK 0x80
#define MOTOR_STATE_ERROR_MASK 0x7F
 
//Motor[x].Version
#define MOTOR_STATE_NEW_PROTOCOL_MASK 0x01
#define MOTOR_STATE_FAST_MODE 0x02
 
#define BLFLAG_TX_COMPLETE 0x01
#define BLFLAG_READ_VERSION 0x02
26,7 → 28,6
 
extern volatile uint8_t BLFlags;
 
 
#define BL_READMODE_STATUS 0
#define BL_READMODE_CONFIG 16
 
/trunk/uart.c
200,7 → 200,7
NeuerDatensatzEmpfangen = 1;
AnzahlEmpfangsBytes = buf_ptr + 1;
RxdBuffer[buf_ptr] = '\r';
if(RxdBuffer[2] == 'R')
if(RxdBuffer[2] == 'R' && !MotorenEin)
{
LcdClear();
wdt_enable(WDTO_250MS); // Reset-Commando
/trunk/version.txt
639,8 → 639,11
- added the MK Status in Transmitter Logfile -> General->Fuel
- added the MK Speach in Transmitter Logfile -> General->Alt3Sek
2.00e
2.01a
- Jeti:GPS-Koordinate
- Don't accept Reset-Command if Motor running
- 'Idle' Bit in Output-Mask
- Option: DisableServoNick