1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-02-20 10:54:14 +01:00

Merge branch 'bugfix-flight'

This commit is contained in:
James Cotton 2011-05-11 20:10:38 -05:00
commit 612cd4ff55
5 changed files with 203 additions and 13 deletions

View File

@ -39,9 +39,9 @@ void error(int);
* data. This is non-intuitive for _binary_size where you
* might expect its value to hold the size but you'd be wrong.
*/
extern void _binary_start;
extern void _binary_end;
extern void _binary_size;
extern uint32_t _binary_start;
extern uint32_t _binary_end;
extern uint32_t _binary_size;
const uint32_t * embedded_image_start = (uint32_t *) &(_binary_start);
const uint32_t * embedded_image_end = (uint32_t *) &(_binary_end);
const uint32_t embedded_image_size = (uint32_t) &(_binary_size);

View File

@ -84,16 +84,16 @@
#define AUXUART_BAUDRATE 19200
/* Alarm Thresholds */
#define HEAP_LIMIT_WARNING 450
#define HEAP_LIMIT_CRITICAL 350
#define HEAP_LIMIT_WARNING 350
#define HEAP_LIMIT_CRITICAL 250
#define CPULOAD_LIMIT_WARNING 80
#define CPULOAD_LIMIT_CRITICAL 95
/* Task stack sizes */
#define PIOS_ACTUATOR_STACK_SIZE 1020
#define PIOS_MANUAL_STACK_SIZE 644
#define PIOS_SYSTEM_STACK_SIZE 644
#define PIOS_STABILIZATION_STACK_SIZE 624
#define PIOS_MANUAL_STACK_SIZE 724
#define PIOS_SYSTEM_STACK_SIZE 504
#define PIOS_STABILIZATION_STACK_SIZE 524
#define PIOS_TELEM_STACK_SIZE 500
#define IDLE_COUNTS_PER_SEC_AT_NO_LOAD 1995998

View File

