Beispiel #1
0
void idle_mode(void)
{
    u8 key;
//deg_str("idle_mode \n");

    //dac_out_select(DAC_MUSIC, 0);
    //clear_all_event();
    dac_mute_control(1,1);    
#ifdef PLAY_STATUS_LED_FUNC
    set_play_status_led_spark(PLED_OFF);
#endif	
    KT_AMFMStandby();
    usb_suspend();
	
    flush_all_msg();
    disp_port(MENU_POWER_OFF);
    input_number_en=0;
    vol_change_en=0;

#ifdef DEFAULT_VOL
    sys_main_vol=DEFAULT_VOL;
#endif
    delay_10ms(20);

#ifdef SYS_SOFT_WARE_GOIN_STANDBY
    if(sys_pwr_flag==0){
		put_msg_fifo(MSG_SYS_CORE_SLEEP);		
    }
#endif	
   while (1)
    {
        key = app_get_msg();

        switch (key)
        {
#ifdef SYS_SOFT_WARE_GOIN_STANDBY        
        case MSG_SYS_CORE_SLEEP:
    		core_power_off();			
		break;
#endif		
        case MSG_CHANGE_WORK_MODE:
	     	clear_all_event();
    	     	flush_all_msg();
            	return;
        case MSG_MUSIC_NEW_DEVICE_IN:							//有新设备接入
	 	break;
        default:
            	ap_handle_hotkey(key);        
            	break;
        }
    }
}
Beispiel #2
0
void idle_mode(void)
{
    u8 key;
    //deg_str("idle_mode \n");

    //dac_out_select(DAC_MUSIC, 0);
    //clear_all_event();
    KT_AMFMStandby();
    usb_suspend();
	
    flush_all_msg();
    disp_port(MENU_POWER_OFF);
    input_number_en=0;
    vol_change_en=0;

    SYS_POWER_OFF();	
    LCD_BACKLIGHT_OFF();		
    //core_power_off();
	
   while (1)
    {
        key = app_get_msg();

        switch (key)
        {
    	  	case MSG_POWER:
        		work_mode = MUSIC_MODE;
        	case MSG_CHANGE_WORK_MODE:
	     		clear_all_event();
    	     		flush_all_msg();
			irkey_activated =0;
			sys_pwr_flag =1;
           	 	return;

       	case MSG_MUSIC_NEW_DEVICE_IN:							//有新设备接入
		  	//put_msg_lifo(MSG_CHANGE_WORK_MODE);		
	 		break;
        	default:
           	 	//ap_handle_hotkey(key);        
            		break;
        }
    }
}
void main(void)
{

    amp_mute(1);
    clock_in = T0CNT;									//输入时钟,define in clock.h

    sys_init();
    power_key_hdlr(SYS_PWR_ON);
    AMUX_P2IE_SET(AMUX0_IE&AMUX1_IE);
    sys_info_init();
    clear_all_event();
    flush_all_msg();
	
    enter_fm_rev();

    PT2313_Init();
	
    work_mode=RTC_MODE;
#ifdef IR_DEBUG
	IR_Debug_func();
#endif

    while (1)
    {
        switch (work_mode)
        {
        case MUSIC_MODE:
            music_decode();
            break;
#if USB_DEVICE_ENABLE
        case USB_DEVICE_MODE:
            usb_audio_massstorage();
            break;
#endif     

#if 1//FM_MODULE                     
        case FM_RADIO_MODE:
            fm_radio();
            break;
#endif

        case AUX_MODE:
            aux_fun();
            break;

#if 1//RTC_ENABLE
        case RTC_MODE:
            rtc_fun();
            break;        
#endif
        case REC_MIC_MODE:
            rec_mic_fun();
            break;			
        case IDLE_MODE:
	     //power_key_hdlr(SYS_PWR_OFF);
            break;			

	     default:
            	work_mode = MUSIC_MODE;
            break;
        }
        write_info(MEM_SYSMODE ,work_mode);
    }
    //*/
}
Beispiel #4
0
void main(void)
{

    amp_mute(1);
    clock_in = T0CNT;									//输入时钟,define in clock.h
  //  WDT_EN();
    sys_init();
    //power_key_hdlr(SYS_PWR_ON);
    flashled(LED_ON);

    AMUX_P2IE_SET(AMUX0_IE&AMUX1_IE);
    sys_info_init();
    clear_all_event();
    flush_all_msg();
    //work_mode=REC_MIC_MODE;
    ///*
    while (1)
    {
        switch (work_mode)
        {
        case MUSIC_MODE:
            music_decode();
            break;
#if USB_DEVICE_ENABLE
        case USB_DEVICE_MODE:
            usb_audio_massstorage();
            break;
#endif     

#if FM_MODULE                     
        case FM_RADIO_MODE:
            fm_radio();
            break;
#endif

#ifndef NOT_USE_LINE_IN_FUNC
        case AUX_MODE:
            aux_fun();
            break;
#endif


#if RTC_ENABLE
        case RTC_MODE:
            rtc_fun();
            break;        
#endif
        case REC_MIC_MODE:
            rec_mic_fun();
            break;			
		
        case IDLE_MODE:
#ifndef NO_IDLE_MODE_FUNC				
            idle_mode();			
#endif
	    // power_key_hdlr(SYS_PWR_OFF);
            break;			

	     default:
            	work_mode = MUSIC_MODE;
            break;
        }
        write_info(MEM_SYSMODE ,work_mode);
    }
    //*/
}
Beispiel #5
0
void idle_mode(void)
{
    u8 key;
    input_number_en = 0;

    if(mic_plugged){	

		mic_counter=0;
    		set_max_vol(MAX_ANOLOG_VOL,MAX_DIGITAL_VOL);///设置最大音量
		
		dac_out_select(DAC_MUSIC | DAC_KALAOK, 0);
		kala_dac();  
		set_rec_vol(7); 
		P3HD |=(1<<6);
		dsp_kalaok_channel();
		
    		vol_change_en=1;
    }
    else{

    	vol_change_en=0;
   }

 disp_port(MENU_NODEVICE);			

   while (1)
    {
        key = app_get_msg();

        switch (key)
        {
        case MSG_NO_DEVICE:
	    clear_all_event();
	    flush_low_msg();
	    disp_port(MENU_NODEVICE);			
		break;
		
    	case MSG_MIC_OUT:
		if(mic_plugged){	
			work_mode =  last_work_mode;
			mic_plugged = 0;
			return;
	      	 	//put_msg_lifo(MSG_CHANGE_WORK_MODE);		
		}
		break;
        case MSG_MUSIC_NEW_DEVICE_IN:							//有新设备接入	
        case MSG_CHANGE_WORK_MODE:
		break;
            work_mode = MUSIC_MODE;
            return;

        case MSG_HALF_SECOND:
////////////////////////////////////////////////////////////
//显示界面的切换
#if 0            
            set_brightness_fade_out();
            if (main_menu_conter < SUB_MENU_TIME)
            {
                main_menu_conter++;
            }
            else if (cur_menu != main_menu)
            {
                cur_menu = main_menu;
                disp_port(cur_menu);
            }
#endif

            break;
#if RTC_ENABLE
        case MSG_ALM_ON:
            write_next_alm_sec();
            work_mode = RTC_MODE;
            put_msg_lifo(MSG_CHANGE_WORK_MODE);
            break;
#endif
        default:

            ap_handle_hotkey(key);        
            break;
        }
    }

}
Beispiel #6
0
void main(void)
{
#if defined(USE_LCD_DRV_HT1621)
    lcd_ht1621_init();
#endif
    work_mode = MUSIC_MODE;
    //amp_mute(1);
    clock_in = T0CNT;									//输入时钟,define in clock.h
    //WDT_EN();
    sys_init();
    AMUX_P2IE_SET(AMUX1_IE);
    sys_info_init();
    clear_all_event();
    flush_all_msg();
#ifndef LCD_BACK_LIGHT_DUMMY					
    set_brightness_all_on();
#endif
#if (DISP_VER!=0)
    if(ADKEY_PORT==0){

	disp_port(MENU_VER);
	delay_10ms(80);
    }
#endif	
    delay_10ms(10);
    ///*
    while (1)
    {
        switch (work_mode)
        {
        case MUSIC_MODE:
            music_decode();
            break;
#if USB_DEVICE_ENABLE
        case USB_DEVICE_MODE:
            usb_audio_massstorage();
            break;
#endif     

#if FM_MODULE                     
        case FM_RADIO_MODE:
            radio_main_hdlr();
            break;
#endif

#ifdef USE_BLUE_TOOTH_FUNC
	case BLUE_TOOTH_MODE:
		Blue_tooth_main();
		break;
#endif
        //case AUX_MODE:
            //aux_fun();
          //  break;

#if RTC_ENABLE
        //case RTC_MODE:
            //rtc_fun();
         //   break;        
#endif
        case REC_MIC_MODE:
            rec_mic_fun();
            break;
			
        case IDLE_MODE:
            idle_mode();	
	     sys_mute_flag =0;
	     dac_mute_control(0,1);					//调节音量时,自动UNMUTE
    	     //set_brightness_all_on();
            break;		
        default:
            work_mode = MUSIC_MODE;
            break;
        }
        //write_info(MEM_SYSMODE ,work_mode);
    }
    //*/
}