1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-17 05:15:25 +03:00

Failsafe - Remove magic number usage. Cleanup whitespace

This commit is contained in:
Dominic Clifton 2015-08-03 16:58:49 +01:00
parent 8e79a117d1
commit 3436b08575
4 changed files with 20 additions and 17 deletions

View file

@ -567,7 +567,7 @@ static void cliRxFail(char *cmdline)
if (isEmpty(cmdline)) {
// print out rxConfig failsafe settings
for (channel = 0; channel < MAX_SUPPORTED_RC_CHANNEL_COUNT-4; channel++) {
for (channel = 0; channel < MAX_AUX_CHANNEL_COUNT; channel++) {
cliRxFail(itoa(channel, buf, 10));
}
} else {
@ -575,7 +575,7 @@ static void cliRxFail(char *cmdline)
char *ptr = cmdline;
channel = atoi(ptr++);
if ((channel < MAX_SUPPORTED_RC_CHANNEL_COUNT-4)) {
if ((channel < MAX_AUX_CHANNEL_COUNT)) {
ptr = strchr(ptr, ' ');
if (ptr) {
value = atoi(++ptr);
@ -590,9 +590,12 @@ static void cliRxFail(char *cmdline)
// 1. acknowledge interpretation on command,
// 2. query current setting on single item,
// 3. recursive use for full list.
printf("rxfail %u %d\r\n", channel, RXFAIL_STEP_TO_CHANNEL_VALUE(masterConfig.rxConfig.rx_fail_usec_steps[channel]));
printf("rxfail %u %d\r\n",
channel,
RXFAIL_STEP_TO_CHANNEL_VALUE(masterConfig.rxConfig.rx_fail_usec_steps[channel])
);
} else {
printf("channel must be < %u\r\n", MAX_SUPPORTED_RC_CHANNEL_COUNT-4);
printf("channel must be < %u\r\n", MAX_AUX_CHANNEL_COUNT);
}
}
}