@ -182,7 +182,7 @@ static void actuatorTask(void* parameters)
nMixers ++;
}
}
if(nMixers < 2) //Nothing can fly with less than two mixers.
if((nMixers < 2) && !ActuatorCommandReadOnly(dummy)) //Nothing can fly with less than two mixers.
{
setFailsafe(); // So that channels like PWM buzzer keep working
continue;
@ -198,8 +198,12 @@ static void actuatorTask(void* parameters)
float curve2 = MixerCurve(desired.Throttle,mixerSettings.ThrottleCurve2);
for(int ct=0; ct < MAX_MIX_ACTUATORS; ct++)
{
if(mixers[ct].type == MIXERSETTINGS_MIXER1TYPE_DISABLED)
if(mixers[ct].type == MIXERSETTINGS_MIXER1TYPE_DISABLED) {
// Set to minimum if disabled. This is not the same as saying PWM pulse = 0 us
status[ct] = -1;
command.Channel[ct] = 0;
continue;
}
status[ct] = ProcessMixer(ct, curve1, curve2, &mixerSettings, &desired, dT);
@ -400,14 +404,19 @@ static void setFailsafe()
// Reset ActuatorCommand to safe values
for (int n = 0; n < ACTUATORCOMMAND_CHANNEL_NUMELEM; ++n)
{
if(mixers[n].type == MIXERSETTINGS_MIXER1TYPE_MOTOR)
{
command.Channel[n] = settings.ChannelMin[n];
}
else
else if(mixers[n].type == MIXERSETTINGS_MIXER1TYPE_SERVO)
{
command.Channel[n] = settings.ChannelNeutral[n];
}
else
{
command.Channel[n] = 0;
}
}
// Set alarm

View File

@ -59,8 +59,8 @@
// optimisation options are changed.
#endif
#if defined(PIOS_MANUAL_STACK_SIZE)
#define STACK_SIZE_BYTES PIOS_MANUAL_STACK_SIZE
#if defined(PIOS_SYSTEM_STACK_SIZE)
#define STACK_SIZE_BYTES PIOS_SYSTEM_STACK_SIZE
#else
#define STACK_SIZE_BYTES 924
#endif

View File

@ -3125,6 +3125,52 @@
65FBE14412E7C98100176B5A /* pios_servo_priv.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pios_servo_priv.h; sourceTree = "<group>"; };
65FC66AA123F30F100B04F74 /* ahrs_timer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = ahrs_timer.c; path = ../../AHRS/ahrs_timer.c; sourceTree = SOURCE_ROOT; };
65FC66AB123F312A00B04F74 /* ahrs_timer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ahrs_timer.h; sourceTree = "<group>"; };
65FF4BB513791C3300146BE4 /* ahrs_slave_test.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ahrs_slave_test.c; sourceTree = "<group>"; };
65FF4BB613791C3300146BE4 /* ahrs_spi_program.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ahrs_spi_program.c; sourceTree = "<group>"; };
65FF4BB713791C3300146BE4 /* ahrs_spi_program_master.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ahrs_spi_program_master.c; sourceTree = "<group>"; };
65FF4BB813791C3300146BE4 /* ahrs_spi_program_slave.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ahrs_spi_program_slave.c; sourceTree = "<group>"; };
65FF4BB913791C3300146BE4 /* bl_fsm.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bl_fsm.c; sourceTree = "<group>"; };
65FF4BBB13791C3300146BE4 /* ahrs_bl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ahrs_bl.h; sourceTree = "<group>"; };
65FF4BBC13791C3300146BE4 /* ahrs_spi_program.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ahrs_spi_program.h; sourceTree = "<group>"; };
65FF4BBD13791C3300146BE4 /* ahrs_spi_program_master.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ahrs_spi_program_master.h; sourceTree = "<group>"; };
65FF4BBE13791C3300146BE4 /* ahrs_spi_program_slave.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ahrs_spi_program_slave.h; sourceTree = "<group>"; };
65FF4BBF13791C3300146BE4 /* bl_fsm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = bl_fsm.h; sourceTree = "<group>"; };
65FF4BC013791C3300146BE4 /* pios_config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pios_config.h; sourceTree = "<group>"; };
65FF4BC113791C3300146BE4 /* main.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = main.c; sourceTree = "<group>"; };
65FF4BC213791C3300146BE4 /* Makefile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.make; path = Makefile; sourceTree = "<group>"; };
65FF4BC313791C3300146BE4 /* pios_board.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = pios_board.c; sourceTree = "<group>"; };
65FF4BC613791C3300146BE4 /* pios_config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pios_config.h; sourceTree = "<group>"; };
65FF4BC713791C3300146BE4 /* main.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = main.c; sourceTree = "<group>"; };
65FF4BC813791C3300146BE4 /* Makefile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.make; path = Makefile; sourceTree = "<group>"; };
65FF4BC913791C3300146BE4 /* pios_board.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = pios_board.c; sourceTree = "<group>"; };
65FF4BCA13791C3300146BE4 /* test.bin */ = {isa = PBXFileReference; lastKnownFileType = archive.macbinary; path = test.bin; sourceTree = "<group>"; };
65FF4BCD13791C3300146BE4 /* common.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = common.h; sourceTree = "<group>"; };
65FF4BCE13791C3300146BE4 /* op_dfu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = op_dfu.h; sourceTree = "<group>"; };
65FF4BCF13791C3300146BE4 /* pios_config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pios_config.h; sourceTree = "<group>"; };
65FF4BD013791C3300146BE4 /* pios_usb.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pios_usb.h; sourceTree = "<group>"; };
65FF4BD113791C3300146BE4 /* main.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = main.c; sourceTree = "<group>"; };
65FF4BD213791C3300146BE4 /* Makefile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.make; path = Makefile; sourceTree = "<group>"; };
65FF4BD313791C3300146BE4 /* op_dfu.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = op_dfu.c; sourceTree = "<group>"; };
65FF4BD413791C3300146BE4 /* pios_board.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = pios_board.c; sourceTree = "<group>"; };
65FF4BD713791C3300146BE4 /* common.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = common.h; sourceTree = "<group>"; };
65FF4BD813791C3300146BE4 /* op_dfu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = op_dfu.h; sourceTree = "<group>"; };
65FF4BD913791C3300146BE4 /* pios_config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pios_config.h; sourceTree = "<group>"; };
65FF4BDA13791C3300146BE4 /* pios_usb.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pios_usb.h; sourceTree = "<group>"; };
65FF4BDB13791C3300146BE4 /* ssp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ssp.h; sourceTree = "<group>"; };
65FF4BDC13791C3300146BE4 /* main.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = main.c; sourceTree = "<group>"; };
65FF4BDD13791C3300146BE4 /* Makefile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.make; path = Makefile; sourceTree = "<group>"; };
65FF4BDE13791C3300146BE4 /* op_dfu.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = op_dfu.c; sourceTree = "<group>"; };
65FF4BDF13791C3300146BE4 /* pios_board.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = pios_board.c; sourceTree = "<group>"; };
65FF4BE013791C3300146BE4 /* ssp.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ssp.c; sourceTree = "<group>"; };
65FF4BE113791C3300146BE4 /* ssp_timer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ssp_timer.c; sourceTree = "<group>"; };
65FF4BE413791C3300146BE4 /* common.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = common.h; sourceTree = "<group>"; };
65FF4BE513791C3300146BE4 /* op_dfu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = op_dfu.h; sourceTree = "<group>"; };
65FF4BE613791C3300146BE4 /* pios_config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pios_config.h; sourceTree = "<group>"; };
65FF4BE713791C3300146BE4 /* pios_usb.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pios_usb.h; sourceTree = "<group>"; };
65FF4BE813791C3300146BE4 /* main.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = main.c; sourceTree = "<group>"; };
65FF4BE913791C3300146BE4 /* Makefile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.make; path = Makefile; sourceTree = "<group>"; };
65FF4BEA13791C3300146BE4 /* op_dfu.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = op_dfu.c; sourceTree = "<group>"; };
65FF4BEB13791C3300146BE4 /* pios_board.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = pios_board.c; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXGroup section */
@ -3505,6 +3551,7 @@
657CEEB5121DBC49007A1FBE /* flight */ = {
isa = PBXGroup;
children = (
65FF4BB313791C3300146BE4 /* Bootloaders */,
65F93B9012EE09280047DB36 /* PipXtreme */,
65B7E6AC120DF1CD000C1123 /* AHRS */,
65E6DF7012E02E8E00058553 /* CopterControl */,
@ -8238,6 +8285,140 @@
path = inc;
sourceTree = "<group>";
};
65FF4BB313791C3300146BE4 /* Bootloaders */ = {
isa = PBXGroup;
children = (
65FF4BB413791C3300146BE4 /* AHRS */,
65FF4BC413791C3300146BE4 /* BootloaderUpdater */,
65FF4BCB13791C3300146BE4 /* CopterControl */,
65FF4BD513791C3300146BE4 /* OpenPilot */,
65FF4BE213791C3300146BE4 /* PipXtreme */,
);
name = Bootloaders;
path = ../../Bootloaders;
sourceTree = SOURCE_ROOT;
};
65FF4BB413791C3300146BE4 /* AHRS */ = {
isa = PBXGroup;
children = (
65FF4BB513791C3300146BE4 /* ahrs_slave_test.c */,
65FF4BB613791C3300146BE4 /* ahrs_spi_program.c */,
65FF4BB713791C3300146BE4 /* ahrs_spi_program_master.c */,
65FF4BB813791C3300146BE4 /* ahrs_spi_program_slave.c */,
65FF4BB913791C3300146BE4 /* bl_fsm.c */,
65FF4BBA13791C3300146BE4 /* inc */,
65FF4BC113791C3300146BE4 /* main.c */,
65FF4BC213791C3300146BE4 /* Makefile */,
65FF4BC313791C3300146BE4 /* pios_board.c */,
);
path = AHRS;
sourceTree = "<group>";
};
65FF4BBA13791C3300146BE4 /* inc */ = {
isa = PBXGroup;
children = (
65FF4BBB13791C3300146BE4 /* ahrs_bl.h */,
65FF4BBC13791C3300146BE4 /* ahrs_spi_program.h */,
65FF4BBD13791C3300146BE4 /* ahrs_spi_program_master.h */,
65FF4BBE13791C3300146BE4 /* ahrs_spi_program_slave.h */,
65FF4BBF13791C3300146BE4 /* bl_fsm.h */,
65FF4BC013791C3300146BE4 /* pios_config.h */,
);
path = inc;
sourceTree = "<group>";
};
65FF4BC413791C3300146BE4 /* BootloaderUpdater */ = {
isa = PBXGroup;
children = (
65FF4BC513791C3300146BE4 /* inc */,
65FF4BC713791C3300146BE4 /* main.c */,
65FF4BC813791C3300146BE4 /* Makefile */,
65FF4BC913791C3300146BE4 /* pios_board.c */,
65FF4BCA13791C3300146BE4 /* test.bin */,
);
path = BootloaderUpdater;
sourceTree = "<group>";
};
65FF4BC513791C3300146BE4 /* inc */ = {
isa = PBXGroup;
children = (
65FF4BC613791C3300146BE4 /* pios_config.h */,
);
path = inc;
sourceTree = "<group>";
};
65FF4BCB13791C3300146BE4 /* CopterControl */ = {
isa = PBXGroup;
children = (
65FF4BCC13791C3300146BE4 /* inc */,
65FF4BD113791C3300146BE4 /* main.c */,
65FF4BD213791C3300146BE4 /* Makefile */,
65FF4BD313791C3300146BE4 /* op_dfu.c */,
65FF4BD413791C3300146BE4 /* pios_board.c */,
);
path = CopterControl;
sourceTree = "<group>";
};
65FF4BCC13791C3300146BE4 /* inc */ = {
isa = PBXGroup;
children = (
65FF4BCD13791C3300146BE4 /* common.h */,
65FF4BCE13791C3300146BE4 /* op_dfu.h */,
65FF4BCF13791C3300146BE4 /* pios_config.h */,
65FF4BD013791C3300146BE4 /* pios_usb.h */,
);
path = inc;
sourceTree = "<group>";
};
65FF4BD513791C3300146BE4 /* OpenPilot */ = {
isa = PBXGroup;
children = (
65FF4BD613791C3300146BE4 /* inc */,
65FF4BDC13791C3300146BE4 /* main.c */,
65FF4BDD13791C3300146BE4 /* Makefile */,
65FF4BDE13791C3300146BE4 /* op_dfu.c */,
65FF4BDF13791C3300146BE4 /* pios_board.c */,
65FF4BE013791C3300146BE4 /* ssp.c */,
65FF4BE113791C3300146BE4 /* ssp_timer.c */,
);
path = OpenPilot;
sourceTree = "<group>";
};
65FF4BD613791C3300146BE4 /* inc */ = {
isa = PBXGroup;
children = (
65FF4BD713791C3300146BE4 /* common.h */,
65FF4BD813791C3300146BE4 /* op_dfu.h */,
65FF4BD913791C3300146BE4 /* pios_config.h */,
65FF4BDA13791C3300146BE4 /* pios_usb.h */,
65FF4BDB13791C3300146BE4 /* ssp.h */,
);
path = inc;
sourceTree = "<group>";
};
65FF4BE213791C3300146BE4 /* PipXtreme */ = {
isa = PBXGroup;
children = (
65FF4BE313791C3300146BE4 /* inc */,
65FF4BE813791C3300146BE4 /* main.c */,
65FF4BE913791C3300146BE4 /* Makefile */,
65FF4BEA13791C3300146BE4 /* op_dfu.c */,
65FF4BEB13791C3300146BE4 /* pios_board.c */,
);
path = PipXtreme;
sourceTree = "<group>";
};
65FF4BE313791C3300146BE4 /* inc */ = {
isa = PBXGroup;
children = (
65FF4BE413791C3300146BE4 /* common.h */,
65FF4BE513791C3300146BE4 /* op_dfu.h */,
65FF4BE613791C3300146BE4 /* pios_config.h */,
65FF4BE713791C3300146BE4 /* pios_usb.h */,
);
path = inc;
sourceTree = "<group>";
};
C6A0FF2B0290797F04C91782 /* Documentation */ = {
isa = PBXGroup;
children = (