Skip to content

call to sub function problem #198

Answered by forntoh
kurt48kr asked this question in Q&A
Discussion options

You must be logged in to vote

It's always best to declare all your functions before you define them. See this

So please declare all the functions before MAIN_MENU as such:

void myCallbackFunction();
void calcVoltage();

MAIN_MENU(
  // ...
)

// ...


void myCallbackFunction() {
  // ...
}

void calcVoltage() {
  // ...
}

is it possible to nest a SUB_MENU in a SUBMENU??

Yes it is possible.

Example:

extern MenuItem* settingsMenu[];
extern MenuItem* subSettingsMenu[];

MAIN_MENU(
    ITEM_BASIC("Placeholder 1"),
    ITEM_SUBMENU("Settings", settingsMenu));

SUB_MENU(
    settingsMenu,
    mainMenu, // Parent menu
    ITEM_SUBMENU("Sub settings menu", subSettingsMenu),
    ITEM_BASIC("Placeholder 2"));

SUB_MENU(
    s…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@kurt48kr
Comment options

Answer selected by forntoh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants