Exemple #1
0
void  SysTick_Handler (void)
{
    OS_CPU_SR  cpu_sr;


    OS_ENTER_CRITICAL();                         /* Tell uC/OS-II that we are starting an ISR          */
    OSIntNesting++;
    OS_EXIT_CRITICAL();

    OSTimeTick();                                /* Call uC/OS-II's OSTimeTick()                       */

    OSIntExit();                                 /* Tell uC/OS-II that we are leaving the ISR          */
}
Exemple #2
0
void Isr_TIMER0(void)
{
	u32 uTmp;
	
	uTmp = Inp32(rTINT_CSTAT);
	uTmp = (uTmp & 0x1f)| (1<<5);
	Outp32(rTINT_CSTAT,uTmp);       //  Timer0 Interrupt Clear register
    
	UART_Printf("Timer0\n");
	g_uIntCounter0++;

	INTC_ClearVectAddr();
	OSTimeTick();
}
void SysTick_Handler(void)
{
#if OS_CRITICAL_METHOD == 3 /* Allocate storage for CPU status register */
    OS_CPU_SR  cpu_sr = 0;
#endif

    OS_ENTER_CRITICAL();  /* Tell uC/OS-II that we are starting an ISR */
    OSIntNesting++;
    OS_EXIT_CRITICAL();

    OSTimeTick();  /* Call uC/OS-II's OSTimeTick() */

    OSIntExit();  /* Tell uC/OS-II that we are leaving the ISR */	
}
Exemple #4
0
void  OS_CPU_SysTickHandler (void)
{
#if OS_CRITICAL_METHOD == 3
    OS_CPU_SR  cpu_sr;
#endif

    OS_ENTER_CRITICAL();                         /* Tell uC/OS-II that we are starting an ISR          */
    OSIntNesting++;
    OS_EXIT_CRITICAL();

    OSTimeTick();                                /* Call uC/OS-II's OSTimeTick()                       */

    OSIntExit();                                 /* Tell uC/OS-II that we are leaving the ISR          */
}
/*******************************************************************************
*函数名:
  **isr
*功能:各中断跳转,方便代码部分升级
*输入:
*输出:
*说明:
*******************************************************************************/
void sysTickIsr ( void )
{
    #if OS_CRITICAL_METHOD ==3
    OS_CPU_SR  cpu_sr;
    #endif

    OS_ENTER_CRITICAL();
   // OSIntNesting++;
    OSIntEnter();
    OS_EXIT_CRITICAL();

    OSTimeTick();                        // Call uC/OS-II's OSTimeTick()  调用uC/OS-II的OSTimeTick()函数

    OSIntExit();
}
Exemple #6
0
/**
  * @brief  This function handles SysTick Handler.
  * @param  None
  * @retval None
  */
void SysTick_Handler(void)
{
	OS_CPU_SR  cpu_sr;
  
	HAL_IncTick();
  if(OSRunning > 0u)						/*系统运行之后在开始调度*/					
  {
		OS_ENTER_CRITICAL();          /* Tell uC/OS-II that we are starting an ISR            */
		OSIntEnter();
		OS_EXIT_CRITICAL();
		
		OSTimeTick();                 /* Call uC/OS-II's OSTimeTick()                         */
		OSIntExit();
  }
}
Exemple #7
0
/*********************************************************************************************************
*                                          SYS TICK HANDLER
*
* Description: Handle the system tick (SysTick) interrupt, which is used to generate the myos tick
*              interrupt.
*
* Arguments  : none.
*
* Note(s)    : 1) This function MUST be placed on entry 15 of the Cortex-M3 vector table.
*********************************************************************************************************
*/
void  SysTick_Handler (void)
{
    OS_CPU_SR  cpu_sr;

	cpu_sr++;

    OS_ENTER_CRITICAL();                         /* Tell myos that we are starting an ISR          */
    OSIntNesting++;
    OS_EXIT_CRITICAL();
	Decrement_TimingDelay();
//
    OSTimeTick();                                /* Call myos OSTimeTick()                       */
//
    OSIntExit();                                 /* Tell myos that we are leaving the ISR,在其中实现任务切换          */
}
Exemple #8
0
//*****************************************************************************
//
// The interrupt handler for the SysTick interrupt.
//
//*****************************************************************************
void
SysTickIntHandler(void)
{
    OS_ENTER_CRITICAL();
    OSIntNesting++;
    OS_EXIT_CRITICAL();

    OSTimeTick();
    OSIntExit();

    //
    // Call the SoftI2C tick function.
    //
    //SoftI2CTimerTick(&g_sI2C);
}
Exemple #9
0
ATTRIBUTE_ISR void CORET_IRQHandler(void)
{
    CSI_INTRPT_ENTER();

    readl(0xE000E010);

#if defined(CONFIG_KERNEL_RHINO)
    systick_handler();
#elif defined(CONFIG_KERNEL_FREERTOS)
    xPortSysTickHandler();
#elif defined(CONFIG_KERNEL_UCOS)
    OSTimeTick();
#endif

    CSI_INTRPT_EXIT();
}
__irq void SysTickHandler(void)
{
    OS_CPU_SR  cpu_sr;
	
    if (OSRunning == OS_TRUE) {
        if (OSIntNesting < 255u) {
            OS_ENTER_CRITICAL();  //保存全局中断标志,关总中断/* Tell uC/OS-II that we are starting an ISR*/
            OSIntNesting++;
            OS_EXIT_CRITICAL();   //恢复全局中断标志                    /* Increment ISR nesting level                        */
        }
    }

    OSTimeTick();      /* Call uC/OS-II's OSTimeTick(),在os_core.c文件里定义,主要判断延时的任务是否计时到*/

    OSIntExit();  //在os_core.c文件里定义,如果有更高优先级的任务就绪了,则执行一次任务切换             
}
Exemple #11
0
//extern led_scan(void);
void  SysTick_Handler (void)
{
	static int cnt = 0;
	enter_interrupt();

	tick_ms++;
//	led_scan();
	if(cnt++ >= 10)
	{
		jiffies++;
		cnt = 0;
		OSTimeTick();                                /* Call uC/OS-II's OSTimeTick()                       */
		exit_interrupt(1);                           
		return;
	}
	exit_interrupt(0);
}
Exemple #12
0
void SysTickISR (void)
{
#if APP_OS_EN > 0
    
#if OS_CRITICAL_METHOD == 3u
    OS_CPU_SR  cpu_sr;
#endif

    OS_ENTER_CRITICAL();                         /* Tell uC/OS-II that we are starting an ISR               */
    OSIntNesting++;
    OS_EXIT_CRITICAL();

    OSTimeTick();                                /* Call uC/OS-II's OSTimeTick()                            */

    OSIntExit();                                 /* Tell uC/OS-II that we are leaving the ISR               */
#else
    SysTickTimimg();
#endif  
}
Exemple #13
0
void CALLBACK OSTickISR(unsigned int a,unsigned int b,unsigned long c,unsigned long d,unsigned long e)
{
    if(!FlagEn)
        return;                                             //如果当前中断被屏蔽则返回

    SuspendThread(mainhandle);                          //中止主线程的运行,模拟中断产生.但没有保存寄存器
    GetThreadContext(mainhandle, &Context);             //得到主线程上下文,为切换任务做准备

    OSIntNesting++;
    if (OSIntNesting == 1)
    {
        OSTCBCur->OSTCBStkPtr = (OS_STK *)Context.Esp;  //保存当前esp
    }
    OSTimeTick();                                       //ucos内部定时
    OSIntExit();                                        //由于不能使用中断返回指令,所以此函数是要返回的

    ResumeThread(mainhandle);                           //模拟中断返回,主线程得以继续执行

}
Exemple #14
0
void __irq IRQ_Timer0(void){ /*定时器0的中断处理程序*/
  switch (T0IR)
   {case 0x01    :				  /*MR0中断,*/
               	  T0IR=0X1;		  /*相应位写入“1”将清除中断标志,写入0无效*/
                  OSTimeTick();	  /*用于任务切换的,把每一个阻塞任务的延时计数器减一,若减完已经为0,
				                  ** 若没有等待事件或信号,则在就绪表就绪组中设置相应的标志*******/

				  break;
	case 0x01<<1 :
               	  T0IR=0X1<<1;
                  break;
	case 0x01<<2 :
               	  T0IR=0X1<<2;
                  break;
	case 0x01<<3 :
               	  T0IR=0X1<<3;
                  break;
	case 0x01<<4 :					   /*CR0中断,表示捕获到了外来事件*/
		
				  T0IR=0X1<<4;		   /*写入1表示清除中断标志*/
                  break;
	case 0x01<<5 :
               	  T0IR=0X1<<5;
                  break;
	case 0x01<<6 :
               	  T0IR=0X1<<6;
                  break;
	case 0x01<<7 :
               	  T0IR=0X1<<7;
                  break;
	default      :
	              break;
    
 } 
 VICVectAddr=0x00; //中断结束

 OSIntExit();	 /*任何中断结束后都调用该函数,并在该函数中执行任务切换函数OSIntCtxSw()  */
}
Exemple #15
0
void OSTickISR()
{
    OSIntEnter();
    OSTimeTick();
    OSIntExit();
}
Exemple #16
0
//systick中断服务函数,系统心跳
void SysTick_Handler(void)
{
 OSIntEnter();//进入中断
 OSTimeTick();//调用ucos的时钟服务程序
 OSIntExit();//触发任务切换软中断
}
Exemple #17
0
/*********************************************************************************************************
** 函数名称: Timer0_Exception
** 功能描述: 定时器0中断服务程序
** 输 入: 无
**
** 输 出: 无
**         
** 全局变量: 无
** 调用模块: OSTimeTick
**
** 作 者: 陈明计
** 日 期: 2004年2月2日
**-------------------------------------------------------------------------------------------------------
** 修改人:
** 日 期:
**------------------------------------------------------------------------------------------------------
********************************************************************************************************/
        void Timer0_Exception(void)
{
    T0IR = 0x01;
    VICVectAddr = 0;            // 通知中断控制器中断结束
    OSTimeTick();
}
Exemple #18
0
void SysTick_Handler(void)			// 非常重要   系统滴答
{
	OSIntEnter();
	OSTimeTick();
	OSIntExit();
}
Exemple #19
0
/**
  * @brief  This function handles SysTick Handler.
  * @param  None
  * @retval None
  */
void SysTick_Handler(void)
{
    OSIntEnter();
    OSTimeTick();
    OSIntExit();
}
Exemple #20
0
void SysTick_Handler(void)
{
	OSIntEnter(); 	 //用于统计中断的嵌套层数,对嵌套层数+1
	OSTimeTick();	   //统计时间,遍历任务,对延时任务计时减1
	OSIntExit();	   //对嵌套层数减1,在退出中断前启动任务调度
}
Exemple #21
0
void Timer0Interrupt()
{
	rI_ISPC=BIT_TIMER0;                  // Clear pending bit -- Watchdog timer
	OSTimeTick();
}
Exemple #22
0
static void tickISR()
{
	OSTimeTick();

	timerRegs->CLI = 0;
}