Merge pull request #2972 from martinbudden/bf_blackbox_tidy_function_names

Tidied blackbox function names to have blackbox prefix
This commit is contained in:
Martin Budden 2017-04-28 11:22:16 +01:00 committed by GitHub
commit 4266f15ab6
5 changed files with 17 additions and 18 deletions

View File

@ -787,7 +787,7 @@ static int gcd(int num, int denom)
return gcd(denom, num % denom); return gcd(denom, num % denom);
} }
void validateBlackboxConfig() void blackboxValidateConfig()
{ {
int div; int div;
@ -825,9 +825,9 @@ void validateBlackboxConfig()
/** /**
* Start Blackbox logging if it is not already running. Intended to be called upon arming. * Start Blackbox logging if it is not already running. Intended to be called upon arming.
*/ */
void startBlackbox(void) static void blackboxStart(void)
{ {
validateBlackboxConfig(); blackboxValidateConfig();
if (!blackboxDeviceOpen()) { if (!blackboxDeviceOpen()) {
blackboxSetState(BLACKBOX_STATE_DISABLED); blackboxSetState(BLACKBOX_STATE_DISABLED);
@ -870,7 +870,7 @@ void startBlackbox(void)
/** /**
* Begin Blackbox shutdown. * Begin Blackbox shutdown.
*/ */
void finishBlackbox(void) void blackboxFinish(void)
{ {
switch (blackboxState) { switch (blackboxState) {
case BLACKBOX_STATE_DISABLED: case BLACKBOX_STATE_DISABLED:
@ -903,14 +903,14 @@ void startInTestMode(void)
return; // When in test mode, we cannot share the MSP and serial logger port! return; // When in test mode, we cannot share the MSP and serial logger port!
} }
} }
startBlackbox(); blackboxStart();
startedLoggingInTestMode = true; startedLoggingInTestMode = true;
} }
} }
void stopInTestMode(void) void stopInTestMode(void)
{ {
if(startedLoggingInTestMode) { if(startedLoggingInTestMode) {
finishBlackbox(); blackboxFinish();
startedLoggingInTestMode = false; startedLoggingInTestMode = false;
} }
} }
@ -1484,7 +1484,7 @@ static void blackboxLogIteration(timeUs_t currentTimeUs)
/** /**
* Call each flight loop iteration to perform blackbox logging. * Call each flight loop iteration to perform blackbox logging.
*/ */
void handleBlackbox(timeUs_t currentTimeUs) void blackboxUpdate(timeUs_t currentTimeUs)
{ {
int i; int i;
@ -1492,7 +1492,7 @@ void handleBlackbox(timeUs_t currentTimeUs)
case BLACKBOX_STATE_STOPPED: case BLACKBOX_STATE_STOPPED:
if (ARMING_FLAG(ARMED)) { if (ARMING_FLAG(ARMED)) {
blackboxOpen(); blackboxOpen();
startBlackbox(); blackboxStart();
} }
#ifdef USE_FLASHFS #ifdef USE_FLASHFS
if (IS_RC_MODE_ACTIVE(BOXBLACKBOXERASE)) { if (IS_RC_MODE_ACTIVE(BOXBLACKBOXERASE)) {
@ -1676,7 +1676,7 @@ void handleBlackbox(timeUs_t currentTimeUs)
/** /**
* Call during system startup to initialize the blackbox. * Call during system startup to initialize the blackbox.
*/ */
void initBlackbox(void) void blackboxInit(void)
{ {
if (blackboxConfig()->device) { if (blackboxConfig()->device) {
blackboxSetState(BLACKBOX_STATE_STOPPED); blackboxSetState(BLACKBOX_STATE_STOPPED);

View File

@ -45,10 +45,9 @@ PG_DECLARE(blackboxConfig_t, blackboxConfig);
void blackboxLogEvent(FlightLogEvent event, flightLogEventData_t *data); void blackboxLogEvent(FlightLogEvent event, flightLogEventData_t *data);
void initBlackbox(void); void blackboxInit(void);
void handleBlackbox(timeUs_t currentTimeUs); void blackboxUpdate(timeUs_t currentTimeUs);
void validateBlackboxConfig(); void blackboxValidateConfig();
void startBlackbox(void); void blackboxFinish(void);
void finishBlackbox(void);
bool blackboxMayEditConfig(void); bool blackboxMayEditConfig(void);

View File

@ -178,7 +178,7 @@ static long cmsx_Blackbox_onExit(const OSD_Entry *self)
if (blackboxMayEditConfig()) { if (blackboxMayEditConfig()) {
blackboxConfigMutable()->device = cmsx_BlackboxDevice; blackboxConfigMutable()->device = cmsx_BlackboxDevice;
validateBlackboxConfig(); blackboxValidateConfig();
} }
blackboxConfigMutable()->rate_denom = blackboxConfig_rate_denom; blackboxConfigMutable()->rate_denom = blackboxConfig_rate_denom;
return 0; return 0;

View File

@ -177,7 +177,7 @@ void mwDisarm(void)
#ifdef BLACKBOX #ifdef BLACKBOX
if (blackboxConfig()->device) { if (blackboxConfig()->device) {
finishBlackbox(); blackboxFinish();
} }
#endif #endif
BEEP_OFF; BEEP_OFF;
@ -555,7 +555,7 @@ static void subTaskMainSubprocesses(timeUs_t currentTimeUs)
#ifdef BLACKBOX #ifdef BLACKBOX
if (!cliMode && blackboxConfig()->device) { if (!cliMode && blackboxConfig()->device) {
handleBlackbox(currentTimeUs); blackboxUpdate(currentTimeUs);
} }
#else #else
UNUSED(currentTimeUs); UNUSED(currentTimeUs);

View File

@ -550,7 +550,7 @@ void init(void)
#endif #endif
#ifdef BLACKBOX #ifdef BLACKBOX
initBlackbox(); blackboxInit();
#endif #endif
if (mixerConfig()->mixerMode == MIXER_GIMBAL) { if (mixerConfig()->mixerMode == MIXER_GIMBAL) {