mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-01-29 14:52:12 +01:00
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.
This commit is contained in:
parent
6f09b6d087
commit
93b77becc0
@ -65,7 +65,7 @@
|
||||
#define STACK_SIZE_BYTES 924
|
||||
#endif
|
||||
|
||||
#define TASK_PRIORITY (tskIDLE_PRIORITY+2)
|
||||
#define TASK_PRIORITY (tskIDLE_PRIORITY+1)
|
||||
|
||||
// Private types
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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."));
|
||||
|
@ -65,6 +65,8 @@ private slots:
|
||||
Core::Command* cmd;
|
||||
bool settingsErased;
|
||||
|
||||
static const int FLASH_ERASE_TIMEOUT_MS = 45000;
|
||||
|
||||
};
|
||||
|
||||
#endif // CONFIGPLUGIN_H
|
||||
|
Loading…
x
Reference in New Issue
Block a user