1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-02-19 09:54:15 +01:00

Rise Botfault error whenever hwsettings has been changed but no reboot took place yet

This commit is contained in:
Corvus Corax 2012-11-11 17:23:07 +01:00
parent 9151e5cded
commit d1447ca3f8

View File

@ -50,6 +50,7 @@
#include "taskinfo.h"
#include "watchdogstatus.h"
#include "taskmonitor.h"
#include "hwsettings.h"
//#define DEBUG_THIS_FILE
@ -90,6 +91,7 @@ static bool mallocFailed;
// Private functions
static void objectUpdatedCb(UAVObjEvent * ev);
static void configurationUpdatedCb(UAVObjEvent * ev);
static void hwSettingsUpdatedCb(UAVObjEvent * ev);
static void updateStats();
static void updateSystemAlarms();
static void systemTask(void *parameters);
@ -178,6 +180,7 @@ static void systemTask(void *parameters)
// Whenever the configuration changes, make sure it is safe to fly
SystemSettingsConnectCallback(configurationUpdatedCb);
ManualControlSettingsConnectCallback(configurationUpdatedCb);
HwSettingsConnectCallback(hwSettingsUpdatedCb);
// Main system loop
while (1) {
@ -325,6 +328,14 @@ static void configurationUpdatedCb(UAVObjEvent * ev)
configuration_check();
}
/**
* Called whenever hardware settings changed
*/
static void hwSettingsUpdatedCb(UAVObjEvent * ev)
{
AlarmsSet(SYSTEMALARMS_ALARM_BOOTFAULT,SYSTEMALARMS_ALARM_ERROR);
}
/**
* Called periodically to update the I2C statistics
*/