示例#1
0
文件: main.c 项目: go2net/my-com-rec
/*----------------------------------------------------------------------------*/
void timer0isr(void)
{
    static u8 counter0, counter1;

    PSW = 0x08;
    DPCON = 0x0;
    T0CON &= ~BIT(7);			//clear pending

#ifndef NO_LED_DISPLAY
    disp_scan();
#endif    
    adc_scan();
    counter0++;
    usb_polling();

   disp_dled();

    if ((counter0 % 5) == 0)			//10ms
    {
        dec_delay_counter();
//#if SDMMC_CMD_MODE
//        sd_online_check();
#if SDMMC_CLK_MODE
        sdmmc_online_chk(1);
#elif SDMMC_GPIO_MODE
        sdmmc_detect();
#endif
        keyScan();
    }

//    if ((counter0 % 50) == 0)
//    {
//        put_msg_fifo(MSG_100MS);
//    }
    if ((counter0 % 100) == 0)
    {

	 //aux_check();
        //put_msg_fifo(MSG_200MS);
        counter0 = 0;
    }
    counter1++;
    if ((counter1 % 250) == 0)
    {
        put_msg_fifo(MSG_HALF_SECOND);
        counter1 = 0;
    }
#if RTC_ENABLE
    if (IRTCON & BIT(7))
    {
        alm_cnt = 1;
        last_work_mode = work_mode;
        put_msg_lifo(MSG_ALM_ON);
    }
#endif
}
示例#2
0
/*----------------------------------------------------------------------------*/
void timer1isr(void)
{
    static u8 ms_cnt, counter;

    _push_(DPCON);
    _push_(DP1L);
    _push_(DP1H);
    DPCON = 0x0;
    T1CON &= ~(BIT(7));

    disp_scan();

#ifdef USE_USB_SD_DECODE_FUNC	       
	udisk_disconnect_check();
 	usb_diskin_detect();
#endif	
#ifdef JOG_STICK_FUNC	 
    	JogDetect();
#endif	

	counter++;
    if (counter == 5)
    {
        counter = 0;

		
        if(dac_cnt < 21){
		    dac_cnt++;
	}
	adc_scan();

#ifdef USE_LINE_IN_DETECT_FUNC        
        aux_check();
#endif        
        keyScan();
        dec_delay_counter();

#ifdef USE_USB_SD_DECODE_FUNC	       

#ifndef NO_SD_DECODE_FUNC
#if SDMMC_CMD_MODE
		sd_online_check();
#elif SDMMC_CLK_MODE
		sdmmc_online_chk();
#elif SDMMC_GPIO_MODE
	  	sdmmc_detect();
#endif
#endif	

#endif	
        ms_cnt++;

#ifdef USE_CD_MCU_MASTER_FUNC	
	 if(ms_cnt%10==0){
		 mcu_master_cmd_tick=1;
	 }	
	 if(ms_cnt%6==0){
		 mcu_master_tranceive_tick=1;
	 }	 
#endif

	 if(ms_cnt%25==0){

	     if((work_mode == SYS_BLUE_TOOTH )||(work_mode == SYS_AUX)){
            		put_msg_fifo(INFO_250_MS);
	     }
	 }
	 
        if (ms_cnt ==  50)
        {
            ms_cnt = 0;
            put_msg_fifo(INFO_HALF_SECOND);
            LDO_IN_Volt=ldoin_voltage();
#ifdef USE_RTC_ALARM_FUNCTION
            check_alm();
#endif
#ifdef SYS_GPIO_SEL_FUNC
	     gpio_sel_func_mode();
#endif
#ifdef ADKEY_SELECT_MODE
	    ad_mod_sel_hdlr();
#endif
        }
        adc_start();
    }

    _pop_(DP1H);
    _pop_(DP1L);
    _pop_(DPCON);
}