?? accordoptimer.c
字號(hào):
/************************************************** * * accordoptimer.c * * CVS ID: $Id: accordoptimer.c,v 1.69 2007/09/26 15:06:24 dellorto Exp $ * Author: Raffaele Belardi [RB] - STM * Date: $Date: 2007/09/26 15:06:24 $ * Revision: $Revision: 1.69 $ * * Description: * * Timer interrupt handler. Processes all the software * timers used by the application * *************************************************** * * COPYRIGHT (C) ST Microelectronics 2005 * All Rights Reserved * *************************************************** * * STM CVS Log: * * $Log: accordoptimer.c,v $ * Revision 1.69 2007/09/26 15:06:24 dellorto * modified monitor timeslice to 1ms * added timer and timeout function for hf detection * * Revision 1.68 2007/09/21 05:35:52 hara * Initial implementation for WMDRM feature into A+. * * Revision 1.67 2007/08/20 16:30:32 longauer * more robust HIGH_Z setting (proper timers handling) * * Revision 1.66 2007/08/14 15:28:26 dellorto * multiple mechanisms * * Revision 1.65 2007/08/09 09:02:48 marcucci * jitter_val() function addedd * * Revision 1.64 2007/06/04 16:58:45 longauer * USBtask rearrangement in order to support more logical units; new file usb_pri.h added with USBtask private declarations; USB compilation switches added; constants renaming; * * Revision 1.63 2007/04/11 14:20:13 belardi * Integration of HAVE_CD_MECHA modification by [GP] * * Revision 1.62 2007/03/21 11:10:34 sedmik * fix for automessaging of MsgInsertMode(no USB) after startup - when IPOD plugged, this message shouldn't be sent * * Revision 1.61 2007/03/16 14:17:02 dellorto * added timer for rate track counting, used recovering TTM * * Revision 1.60 2007/02/23 14:31:03 sedmik * report_msg_insert_mode change * * Revision 1.59 2007/02/23 11:39:57 sedmik * aligned call of report_msg_insert_mode * * Revision 1.58 2006/12/04 14:45:59 dellorto * added timers for new de-bouncing * re-ordered timers vector * * Revision 1.57 2006/11/27 19:52:12 belardi * Modifications for HAVE_TEMP_SENSOR * * Revision 1.56 2006/11/24 16:28:06 sedmik * fixed HAVE_TEMP_SENSOR define * * Revision 1.55 2006/11/24 11:19:02 zhong * Karbin for Temperature sensor detect * * Revision 1.54 2006/11/20 13:27:41 sedmik * fix in initial_messaging_timeout (USB/SDC) * * Revision 1.53 2006/11/13 19:03:59 longauer * *** empty log message *** * * Revision 1.52 2006/10/31 08:51:08 belardi * Removed unused STM hostif timer * * Revision 1.51 2006/10/26 10:24:35 dellorto * added timer for loader transition measurement * * Revision 1.50 2006/10/20 12:33:11 belardi * Added include file to remove compiler warning * * Revision 1.49 2006/10/18 12:39:58 belardi * Removed USE_STM_HOSTIF, changed to APM_PICKUP * * Revision 1.48 2006/10/11 07:46:45 longauer * warning eliminated * * Revision 1.47 2006/10/10 17:21:19 longauer * to prevent some devices which could hook the driver during enumeration * * Revision 1.46 2006/09/26 09:35:19 belardi * Moved intial_messaging_timeout() to accordoptimer.c from player.c * * Revision 1.45 2006/09/18 09:55:23 belardi * Corrected CVS keyword usage * * Revision 1.44 2006/09/18 09:24:52 belardi * Added Log CVS keyword into file header * * ***************************************************/#include "gendef.h"#include "hwreg.h"#include "osal.h"#include "isrchdl.h"#include "monitor.h"#include "loader.h"#include "srvrcv.h"#include "srvsld.h"#include "srvttm.h"#include "srvjmp.h"#if ((0 != HAVE_USB) || (0 != HAVE_SDC))#include "player.h"#include "hostif_high.h"#endif#ifdef APM_PICKUP#if (OS20_PROFILING == 1) && (0 != HAVE_PRINTF) #include "service.h"#endif#else#include "player.h"#include "hostif_low.h"#endif#if (0 != HAVE_USB)#include "controller.h"#include "usb.h"//extern void (*pfServiceUsbTimer)(); //[LL] moved to the usb_pri.h#endif#if (0 != HAVE_SDC)#include "sdc.h"#endif /* HAVE_SDC */#define TIMER1_TIME (1)#define TIMER1_PRESCALER (3)#define TIMER1_BASE ((TIMER1_TIME*S_APB_CLK)/(1000*(TIMER1_PRESCALER+1)))typedef enum{ TIMFLG_NULL = 0, TIMFLG_RUN_MONITOR = (1 << 0), TIMFLG_RUN_LDRSW = (1 << 1), TIMFLG_RUN_CHECK_TRACKING_FSM = (1 << 2), TIMFLG_RUN_CHECK_HF_FSM = (1 << 3), TIMFLG_RUN_SLEDGE_FSM = (1 << 4), TIMFLG_RUN_TTM_FSM = (1 << 5),#ifndef APM_PICKUP TIMFLG_RUN_HWEJSW = (1 << 6),#endif} t_timeout_flags;typedef t_timeout_flags (* t_timeout_callback) (void);void tim1_isr_hlr_irq(void);static OSAL_TIME_t timeout[MAX_TIMERS];static OSAL_TIME_t absolute_time;//#if defined(APM_PICKUP) || #if (0 != HAVE_TEMP_SENSOR)static t_timeout_flags dummy_timeout(void){ return TIMFLG_NULL;}//#endif#if (HAVE_CD_MECHA == 1)static t_timeout_flags servo_timeout(void){ OSAL_wake_thread(OSAL_THREAD_ServoTask); return TIMFLG_NULL;}extern void jitter_val(void);#endifstatic t_timeout_flags controller_timeout(void){ OSAL_wake_thread(OSAL_THREAD_ControllerTask); return TIMFLG_NULL;}static t_timeout_flags monitor_timeout(void){ OSAL_start_timeout(MONITOR_TIMESLICE, T1ms);#ifdef APM_PICKUP return (t_timeout_flags) (TIMFLG_RUN_MONITOR | TIMFLG_RUN_LDRSW | TIMFLG_RUN_SLEDGE_FSM);#else return (t_timeout_flags) (TIMFLG_RUN_MONITOR | TIMFLG_RUN_LDRSW | TIMFLG_RUN_SLEDGE_FSM | TIMFLG_RUN_HWEJSW);#endif}#if (HAVE_CD_MECHA == 1)static t_timeout_flags tracking_timeout(void){ return TIMFLG_RUN_CHECK_TRACKING_FSM;}static t_timeout_flags hf_timeout(void){ return TIMFLG_RUN_CHECK_HF_FSM;}#endifstatic t_timeout_flags ttm_timeout(void){ return TIMFLG_RUN_TTM_FSM;}#ifdef APM_PICKUPstatic t_timeout_flags cav_int_timeout(void){ OSAL_wake_thread(OSAL_THREAD_ServoTask); return TIMFLG_RUN_TTM_FSM;}static t_timeout_flags hostif_timeout(void){ OSAL_wake_thread(OSAL_THREAD_HostIfTask); return TIMFLG_NULL;}#endifstatic t_timeout_flags player_timeout(void){ OSAL_wake_thread(OSAL_THREAD_PlayerTask); return TIMFLG_NULL;}#ifndef APM_PICKUP#if (HAVE_CD_MECHA == 1)static t_timeout_flags sledge_timeout(void){ return TIMFLG_RUN_SLEDGE_FSM;}#endift_timeout_flags hw_eject_sw_timeout(void){ return TIMFLG_RUN_HWEJSW;}#endif // APM_PICKUP#if (HAVE_CD_MECHA == 1)static t_timeout_flags loader_timeout(void){ OSAL_wake_thread(OSAL_THREAD_LoaderTask); return TIMFLG_NULL;}static t_timeout_flags loader_sw_timeout(void){ return TIMFLG_RUN_LDRSW;}#endif#ifndef APM_PICKUPstatic t_timeout_flags hostif_ll_stop_timeout(void){ hostif_inevent |= HOSTIF_EVT_LL_STOP_TIMEOUT; OSAL_wake_thread(OSAL_THREAD_HostIfTask); return TIMFLG_NULL;}static t_timeout_flags hostif_ll_crq_timeout(void){ hostif_inevent |= HOSTIF_EVT_LL_CRQ_TIMEOUT; OSAL_wake_thread(OSAL_THREAD_HostIfTask); return TIMFLG_NULL;}#endif#if (0 != HAVE_USB)static t_timeout_flags usb_timeout(void){ usb_call_back(); return TIMFLG_NULL;}static t_timeout_flags usb_enum_timeout(void){ usb_check_enumeration(); return TIMFLG_NULL;}static t_timeout_flags usb_check_medium_timeout(void){ usb_check_medium(); return TIMFLG_NULL;}#endif#if (0 != HAVE_SDC)static t_timeout_flags sdc_timeout(void){ sdc_test(); return TIMFLG_NULL;}#endif /* HAVE_SDC */
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -