From f9dc3b1f89b6504e503d930352f77c0e7af91651 Mon Sep 17 00:00:00 2001 From: James Cotton Date: Sun, 10 Jun 2012 14:40:50 -0500 Subject: [PATCH 1/5] Enable simposix on next for linux only. Keeps all_flight building on all platforms --- Makefile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 67571d3f8..8a55572e8 100644 --- a/Makefile +++ b/Makefile @@ -630,7 +630,7 @@ all_$(1)_clean: $$(addsuffix _clean, $$(filter bu_$(1), $$(BU_TARGETS))) all_$(1)_clean: $$(addsuffix _clean, $$(filter ef_$(1), $$(EF_TARGETS))) endef -ALL_BOARDS := coptercontrol pipxtreme +ALL_BOARDS := coptercontrol pipxtreme simposix # Friendly names of each board (used to find source tree) coptercontrol_friendly := CopterControl @@ -638,6 +638,12 @@ pipxtreme_friendly := PipXtreme revolution_friendly := Revolution simposix_friendly := SimPosix +# SimPosix only builds on Linux so drop it from the list for +# all other platforms. +ifneq ($(UNAME), Linux) +ALL_BOARDS := $(filter-out simposix, $(ALL_BOARDS)) +endif + # Start out assuming that we'll build fw, bl and bu for all boards FW_BOARDS := $(ALL_BOARDS) BL_BOARDS := $(ALL_BOARDS) From 6f09b6d087585cf9bc039ab2fb3f0658e8e9b24a Mon Sep 17 00:00:00 2001 From: James Cotton Date: Mon, 11 Jun 2012 11:21:08 -0500 Subject: [PATCH 2/5] Fix misnamed slot in the output widget --- ground/openpilotgcs/src/plugins/config/configoutputwidget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ground/openpilotgcs/src/plugins/config/configoutputwidget.cpp b/ground/openpilotgcs/src/plugins/config/configoutputwidget.cpp index ca9a6dcc4..506c7bdec 100644 --- a/ground/openpilotgcs/src/plugins/config/configoutputwidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configoutputwidget.cpp @@ -79,7 +79,7 @@ ConfigOutputWidget::ConfigOutputWidget(QWidget *parent) : ConfigTaskWidget(paren connect(m_config->outputHelp, SIGNAL(clicked()), this, SLOT(openHelp())); // Add custom handling of displaying things - connect(this,SIGNAL(refreshWidgetsValuesRequested()), this, SLOT(refreshOutputWidgetsValues())); + connect(this,SIGNAL(refreshWidgetsValuesRequested()), this, SLOT(refreshWidgetsValues())); addApplySaveButtons(m_config->saveRCOutputToRAM,m_config->saveRCOutputToSD); From 93b77becc0a926c83a5426e8074c400f27b474fa Mon Sep 17 00:00:00 2001 From: James Cotton Date: Mon, 11 Jun 2012 11:48:05 -0500 Subject: [PATCH 3/5] More the system task priority down and increase the timeout for erasing the flash so it says completed. However, it still blocks the system for a long time. During an erase the heartbeat will flash at 10 Hz to indicate what's happening. This still blocks telemetry even after lowering hte system priority (and there is a vTaskDelay) which makes me think that the SPI bus being locked is blocking Sensors or somethign else. This should not be permited when the system is armed. The reason the system locks up during the erase is that the file system operations occur within the event dispatcher thread. It is very bad practice for anything to block this (i.e. callbacks should never take very long). We should probably move the object persistence handling into the system thread or something but that can be a separate issue. --- flight/Modules/System/systemmod.c | 2 +- flight/PiOS/Common/pios_flash_jedec.c | 6 +++++- ground/openpilotgcs/src/plugins/config/configplugin.cpp | 6 +++--- ground/openpilotgcs/src/plugins/config/configplugin.h | 2 ++ 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/flight/Modules/System/systemmod.c b/flight/Modules/System/systemmod.c index 1217ea99f..827b264d2 100644 --- a/flight/Modules/System/systemmod.c +++ b/flight/Modules/System/systemmod.c @@ -65,7 +65,7 @@ #define STACK_SIZE_BYTES 924 #endif -#define TASK_PRIORITY (tskIDLE_PRIORITY+2) +#define TASK_PRIORITY (tskIDLE_PRIORITY+1) // Private types diff --git a/flight/PiOS/Common/pios_flash_jedec.c b/flight/PiOS/Common/pios_flash_jedec.c index b6f1ec930..997bd5403 100644 --- a/flight/PiOS/Common/pios_flash_jedec.c +++ b/flight/PiOS/Common/pios_flash_jedec.c @@ -329,10 +329,14 @@ int32_t PIOS_Flash_Jedec_EraseChip() PIOS_Flash_Jedec_ReleaseBus(); // Keep polling when bus is busy too + int i = 0; while(PIOS_Flash_Jedec_Busy() != 0) { -#if defined(FLASH_FREERTOS) +#if defined(PIOS_INCLUDE_FREERTOS) vTaskDelay(1); #endif + if ((i++) % 100 == 0) + PIOS_LED_Toggle(PIOS_LED_HEARTBEAT); + } return 0; diff --git a/ground/openpilotgcs/src/plugins/config/configplugin.cpp b/ground/openpilotgcs/src/plugins/config/configplugin.cpp index 622b3db9b..30418094c 100644 --- a/ground/openpilotgcs/src/plugins/config/configplugin.cpp +++ b/ground/openpilotgcs/src/plugins/config/configplugin.cpp @@ -145,7 +145,7 @@ void ConfigPlugin::eraseAllSettings() // based on UAVO meta data objper->setData(data); objper->updated(); - QTimer::singleShot(6000,this,SLOT(eraseFailed())); + QTimer::singleShot(FLASH_ERASE_TIMEOUT_MS,this,SLOT(eraseFailed())); } @@ -163,7 +163,7 @@ void ConfigPlugin::eraseFailed() data.Selection = ObjectPersistence::SELECTION_ALLSETTINGS; objper->setData(data); objper->updated(); - QTimer::singleShot(1500,this,SLOT(eraseFailed())); + QTimer::singleShot(FLASH_ERASE_TIMEOUT_MS,this,SLOT(eraseFailed())); } else { disconnect(objper, SIGNAL(objectUpdated(UAVObject*)), this, SLOT(eraseDone(UAVObject *))); QMessageBox msgBox; @@ -190,7 +190,7 @@ void ConfigPlugin::eraseDone(UAVObject * obj) if (data.Operation == ObjectPersistence::OPERATION_COMPLETED) { settingsErased = true; msgBox.setText(tr("Settings are now erased.")); - msgBox.setInformativeText(tr("Please now power-cycle your board to complete reset.")); + msgBox.setInformativeText(tr("Please wait for the status LED to begin flashing regularly (up to a minute) then power-cycle your board to complete reset.")); } else { msgBox.setText(tr("Error trying to erase settings.")); msgBox.setInformativeText(tr("Power-cycle your board after removing all blades. Settings might be inconsistent.")); diff --git a/ground/openpilotgcs/src/plugins/config/configplugin.h b/ground/openpilotgcs/src/plugins/config/configplugin.h index 7091ad460..d0d6ec09a 100644 --- a/ground/openpilotgcs/src/plugins/config/configplugin.h +++ b/ground/openpilotgcs/src/plugins/config/configplugin.h @@ -65,6 +65,8 @@ private slots: Core::Command* cmd; bool settingsErased; + static const int FLASH_ERASE_TIMEOUT_MS = 45000; + }; #endif // CONFIGPLUGIN_H From dba47a7d4188bb21087e96bf03f0b9426eb48b2a Mon Sep 17 00:00:00 2001 From: James Cotton Date: Mon, 11 Jun 2012 13:22:37 -0500 Subject: [PATCH 4/5] Remove the connection to refreshWidgetValues() in output widget. Mike was right and it's not needed since hte configTaskWidget takes care of this connection. --- .../openpilotgcs/src/plugins/config/configoutputwidget.cpp | 7 ------- .../openpilotgcs/src/plugins/config/configoutputwidget.h | 2 -- 2 files changed, 9 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/config/configoutputwidget.cpp b/ground/openpilotgcs/src/plugins/config/configoutputwidget.cpp index 506c7bdec..9b3e6e01b 100644 --- a/ground/openpilotgcs/src/plugins/config/configoutputwidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configoutputwidget.cpp @@ -71,16 +71,10 @@ ConfigOutputWidget::ConfigOutputWidget(QWidget *parent) : ConfigTaskWidget(paren connect(m_config->channelOutTest, SIGNAL(toggled(bool)), this, SLOT(runChannelTests(bool))); - - firstUpdate = true; - // Configure the task widget // Connect the help button connect(m_config->outputHelp, SIGNAL(clicked()), this, SLOT(openHelp())); - // Add custom handling of displaying things - connect(this,SIGNAL(refreshWidgetsValuesRequested()), this, SLOT(refreshWidgetsValues())); - addApplySaveButtons(m_config->saveRCOutputToRAM,m_config->saveRCOutputToSD); // Track the ActuatorSettings object @@ -125,7 +119,6 @@ ConfigOutputWidget::~ConfigOutputWidget() */ void ConfigOutputWidget::runChannelTests(bool state) { - qDebug()<<"configoutputwidget runChannelTests"<getData(); diff --git a/ground/openpilotgcs/src/plugins/config/configoutputwidget.h b/ground/openpilotgcs/src/plugins/config/configoutputwidget.h index 5ccf58206..9a347d3f9 100644 --- a/ground/openpilotgcs/src/plugins/config/configoutputwidget.h +++ b/ground/openpilotgcs/src/plugins/config/configoutputwidget.h @@ -63,8 +63,6 @@ private: UAVObject::Metadata accInitialData; - bool firstUpdate; - bool wasItMe; private slots: void stopTests(); From 9870abcd2f1338765f8c766d0220d174c709e91d Mon Sep 17 00:00:00 2001 From: James Cotton Date: Mon, 11 Jun 2012 11:30:16 -0500 Subject: [PATCH 5/5] Fix some slots in config revo calibration --- ground/openpilotgcs/src/plugins/config/configrevowidget.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/config/configrevowidget.cpp b/ground/openpilotgcs/src/plugins/config/configrevowidget.cpp index 61e0eacd0..77cbeb5db 100644 --- a/ground/openpilotgcs/src/plugins/config/configrevowidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configrevowidget.cpp @@ -204,14 +204,13 @@ ConfigRevoWidget::ConfigRevoWidget(QWidget *parent) : mag_z->setTransform(QTransform::fromScale(1,0),true); // Connect the signals - connect(m_ui->ahrsCalibStart, SIGNAL(clicked()), this, SLOT(measureNoise())); connect(m_ui->accelBiasStart, SIGNAL(clicked()), this, SLOT(launchAccelBiasCalibration())); RevoCalibration * revoCalibration = RevoCalibration::GetInstance(getObjectManager()); Q_ASSERT(revoCalibration); connect(revoCalibration, SIGNAL(objectUpdated(UAVObject*)), this, SLOT(refreshValues())); - connect(m_ui->ahrsSettingsSaveRAM, SIGNAL(clicked()), this, SLOT(SettingsToRam())); + connect(m_ui->ahrsSettingsSaveRAM, SIGNAL(clicked()), this, SLOT(SettingsToRAM())); connect(m_ui->ahrsSettingsSaveSD, SIGNAL(clicked()), this, SLOT(SettingsToFlash())); connect(m_ui->sixPointsStart, SIGNAL(clicked()), this, SLOT(sixPointCalibrationMode())); connect(m_ui->sixPointsSave, SIGNAL(clicked()), this, SLOT(savePositionData()));