示例#1
0
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);
    }
    //*/
}
示例#2
0
文件: main.c 项目: go2net/my-com-rec
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);
    }
    //*/
}