mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-01-09 20:46:07 +01:00
93b77becc0
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.
73 lines
2.1 KiB
C++
73 lines
2.1 KiB
C++
/**
|
|
******************************************************************************
|
|
*
|
|
* @file configgadgetplugin.h
|
|
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
|
* @addtogroup GCSPlugins GCS Plugins
|
|
* @{
|
|
* @addtogroup ConfigPlugin Config Plugin
|
|
* @{
|
|
* @brief The Configuration Gadget used to update settings in the firmware
|
|
*****************************************************************************/
|
|
/*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation; either version 3 of the License, or
|
|
* (at your option) any later version.
|
|
*
|
|
* This program is distributed in the hope that it will be useful, but
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
|
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
* for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License along
|
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
|
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
*/
|
|
#ifndef CONFIGPLUGIN_H
|
|
#define CONFIGPLUGIN_H
|
|
|
|
#include <extensionsystem/iplugin.h>
|
|
#include <coreplugin/icore.h>
|
|
#include <coreplugin/coreconstants.h>
|
|
#include <coreplugin/actionmanager/actionmanager.h>
|
|
#include "uavtalk/telemetrymanager.h"
|
|
#include "objectpersistence.h"
|
|
|
|
|
|
#include <QMessageBox>
|
|
|
|
|
|
class ConfigGadgetFactory;
|
|
|
|
class ConfigPlugin : public ExtensionSystem::IPlugin
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
ConfigPlugin();
|
|
~ConfigPlugin();
|
|
|
|
UAVObjectManager * getObjectManager();
|
|
void extensionsInitialized();
|
|
bool initialize(const QStringList & arguments, QString * errorString);
|
|
void shutdown();
|
|
|
|
private slots:
|
|
void eraseAllSettings();
|
|
void onAutopilotConnect();
|
|
void onAutopilotDisconnect();
|
|
void eraseDone(UAVObject *);
|
|
void eraseFailed();
|
|
|
|
private:
|
|
ConfigGadgetFactory *cf;
|
|
Core::Command* cmd;
|
|
bool settingsErased;
|
|
|
|
static const int FLASH_ERASE_TIMEOUT_MS = 45000;
|
|
|
|
};
|
|
|
|
#endif // CONFIGPLUGIN_H
|