}
if (current_entry >= NB_MENU) {
current_entry = 1;
- } else if (current_entry == 0) {
+ } else if (current_entry == 0) { /* For this one, first menu_title is "config" */
current_entry = NB_MENU - 1;
}
/* Enter sub-menu */
if (button & BUTTON_DOWN) {
auto_force_cur_entry += 1;
}
- if (auto_force_cur_entry >= AUTO_FORCE_NB_MENU) {
- auto_force_cur_entry = 0;
- } else if (auto_force_cur_entry == 0xFF) {
+ if (auto_force_cur_entry == 0xFF) {
auto_force_cur_entry = AUTO_FORCE_NB_MENU - 1;
+ } else if (auto_force_cur_entry >= AUTO_FORCE_NB_MENU) {
+ auto_force_cur_entry = 0;
}
if (button & (BUTTON_OK | BUTTON_RIGHT)) {
auto_force_cur_menu = auto_force_cur_entry;
if (button & BUTTON_DOWN) {
manual_force_cur_entry += 1;
}
- if (manual_force_cur_entry >= MANUAL_FORCE_NB_MENU) {
- manual_force_cur_entry = 0;
- } else if (manual_force_cur_entry == 0xFF) {
+ if (manual_force_cur_entry == 0xFF) {
manual_force_cur_entry = MANUAL_FORCE_NB_MENU - 1;
+ } else if (manual_force_cur_entry >= MANUAL_FORCE_NB_MENU) {
+ manual_force_cur_entry = 0;
}
if (button & (BUTTON_OK | BUTTON_RIGHT)) {
manual_force_cur_menu = manual_force_cur_entry;
if (button & BUTTON_DOWN) {
conf_cur_entry += 1;
}
- if (conf_cur_entry >= CONF_NB_MENU) {
- conf_cur_entry = 0;
- } else if (conf_cur_entry == 0xFF) {
+ if (conf_cur_entry == 0xFF) {
conf_cur_entry = CONF_NB_MENU - 1;
+ } else if (conf_cur_entry >= CONF_NB_MENU) {
+ conf_cur_entry = 0;
}
if (button & (BUTTON_OK | BUTTON_RIGHT)) {
conf_cur_menu = conf_cur_entry;