From 2db294caf747cc9c6ee3e23ffc73b6329fb6783f Mon Sep 17 00:00:00 2001 From: peabody124 Date: Mon, 23 Aug 2010 06:03:19 +0000 Subject: [PATCH] OP-125 Flight: Changed GPS stack size to a bit closer to what the internal model needs to get rid of out of memory warning, but it could still use 1k less if it pulled all the constants from flash when needed and computed the time difference when called. Also changed ManualControl so it checks the active control values to determine the warning, so if GCS is controlling the warning light goes out. git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1387 ebee16cc-31ac-478f-84a7-5cbb03baadba --- flight/OpenPilot/Modules/GPS/GPS.c | 2 +- .../Modules/ManualControl/manualcontrol.c | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/flight/OpenPilot/Modules/GPS/GPS.c b/flight/OpenPilot/Modules/GPS/GPS.c index fcab8182e..b22c05449 100644 --- a/flight/OpenPilot/Modules/GPS/GPS.c +++ b/flight/OpenPilot/Modules/GPS/GPS.c @@ -80,7 +80,7 @@ void nmeaProcessGPGSA(char* packet); // Private constants // Unfortunately need a good size stack for the WMM calculation -#define STACK_SIZE configMINIMAL_STACK_SIZE+3500 +#define STACK_SIZE configMINIMAL_STACK_SIZE + 2000 #define TASK_PRIORITY (tskIDLE_PRIORITY + 3) // Private types diff --git a/flight/OpenPilot/Modules/ManualControl/manualcontrol.c b/flight/OpenPilot/Modules/ManualControl/manualcontrol.c index 9548f83db..5d89600ba 100644 --- a/flight/OpenPilot/Modules/ManualControl/manualcontrol.c +++ b/flight/OpenPilot/Modules/ManualControl/manualcontrol.c @@ -154,6 +154,13 @@ static void manualControlTask(void* parameters) cmd.FlightMode = MANUALCONTROLCOMMAND_FLIGHTMODE_STABILIZED; } + // Update the ManualControlCommand object + ManualControlCommandSet(&cmd); + // This seems silly to set then get, but the reason is if the GCS is + // the control input, the set command will be blocked by the read only + // setting and the get command will pull the right values from telemetry + ManualControlCommandGet(&cmd); + // Check for connection status (negative throttle values) // The receiver failsafe for the throttle channel should be set to a value below the channel NEUTRAL if ( cmd.Throttle < THROTTLE_FAILSAFE ) @@ -171,14 +178,7 @@ static void manualControlTask(void* parameters) cmd.Throttle = 0; } } - - // Update the ManualControlCommand object - ManualControlCommandSet(&cmd); - // This seems silly to set then get, but the reason is if the GCS is - // the control input, the set command will be blocked by the read only - // setting and the get command will pull the right values from telemetry - ManualControlCommandGet(&cmd); - + // Depending on the mode update the Stabilization or Actuator objects if ( cmd.FlightMode == MANUALCONTROLCOMMAND_FLIGHTMODE_MANUAL ) {