diff --git a/flight/Libraries/alarms.c b/flight/Libraries/alarms.c index 94a1006ef..e0da51185 100644 --- a/flight/Libraries/alarms.c +++ b/flight/Libraries/alarms.c @@ -157,8 +157,7 @@ int32_t AlarmsDefault(SystemAlarmsAlarmElem alarm) */ void AlarmsDefaultAll() { - uint32_t n; - for (n = 0; n < SYSTEMALARMS_ALARM_NUMELEM; ++n) { + for (uint32_t n = 0; n < SYSTEMALARMS_ALARM_NUMELEM; ++n) { AlarmsDefault(n); } } @@ -182,8 +181,7 @@ int32_t AlarmsClear(SystemAlarmsAlarmElem alarm) */ void AlarmsClearAll() { - uint32_t n; - for (n = 0; n < SYSTEMALARMS_ALARM_NUMELEM; ++n) { + for (uint32_t n = 0; n < SYSTEMALARMS_ALARM_NUMELEM; ++n) { AlarmsClear(n); } } @@ -224,7 +222,6 @@ int32_t AlarmsHasCritical() static int32_t hasSeverity(SystemAlarmsAlarmOptions severity) { SystemAlarmsData alarms; - uint32_t n; // Lock xSemaphoreTakeRecursive(lock, portMAX_DELAY); @@ -233,7 +230,7 @@ static int32_t hasSeverity(SystemAlarmsAlarmOptions severity) SystemAlarmsGet(&alarms); // Go through alarms and check if any are of the given severity or higher - for (n = 0; n < SYSTEMALARMS_ALARM_NUMELEM; ++n) { + for (uint32_t n = 0; n < SYSTEMALARMS_ALARM_NUMELEM; ++n) { if (alarms.Alarm[n] >= severity) { xSemaphoreGiveRecursive(lock); return 1; @@ -244,8 +241,8 @@ static int32_t hasSeverity(SystemAlarmsAlarmOptions severity) xSemaphoreGiveRecursive(lock); return 0; } + /** * @} * @} */ - diff --git a/flight/Modules/System/systemmod.c b/flight/Modules/System/systemmod.c index 5de110488..4b8cc6772 100644 --- a/flight/Modules/System/systemmod.c +++ b/flight/Modules/System/systemmod.c @@ -39,8 +39,10 @@ */ #include + // private includes #include "inc/systemmod.h" + // UAVOs #include #include @@ -51,6 +53,7 @@ #include #include #include + // Flight Libraries #include @@ -69,8 +72,8 @@ #ifndef IDLE_COUNTS_PER_SEC_AT_NO_LOAD #define IDLE_COUNTS_PER_SEC_AT_NO_LOAD 995998 // calibrated by running tests/test_cpuload.c - // must be updated if the FreeRTOS or compiler - // optimisation options are changed. + // must be updated if the FreeRTOS or compiler + // optimisation options are changed. #endif #if defined(PIOS_SYSTEM_STACK_SIZE) @@ -177,8 +180,8 @@ static void systemTask(void *parameters) // Listen for SettingPersistance object updates, connect a callback function ObjectPersistenceConnectQueue(objectPersistenceQueue); - // Load a copy of HwSetting active at boot time - HwSettingsGet(&bootHwSettings); + // Load a copy of HwSetting active at boot time + HwSettingsGet(&bootHwSettings); // Whenever the configuration changes, make sure it is safe to fly HwSettingsConnectCallback(hwSettingsUpdatedCb); @@ -314,7 +317,7 @@ static void objectUpdatedCb(UAVObjEvent * ev) #if defined(PIOS_INCLUDE_FLASH_SECTOR_SETTINGS) retval = PIOS_FLASHFS_Format(0); #else - retval = -1; + retval = -1; #endif } switch(retval) {