Menu for Display

Hi
Passing a variable to M2tklib is (somehow) automatic. During definition of an element, such as M2_U8NUM, you pass a pointer to a variable:

uint8_t v;
M2_U8NUM(el_num, "", 0, 255, &v);

Variable "v" is connected to M2tklib. M2tklib will ALWAYS display the value of v. At any time you may assign a value to "v" and after the next call to the "draw" procedure it will display the current content of "v"
Controll flow would be:

  1. Jump from top menu to sub dialog (e.g. time change menu)
  2. During jump: Assign current sensor value (in your case RTC value) to "v" (prepare_user_input)
  3. Let the use change "v" though m2tklib
  4. If user pressed cancel, go back to main menu without any further action
  5. If user presse ok, store value of "v" to the external device (e.g. RTC), jump back to main menu (apply_user_input).

Oliver