diff --git a/Makefile b/Makefile index c2bfb4a..4eaf747 100644 --- a/Makefile +++ b/Makefile @@ -302,7 +302,7 @@ clean: rm -f -rf build/tinySA4.* build/lst/*.* build/obj/*.* else clean: - rm -f -rf build/$(PROJECT).* + rm -f -rf build/$(PROJECT).* build/lst/*.* build/obj/*.* endif flash: build/$(PROJECT).bin diff --git a/ui.c b/ui.c index 1cbf51f..bb95617 100644 --- a/ui.c +++ b/ui.c @@ -1201,6 +1201,8 @@ draw_menu_buttons(const menuitem_t *menu, uint32_t mask) ui_button_t button; const menuitem_t *m = menu; int sub_item = 0; +// while (menuDisabled(m->type)) +// m = menu_next_item(m, &sub_item); // Just in case the first item is disabled for (i = 0, y = 0; m; m = menu_next_item(m, &sub_item), i++, y += menu_button_height) { if ((mask&(1<type)) +// m = menu_next_item(m, &sub_item); // Just in case the first item is disabled for (i = 0; m; m = menu_next_item(m,&sub_item), i++, y+= menu_button_height) { if (MT_MASK(m->type) == MT_TITLE) continue; if (y < touch_y && touch_y < y+menu_button_height && touch_x > active_button_start) { diff --git a/ui_sa.c b/ui_sa.c index 1021ac8..3a3e254 100644 --- a/ui_sa.c +++ b/ui_sa.c @@ -1840,10 +1840,21 @@ static UI_FUNCTION_ADV_CALLBACK(menu_atten_acb) (void)item; (void)data; if(b){ - b->icon = setting.auto_attenuation ? BUTTON_ICON_GROUP_CHECKED : BUTTON_ICON_GROUP; + if (MODE_HIGH(setting.mode)) { + b->param_1.text = "0dB"; + b->icon = (setting.atten_step*30 == data) ? BUTTON_ICON_GROUP_CHECKED : BUTTON_ICON_GROUP; + } + else { + b->param_1.text = "AUTO"; + b->icon = setting.auto_attenuation ? BUTTON_ICON_GROUP_CHECKED : BUTTON_ICON_GROUP; + } return; } - set_auto_attenuation(); + if (MODE_HIGH(setting.mode)) { + setting.auto_attenuation = false; + set_attenuation(0); + } else + set_auto_attenuation(); menu_move_back(true); } @@ -2866,9 +2877,9 @@ static const menuitem_t menu_reffer[] = { }; static const menuitem_t menu_atten[] = { - { MT_ADV_CALLBACK | MT_LOW, 0, "AUTO", menu_atten_acb}, + { MT_ADV_CALLBACK, 0, "%s", menu_atten_acb}, { MT_KEYPAD | MT_LOW, KM_ATTENUATION, "MANUAL\n\b%s", "0 - 30dB"}, - { MT_ADV_CALLBACK | MT_HIGH,0, "0dB", menu_atten_high_acb}, +// { MT_ADV_CALLBACK | MT_HIGH,0, "0dB", menu_atten_high_acb}, { MT_ADV_CALLBACK | MT_HIGH,30, "22.5 - 40dB", menu_atten_high_acb}, { MT_FORM | MT_NONE, 0, NULL, menu_back} // next-> menu_back };