Move ARRAY_SIZE macro to misc.h.

This allows reuse in other files.
This commit is contained in:
Wouter van Gulik 2023-09-17 21:10:39 +02:00 committed by Dual Tachyon
parent 8d6cd655dd
commit d935aa9885
2 changed files with 2 additions and 2 deletions

View File

@ -21,8 +21,6 @@
#include "driver/system.h"
#include "misc.h"
#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0]))
static const uint16_t BK1080_RegisterTable[] = {
0x0008, 0x1080, 0x0201, 0x0000,
0x40C0, 0x0A1F, 0x002E, 0x02FF,

2
misc.h
View File

@ -20,6 +20,8 @@
#include <stdbool.h>
#include <stdint.h>
#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0]))
#define IS_MR_CHANNEL(x) ((x) >= MR_CHANNEL_FIRST && (x) <= MR_CHANNEL_LAST)
#define IS_FREQ_CHANNEL(x) ((x) >= FREQ_CHANNEL_FIRST && (x) <= FREQ_CHANNEL_LAST)
#define IS_NOAA_CHANNEL(x) ((x) >= NOAA_CHANNEL_FIRST && (x) <= NOAA_CHANNEL_LAST)