mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-23 16:25:31 +03:00
various: use ARRAYLEN() in more places.
Signed-off-by: Michael Hope <mlhx@google.com>
This commit is contained in:
parent
4ed6fdfea5
commit
b90ccf4c1a
3 changed files with 6 additions and 3 deletions
|
@ -21,6 +21,8 @@
|
||||||
|
|
||||||
#include "platform.h"
|
#include "platform.h"
|
||||||
|
|
||||||
|
#include "common/utils.h"
|
||||||
|
|
||||||
#include "system.h"
|
#include "system.h"
|
||||||
#include "gpio.h"
|
#include "gpio.h"
|
||||||
|
|
||||||
|
@ -56,7 +58,7 @@ void ledInit(void)
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
uint8_t gpio_count = sizeof(gpio_setup) / sizeof(gpio_setup[0]);
|
uint8_t gpio_count = ARRAYLEN(gpio_setup);
|
||||||
|
|
||||||
#ifdef LED0
|
#ifdef LED0
|
||||||
RCC_APB2PeriphClockCmd(LED0_PERIPHERAL, ENABLE);
|
RCC_APB2PeriphClockCmd(LED0_PERIPHERAL, ENABLE);
|
||||||
|
|
|
@ -47,7 +47,7 @@ void ledInit(void)
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
uint8_t gpio_count = sizeof(gpio_setup) / sizeof(gpio_setup[0]);
|
uint8_t gpio_count = ARRAYLEN(gpio_setup);
|
||||||
|
|
||||||
#ifdef LED0
|
#ifdef LED0
|
||||||
RCC_AHBPeriphClockCmd(LED0_PERIPHERAL, ENABLE);
|
RCC_AHBPeriphClockCmd(LED0_PERIPHERAL, ENABLE);
|
||||||
|
|
|
@ -28,6 +28,7 @@
|
||||||
|
|
||||||
#include "common/maths.h"
|
#include "common/maths.h"
|
||||||
#include "common/axis.h"
|
#include "common/axis.h"
|
||||||
|
#include "common/utils.h"
|
||||||
|
|
||||||
#include "drivers/system.h"
|
#include "drivers/system.h"
|
||||||
#include "drivers/serial.h"
|
#include "drivers/serial.h"
|
||||||
|
@ -185,7 +186,7 @@ static void shiftPacketLog(void)
|
||||||
{
|
{
|
||||||
uint32_t i;
|
uint32_t i;
|
||||||
|
|
||||||
for (i = sizeof(gpsPacketLog) - 1; i > 0 ; i--) {
|
for (i = ARRAYLEN(gpsPacketLog) - 1; i > 0 ; i--) {
|
||||||
gpsPacketLog[i] = gpsPacketLog[i-1];
|
gpsPacketLog[i] = gpsPacketLog[i-1];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue