utils: added macro to retrieve the number of elements of an array

This commit is contained in:
Silvano Seva 2025-03-02 18:09:08 +01:00
parent b16c3c0fd1
commit 4515bd9e60
1 changed files with 8 additions and 0 deletions

View File

@ -28,6 +28,14 @@
extern "C" {
#endif
/**
* Get the number of elements of an array.
*
* @param x: array.
* @return number of elements.
*/
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
/**
* This function allows to obtain the value of a given calibration parameter for
* frequencies outside the calibration points. It works by searching the two