1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-02-21 11: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 "taskinfo.h"
#include "watchdogstatus.h" #include "watchdogstatus.h"
#include "taskmonitor.h" #include "taskmonitor.h"
#include "hwsettings.h"
//#define DEBUG_THIS_FILE //#define DEBUG_THIS_FILE
@ -90,6 +91,7 @@ static bool mallocFailed;
// Private functions // Private functions
static void objectUpdatedCb(UAVObjEvent * ev); static void objectUpdatedCb(UAVObjEvent * ev);
static void configurationUpdatedCb(UAVObjEvent * ev); static void configurationUpdatedCb(UAVObjEvent * ev);
static void hwSettingsUpdatedCb(UAVObjEvent * ev);
static void updateStats(); static void updateStats();
static void updateSystemAlarms(); static void updateSystemAlarms();
static void systemTask(void *parameters); 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 // Whenever the configuration changes, make sure it is safe to fly
SystemSettingsConnectCallback(configurationUpdatedCb); SystemSettingsConnectCallback(configurationUpdatedCb);
ManualControlSettingsConnectCallback(configurationUpdatedCb); ManualControlSettingsConnectCallback(configurationUpdatedCb);
HwSettingsConnectCallback(hwSettingsUpdatedCb);
// Main system loop // Main system loop
while (1) { while (1) {
@ -325,6 +328,14 @@ static void configurationUpdatedCb(UAVObjEvent * ev)
configuration_check(); 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 * Called periodically to update the I2C statistics
*/ */