AP_Menu: use ARRAY_SIZE macro

This commit is contained in:
Lucas De Marchi 2015-07-20 16:53:47 -03:00 committed by Randy Mackay
parent 0471de2342
commit fdc6a75124
1 changed files with 2 additions and 2 deletions

View File

@ -168,10 +168,10 @@ private:
/// ///
#define MENU(name, prompt, commands) \ #define MENU(name, prompt, commands) \
static const char __menu_name__ ## name[] PROGMEM = prompt; \ static const char __menu_name__ ## name[] PROGMEM = prompt; \
static Menu name(__menu_name__ ## name, commands, sizeof(commands) / sizeof(commands[0])) static Menu name(__menu_name__ ## name, commands, ARRAY_SIZE(commands))
#define MENU2(name, prompt, commands, preprompt) \ #define MENU2(name, prompt, commands, preprompt) \
static const char __menu_name__ ## name[] PROGMEM = prompt; \ static const char __menu_name__ ## name[] PROGMEM = prompt; \
static Menu name(__menu_name__ ## name, commands, sizeof(commands) / sizeof(commands[0]), preprompt) static Menu name(__menu_name__ ## name, commands, ARRAY_SIZE(commands), preprompt)
#endif // __AP_COMMON_MENU_H__ #endif // __AP_COMMON_MENU_H__