Skip to content

Commit

Permalink
solved a bug in the submenu selection
Browse files Browse the repository at this point in the history
  • Loading branch information
MikyM0use authored and MikyM0use committed Jul 17, 2016
1 parent 814543f commit bd71157
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 27 deletions.
2 changes: 1 addition & 1 deletion jafar_sketch/const.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ This file is part of Fatshark© goggle rx module project (JAFaR).
#define LOOPTIME 1000
#endif

#define TIMER_INIT_VALUE 9.0
#define TIMER_INIT_VALUE 6.0
#define CH1 2
#define CH2 3
#define CH3 4
Expand Down
2 changes: 1 addition & 1 deletion jafar_sketch/jafar_osd.ino
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ void osd_mainmenu(uint8_t menu_pos) {
}

void osd_scanner() {
uint8_t s_timer = 9;
uint8_t s_timer = 5;
while (s_timer-- > 0) {
rx5808.scan(1, BIN_H);
TV.clear_screen();
Expand Down
52 changes: 27 additions & 25 deletions jafar_sketch/jafar_sketch.ino
Original file line number Diff line number Diff line change
Expand Up @@ -152,18 +152,19 @@ void loop(void) {
last_post_switch = menu_pos;

if (timer <= 0) { //end of time for selection
switch (menu_pos) {
case 0: //LAST USED
set_and_wait(last_used_band, last_used_freq_id);
break;
case 6: //SCANNER
scanner_mode();
break;
case 7: //AUTOSCAN
autoscan();
break;
default:
if (in_mainmenu) { //switch from menu to submenu (band -> frequency)

if (in_mainmenu) { //switch from menu to submenu (band -> frequency)
switch (menu_pos) {
case 0: //LAST USED
set_and_wait(last_used_band, last_used_freq_id);
break;
case 6: //SCANNER
scanner_mode();
break;
case 7: //AUTOSCAN
autoscan();
break;
default:
in_mainmenu = 0;
menu_band = menu_pos - 1;
timer = TIMER_INIT_VALUE;
Expand All @@ -173,26 +174,27 @@ void loop(void) {
#else
TV.delay(200);
#endif //OLED
break;
} //switch
} else { //if in submenu

} else { //after selection of band AND freq by the user

//please wait message
#ifdef USE_DIVERSITY
#ifdef USE_OLED
oled_waitmessage();
delay(800);
oled_waitmessage(); //please wait message
delay(800);
#else
osd_waitmessage() ;
TV.delay(800);
osd_waitmessage() ;
TV.delay(100);
#endif //OLED
#endif //DIVERSITY
set_and_wait(menu_band, menu_pos);
timer = 0;
}
break;
}
}

//after selection of band AND freq by the user
set_and_wait(menu_band, menu_pos);
timer = 0;
} //else
} //timer

//time still running
if (in_mainmenu) { //on main menu
#ifdef USE_OLED
oled_mainmenu(menu_pos);
Expand Down

0 comments on commit bd71157

Please sign in to comment.