/branches/dongfang_FC_fixedwing/arduino_atmega328/configuration.c |
---|
85,8 → 85,11 |
staticParams.IFactor = 52; |
staticParams.airspeedCorrection = 1; |
staticParams.isFlyingThreshold = 10; |
staticParams.isFlyingThreshold = 4; |
staticParams.minFlashAirspeed = 5; |
staticParams.maxFlashAirspeed = 9; |
// Servos |
staticParams.servoCount = 6; |
staticParams.servos[CONTROL_ELEVATOR].reverse = 0; |
/branches/dongfang_FC_fixedwing/arduino_atmega328/configuration.h |
---|
150,6 → 150,8 |
// Airspeed |
uint8_t airspeedCorrection; |
uint8_t isFlyingThreshold; |
uint8_t minFlashAirspeed; |
uint8_t maxFlashAirspeed; |
// Servos |
uint8_t servoCount; |
/branches/dongfang_FC_fixedwing/arduino_atmega328/eeprom.h |
---|
25,7 → 25,7 |
#define EEPROM_ADR_PARAMSET_BEGIN 256 |
#define CHANNELMAP_REVISION 1 |
#define EEPARAM_REVISION 100 |
#define EEPARAM_REVISION 102 |
#define EEMIXER_REVISION 0 |
#define SENSOROFFSET_REVISION 0 |
#define IMUCONFIG_REVISION 1 |
/branches/dongfang_FC_fixedwing/arduino_atmega328/output.h |
---|
37,7 → 37,7 |
*/ |
#define DEBUG_MAINLOOP_TIMER 1 |
#define DEBUG_HEIGHT_DIFF 2 |
#define DEBUG_AIRSPEED 2 |
#define DEBUG_FLIGHTCLIP 4 |
#define DEBUG_ACC0THORDER 8 |
#define DEBUG_COMPASS 16 |
/branches/dongfang_FC_fixedwing/configuration.c |
---|
134,8 → 134,11 |
staticParams.IFactor = 52; |
staticParams.airspeedCorrection = 1; |
staticParams.isFlyingThreshold = 10; |
staticParams.isFlyingThreshold = 4; |
staticParams.minFlashAirspeed = 5; |
staticParams.maxFlashAirspeed = 9; |
// Servos |
staticParams.servoCount = 7; |
staticParams.servos[CONTROL_ELEVATOR].reverse = 1; |
/branches/dongfang_FC_fixedwing/configuration.h |
---|
150,6 → 150,8 |
// Airspeed |
uint8_t airspeedCorrection; |
uint8_t isFlyingThreshold; |
uint8_t minFlashAirspeed; |
uint8_t maxFlashAirspeed; |
// Servos |
uint8_t servoCount; |
/branches/dongfang_FC_fixedwing/eeprom.h |
---|
25,7 → 25,7 |
#define EEPROM_ADR_PARAMSET_BEGIN 256 |
#define CHANNELMAP_REVISION 1 |
#define EEPARAM_REVISION 100 |
#define EEPARAM_REVISION 102 |
#define EEMIXER_REVISION 0 |
#define SENSOROFFSET_REVISION 0 |
#define IMUCONFIG_REVISION 1 |
/branches/dongfang_FC_fixedwing/flight.c |
---|
57,6 → 57,42 |
} |
} |
// min = 10 max = 12, speed = 11 shold make 50/50 cycle. |
void updateAirspeedIndicatorLEDs(void) { |
static uint8_t flashPrescaler = 0; |
static uint8_t flashCnt = 0; |
flashPrescaler++; |
if (flashPrescaler == 10) { |
flashPrescaler = 0; |
if (airspeedVelocity <= staticParams.minFlashAirspeed) { |
debugOut.digital[0] &= ~DEBUG_AIRSPEED; |
debugOut.digital[1] &= ~DEBUG_AIRSPEED; |
return; |
} |
if (airspeedVelocity >= staticParams.maxFlashAirspeed) { |
debugOut.digital[0] |= DEBUG_AIRSPEED; |
debugOut.digital[1] |= DEBUG_AIRSPEED; |
return; |
} |
uint8_t span = staticParams.maxFlashAirspeed - staticParams.minFlashAirspeed; // is 2 |
uint8_t speed = airspeedVelocity - staticParams.minFlashAirspeed; // is 1 |
if (flashCnt > speed) { |
debugOut.digital[0] &= ~DEBUG_AIRSPEED; |
debugOut.digital[1] &= ~DEBUG_AIRSPEED; |
} else { |
debugOut.digital[0] |= DEBUG_AIRSPEED; |
debugOut.digital[1] |= DEBUG_AIRSPEED; |
} |
flashCnt++; |
if (flashCnt >= span) flashCnt = 0; |
} |
} |
// Normal at airspeed = 10. |
uint8_t calcAirspeedPID(uint8_t pid) { |
if (!(staticParams.bitConfig & CFG_USE_AIRSPEED_PID)) { |
/branches/dongfang_FC_fixedwing/output.h |
---|
45,7 → 45,7 |
*/ |
#define DEBUG_MAINLOOP_TIMER 1 |
#define DEBUG_HEIGHT_DIFF 2 |
#define DEBUG_AIRSPEED 2 |
#define DEBUG_FLIGHTCLIP 4 |
#define DEBUG_ACC0THORDER 8 |
#define DEBUG_COMPASS 16 |