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:
- Jump from top menu to sub dialog (e.g. time change menu)
- During jump: Assign current sensor value (in your case RTC value) to "v" (prepare_user_input)
- Let the use change "v" though m2tklib
- If user pressed cancel, go back to main menu without any further action
- If user presse ok, store value of "v" to the external device (e.g. RTC), jump back to main menu (apply_user_input).
Oliver