int help_section;
int ui_language;
unsigned int ui_idlecount;
+unsigned char scanflag;
int recv_signal;
int backlight_counter;
}
}
+static void update_status(void)
+{
+#ifndef _LCD_DEBUG
+ recv_signal = akc6955_read_level();
+ if(fm != 0){
+ fmfreq = akc6955_get_freq();
+ } else {
+ amfreq = akc6955_get_freq();
+ }
+#endif
+
+}
+
void update_display(void)
{
if(fm != 0){ // FM
print_numeric(recv_signal, 0xff);
}
+void scan_start()
+{
+ unsigned char input_flag;
+ unsigned char c;
+
+ do {
+ if(scanflag == 0){
+ // New Scan
+ _CLS();
+ printstr("Scan A=ABORT");
+ _LOCATE(0,1);
+ printstr("U=6, D=4");
+ do {
+ input_flag = readkey_compare();
+ idle(0xff80);
+ } while(input_flag == 0);
+ c = pop_keyinfifo();
+ if(c == charcode_6){
+ akc6955_do_scan(0xff);
+ } else if(c == charcode_4){
+ akc6955_do_scan(0);
+ } else {
+ break;
+ }
+ scanflag = 0xff;
+ } else {
+ do {
+ input_flag = readkey_compare();
+ idle(0xff80);
+ } while(input_flag == 0);
+ c = pop_keyinfifo();
+
+ if(c == charcode_a){
+ akc6955_abort_scan();
+ break;
+ } else if(c == charcode_4){
+ akc6955_abort_scan();
+ akc6955_do_scan(0);
+ continue;
+ } else if(c == charcode_6){
+ akc6955_abort_scan();
+ akc6955_do_scan(0xff);
+ continue;
+ }
+ if(akc6955_chk_donescan() != 0) break;
+ }
+ idle(0xff00);
+ } while(1);
+ scanflag=0;
+ _CLS();
+ update_status();
+ update_display();
+}
void setfreq_direct(void)
{
val = read_numeric(val, 5, 7, 1);
fmfreq = val;
akc6955_set_freq(val);
- idle(0xff00);
- fmfreq = akc6955_get_freq();
} else {
// FM
_LOCATE(0,0);
val = read_numeric(val, 5, 7, 1);
amfreq = val;
akc6955_set_freq(val);
- idle(0xff00);
- amfreq = akc6955_get_freq();
}
+ idle(0xff00);
+ update_status();
+ update_display();
}
void setband_direct(void)
akc6955_set_fmband(band);
akc6955_do_tune();
idle(0xff00);
- fmfreq = akc6955_get_freq();
} else {
printstr("Set Band:AM");
band = amband & 0x1f;
band = read_numeric(band, 2, 7, 1);
akc6955_set_amband(band);
akc6955_do_tune();
- idle(0xff00);
- amfreq = akc6955_get_freq();
}
+ idle(0xff00);
+ update_status();
+ update_display();
}
void call_userband(unsigned char num)
akc6955_set_userband(am_usrbands[num].start, am_usrbands[num].stop, ch,
am_usrbands[num].mode3k);
}
+ if(fm != 0) {
+ fmband = AKC6955_BAND_AMUSER;
+ } else {
+ amband = AKC6955_BAND_AMUSER;
+ }
+ idle(0xff00);
+ update_status();
+ update_display();
}
void set_userband(void)
void setfreq_updown(unsigned char ctlword)
{
- unsigned char c;
#ifndef _LCD_DEBUG
switch(ctlword){
case charcode_8: // Change band
{
char readchar;
unsigned char input_flag;
- char i;
unsigned char c;
#ifdef _LCD_DEBUG
unsigned char power_flag;
switch(load_eeprom()) {
case 0x01: // No magic-word
- idle(0xff00);
+ idle(0xff80);
_CLS();
setdefault();
_LOCATE(0,0);
// Init AKC6955
/* Check EEPROM */
/* Push default parameters to AKC6955*/
-
+ scanflag = 0;
#ifndef _LCD_DEBUG
akc6955_chg_fm(fm); // Set to AM
akc6955_set_amband(amband);
idle(0xff00);
#endif
_CLS();
+ update_status();
update_display();
do {
/* Main routine*/
// Other is skip
}
}
-#ifndef _LCD_DEBUG
- recv_signal = akc6955_read_level();
- if(fm != 0){
- fmfreq = akc6955_get_freq();
- } else {
- amfreq = akc6955_get_freq();
- }
-#endif
// Check battery (include idle?)
// Read AKJC6955's status
// Putstring to LCD.