From 84465ae0cb2b9f306337c9a346e1d2bcf26a811c Mon Sep 17 00:00:00 2001 From: Alessio Morale Date: Tue, 24 Feb 2015 22:02:25 +0100 Subject: [PATCH 1/4] OP-1743 - Fix a very ugly error in attitude(cc/cc3d) --- flight/modules/Attitude/attitude.c | 11 +++++++---- .../boards/coptercontrol/firmware/pios_board.c | 2 ++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/flight/modules/Attitude/attitude.c b/flight/modules/Attitude/attitude.c index 9b6e34f74..f0e242b55 100644 --- a/flight/modules/Attitude/attitude.c +++ b/flight/modules/Attitude/attitude.c @@ -178,8 +178,9 @@ int32_t AttitudeStart(void) // Start main task xTaskCreate(AttitudeTask, "Attitude", STACK_SIZE_BYTES / 4, NULL, TASK_PRIORITY, &taskHandle); PIOS_TASK_MONITOR_RegisterTask(TASKINFO_RUNNING_ATTITUDE, taskHandle); +#ifdef PIOS_INCLUDE_WDG PIOS_WDG_RegisterFlag(PIOS_WDG_ATTITUDE); - +#endif return 0; } @@ -253,7 +254,9 @@ static void AttitudeTask(__attribute__((unused)) void *parameters) // Set critical error and wait until the accel is producing data while (PIOS_ADXL345_FifoElements() == 0) { AlarmsSet(SYSTEMALARMS_ALARM_ATTITUDE, SYSTEMALARMS_ALARM_CRITICAL); +#ifdef PIOS_INCLUDE_WDG PIOS_WDG_UpdateFlag(PIOS_WDG_ATTITUDE); +#endif } accel_test = PIOS_ADXL345_Test(); #endif @@ -310,9 +313,9 @@ static void AttitudeTask(__attribute__((unused)) void *parameters) } init = 1; } - +#ifdef PIOS_INCLUDE_WDG PIOS_WDG_UpdateFlag(PIOS_WDG_ATTITUDE); - +#endif AccelStateData accelState; GyroStateData gyros; int32_t retval = 0; @@ -487,7 +490,7 @@ static int32_t updateSensorsCC3D(AccelStateData *accelStateData, GyroStateData * count++; // check if further samples are already in queue - ret = xQueueReceive(queue, (void *)&mpu6000_data, 0); + ret = xQueueReceive(queue, (void *)mpu6000_data, 0); } PERF_TRACK_VALUE(counterAccelSamples, count); diff --git a/flight/targets/boards/coptercontrol/firmware/pios_board.c b/flight/targets/boards/coptercontrol/firmware/pios_board.c index a2f183925..474a21330 100644 --- a/flight/targets/boards/coptercontrol/firmware/pios_board.c +++ b/flight/targets/boards/coptercontrol/firmware/pios_board.c @@ -241,8 +241,10 @@ void PIOS_Board_Init(void) HwSettingsInitialize(); #ifndef ERASE_FLASH +#ifdef PIOS_INCLUDE_WDG /* Initialize watchdog as early as possible to catch faults during init */ PIOS_WDG_Init(); +#endif #endif /* Initialize the alarms library */ From a30f1155671811e85fbeec29a28753ff198d38d3 Mon Sep 17 00:00:00 2001 From: Alessio Morale Date: Tue, 24 Feb 2015 22:02:56 +0100 Subject: [PATCH 2/4] OP-1743 - Fix uninitialized objects usage --- flight/modules/ManualControl/manualcontrol.c | 4 ++-- flight/modules/Receiver/receiver.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/flight/modules/ManualControl/manualcontrol.c b/flight/modules/ManualControl/manualcontrol.c index fa8a7497d..cf65a9328 100644 --- a/flight/modules/ManualControl/manualcontrol.c +++ b/flight/modules/ManualControl/manualcontrol.c @@ -43,8 +43,8 @@ #include #include #include -#ifndef PIOS_EXCLUDE_ADVANCED_FEATURES #include +#ifndef PIOS_EXCLUDE_ADVANCED_FEATURES #include #endif @@ -160,9 +160,9 @@ int32_t ManualControlInitialize() ManualControlSettingsInitialize(); FlightModeSettingsInitialize(); SystemSettingsInitialize(); + StabilizationSettingsInitialize(); #ifndef PIOS_EXCLUDE_ADVANCED_FEATURES VtolSelfTuningStatsInitialize(); - StabilizationSettingsInitialize(); VtolPathFollowerSettingsInitialize(); #endif callbackHandle = PIOS_CALLBACKSCHEDULER_Create(&manualControlTask, CALLBACK_PRIORITY, CBTASK_PRIORITY, CALLBACKINFO_RUNNING_MANUALCONTROL, STACK_SIZE_BYTES); diff --git a/flight/modules/Receiver/receiver.c b/flight/modules/Receiver/receiver.c index bf68b73e0..2f42b7eed 100644 --- a/flight/modules/Receiver/receiver.c +++ b/flight/modules/Receiver/receiver.c @@ -135,7 +135,7 @@ int32_t ReceiverInitialize() { /* Check the assumptions about uavobject enum's are correct */ PIOS_STATIC_ASSERT(assumptions); - + AccessoryDesiredInitialize(); ManualControlCommandInitialize(); ReceiverActivityInitialize(); ManualControlSettingsInitialize(); From 81b9d2e379fbd39b2585ac383f209fdfa447e14e Mon Sep 17 00:00:00 2001 From: Alessio Morale Date: Tue, 24 Feb 2015 22:03:18 +0100 Subject: [PATCH 3/4] OP-1743 - Raise manualcontrol stack --- flight/targets/boards/coptercontrol/firmware/inc/pios_config.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flight/targets/boards/coptercontrol/firmware/inc/pios_config.h b/flight/targets/boards/coptercontrol/firmware/inc/pios_config.h index aabc651a7..4dfec4883 100644 --- a/flight/targets/boards/coptercontrol/firmware/inc/pios_config.h +++ b/flight/targets/boards/coptercontrol/firmware/inc/pios_config.h @@ -162,7 +162,7 @@ /* Task stack sizes */ #define PIOS_ACTUATOR_STACK_SIZE 820 -#define PIOS_MANUAL_STACK_SIZE 635 +#define PIOS_MANUAL_STACK_SIZE 735 #define PIOS_RECEIVER_STACK_SIZE 620 #define PIOS_STABILIZATION_STACK_SIZE 400 From 400a99f365a2fa39b91d382b8ff5e85cf0cda2ab Mon Sep 17 00:00:00 2001 From: Alessio Morale Date: Tue, 24 Feb 2015 22:04:11 +0100 Subject: [PATCH 4/4] missing uncrustification --- ground/openpilotgcs/src/plugins/config/outputchannelform.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ground/openpilotgcs/src/plugins/config/outputchannelform.cpp b/ground/openpilotgcs/src/plugins/config/outputchannelform.cpp index 084693741..ea8636250 100644 --- a/ground/openpilotgcs/src/plugins/config/outputchannelform.cpp +++ b/ground/openpilotgcs/src/plugins/config/outputchannelform.cpp @@ -119,7 +119,7 @@ void OutputChannelForm::enableChannelTest(bool state) ui.actuatorMin->setEnabled(false); ui.actuatorMax->setEnabled(false); ui.actuatorRev->setEnabled(false); - } else if (m_mixerType != "Disabled"){ + } else if (m_mixerType != "Disabled") { ui.actuatorMin->setEnabled(true); ui.actuatorMax->setEnabled(true); if (m_mixerType != "Motor") {