diff --git a/flight/CopterControl/System/inc/pios_config.h b/flight/CopterControl/System/inc/pios_config.h index 67328c0f8..4362dbca2 100644 --- a/flight/CopterControl/System/inc/pios_config.h +++ b/flight/CopterControl/System/inc/pios_config.h @@ -96,6 +96,7 @@ #define PIOS_STABILIZATION_STACK_SIZE 624 #define PIOS_TELEM_STACK_SIZE 500 +#define IDLE_COUNTS_PER_SEC_AT_NO_LOAD 1995998 //#define PIOS_QUATERNION_STABILIZATION #endif /* PIOS_CONFIG_H */ diff --git a/flight/Modules/System/systemmod.c b/flight/Modules/System/systemmod.c index 6c5a72d16..1cc3a6a5b 100644 --- a/flight/Modules/System/systemmod.c +++ b/flight/Modules/System/systemmod.c @@ -52,9 +52,12 @@ // Private constants #define SYSTEM_UPDATE_PERIOD_MS 1000 #define LED_BLINK_RATE_HZ 5 + +#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. +#endif #if defined(PIOS_MANUAL_STACK_SIZE) #define STACK_SIZE_BYTES PIOS_MANUAL_STACK_SIZE