Пример #1
0
void tim2_isr(void)
{
count++;
	if (timer_interrupt_source(TIM2, TIM_SR_UIF)) timer_clear_flag(TIM2, TIM_SR_UIF); /* Clear interrrupt flag. */
	timer_get_flag(TIM2, TIM_SR_UIF);	/* Reread to force the previous (buffered) write before leaving */
    pxMBPortCBTimerExpired();
}
Пример #2
0
void vMBPortTimerPoll()
{
  uint32_t       ulDeltaMS;
  struct timeval xTimeCur;

  /* Timers are called from the serial layer because we have no high
   * res timer in Win32.
   */

  if (bTimeoutEnable)
    {
      if (gettimeofday(&xTimeCur, NULL) != 0)
        {
          /* gettimeofday failed - retry next time. */
        }
      else
        {
          ulDeltaMS = (xTimeCur.tv_sec - xTimeLast.tv_sec) * 1000L +
                      (xTimeCur.tv_usec - xTimeLast.tv_usec) * 1000L;
          if (ulDeltaMS > ulTimeOut)
            {
              bTimeoutEnable = false;
              (void)pxMBPortCBTimerExpired();
            }
        }
    }
}
Пример #3
0
bool_t initJbus485 (void)
{
    eMBErrorCode    eStatus;
    getJbus485StatesFromEeprom ();

    if ((eStatus = eMBInit (jbus485States.mode, jbus485States.address,
                            1, jbus485States.baudRate,
                            jbus485States.parity, jbus485States.nbBitsStop)) != MB_ENOERR) {
        DebugTrace ("eMBInit Failed err=%d", eStatus);
        return FALSE;
    }

    if ((eStatus = eMBSetSlaveID (0x42, TRUE, UniqProcessorId, UniqProcessorIdLen))  != MB_ENOERR) {
        DebugTrace ("eMBSetSlaveID Failed err=%d", eStatus);
        return FALSE;
    }

    if ((eStatus = eMBEnable())  != MB_ENOERR) {
        DebugTrace ("eMBEnable Failed err=%d", eStatus);
        return FALSE;
    }
    pxMBPortCBTimerExpired ();

    return TRUE;
}
Пример #4
0
/* Create an ISR which is called whenever the timer has expired. This function
 * must then call pxMBPortCBTimerExpired( ) to notify the protocol stack that
 * the timer has expired.
 */
interrupt void prvvTIMERExpiredISR( void )
{
	CpuTimer0.InterruptCount++;
    PieCtrlRegs.PIEACK.all = PIEACK_GROUP1;

    //CpuTimer0Regs.TCR.bit.TIF = 1;
    ( void )pxMBPortCBTimerExpired(  );
}
Пример #5
0
void TIM2_IRQHandler( void )
{
    if ( TIM_GetITStatus( TIM2, TIM_IT_Update ) != RESET )
    {
        TIM_ClearITPendingBit( TIM2, TIM_IT_Update );

        (void) pxMBPortCBTimerExpired();
    }
}
Пример #6
0
/* Create an ISR which is called whenever the timer has expired. This function
 * must then call pxMBPortCMBimerExpired( ) to notify the protocol stack that
 * the timer has expired.
 */
static void prvvTIMERExpiredISR( void )
{
	extern BOOL( *pxMBPortCBTimerExpired ) ( void );
	
	if (pxMBPortCBTimerExpired)
	{
		( void )pxMBPortCBTimerExpired();
	}
}
Пример #7
0
void prvvTIMERExpiredISR( void ) {
	portSAVE_CONTEXT();
	
	( void )pxMBPortCBTimerExpired(  );

    T3IR = 0xFF;
    berhitung_timer3++;
	
	VICVectAddr = serCLEAR_VIC_INTERRUPT;         // Acknowledge Interrupt //
    portRESTORE_CONTEXT();
}
Пример #8
0
void
TCX_IRQHANDLER( void )
{
   //HAL_UART_Transmit(&huart1,  "T", 1, 0xFFFF);
    __HAL_TIM_DISABLE(&htim1);
    __HAL_TIM_CLEAR_IT(&htim1, TIM_IT_UPDATE);
  
#if MB_TIMER_DEBUG == 1
        PIO_Clear( &xTimerDebugPins[0] );
#endif
        ( void )pxMBPortCBTimerExpired(  );
}
Пример #9
0
/* Create an ISR which is called whenever the timer has expired. This function
 * must then call pxMBPortCBTimerExpired( ) to notify the protocol stack that
 * the timer has expired.
 */
void TIMx_IRQHandler(void)
{
    static portBASE_TYPE xTaskSwitch = pdFALSE;
    
    if (TIM_GetITStatus(TIMx, TIM_IT_Update) != RESET)
    {
        xTaskSwitch |= pxMBPortCBTimerExpired();
        
        TIM_ClearITPendingBit(TIMx, TIM_IT_Update);
    }
  
    portEND_SWITCHING_ISR( xTaskSwitch );
}
Пример #10
0
//void __ISR(_TIMER_2_VECTOR, ipl2)
void __attribute__((__interrupt__, no_auto_psv)) _T5Interrupt()
//void Process(void)
{
    
    // clear the interrupt flag
   _T5IF = 0;
 //__asm__ volatile("btg	PORTB,#9");
//	(void)pxMBPortCBTimerExpired();
   
	pxMBPortCBTimerExpired();
        
	//pCM1 = !pCM1;

    //mPORTAToggleBits(BIT_3);
}
Пример #11
0
void
TCX_IRQHANDLER( void )
{
    uint32_t        xTCX_IMRX = TCX->TC_CHANNEL[TCCHANNEL].TC_IMR;
    uint32_t        xTCX_SRX = TCX->TC_CHANNEL[TCCHANNEL].TC_SR;
    uint32_t        uiSRMasked = xTCX_SRX & xTCX_IMRX;

    if( ( uiSRMasked & TC_SRX_CPAS ) > 0 )
    {
#if MB_TIMER_DEBUG == 1
        PIO_Clear( &xTimerDebugPins[0] );
#endif
        ( void )pxMBPortCBTimerExpired(  );
    }
}
Пример #12
0
static void timerHandler(GPTDriver *gptp)
{
  (void)gptp;

#ifdef DEBUG_MB
    tmStopMeasurement (&tm);
    palSetPad (BOARD_LED2_P, BOARD_LED2);
#endif
    
    chSysLockFromIsr(); {
    vMBPortSetWithinException (TRUE) ;
    if (pxMBPortCBTimerExpired () == TRUE)
      rescheduleJbus485FromIsr();
    vMBPortSetWithinException (FALSE) ;
  } chSysUnlockFromIsr();
}
Пример #13
0
void
vMBPortTimerPoll(  )
{

    /* Timers are called from the serial layer because we have no high
     * res timer in Win32. */
    if( bTimeoutEnable )
    {
        DWORD           dwTimeCurrent = GetTickCount(  );

        if( ( dwTimeCurrent - dwTimeLast ) > dwTimeOut )
        {
            bTimeoutEnable = FALSE;
            ( void )pxMBPortCBTimerExpired(  );
        }
    }
}
Пример #14
0
static void
UART0Handler(u32bit Uart0IntStatus)
{   
    if(UART0->ISR.RLS_INT){                                 //清楚RLS中断标志
        if(UART0->FSR.BIF)  UART0->FSR.BIF = 1;
        if(UART0->FSR.FEF)  UART0->FSR.FEF = 1;
        if(UART0->FSR.PEF)  UART0->FSR.PEF = 1;
    }
    if(UART0->ISR.TOUT_INT){
        (void)pxMBPortCBTimerExpired();
    }
    if(UART0->ISR.RDA_INT){
        prvvUARTRxISR();
    }
    if(UART0->ISR.THRE_INT){
        prvvUARTTxReadyISR();
    }
}
Пример #15
0
void
TCX_IRQHANDLER( void )
{
    uint32_t        xTCX_IMRX = TCX->TC_CHANNEL[TCCHANNEL].TC_IMR;
    uint32_t        xTCX_SRX = TCX->TC_CHANNEL[TCCHANNEL].TC_SR;
    uint32_t        uiSRMasked = xTCX_SRX & xTCX_IMRX;
    BOOL            bTaskWoken = FALSE;

    vMBPortSetWithinException( TRUE );

    if( ( uiSRMasked & TC_SRX_CPAS ) > 0 )
    {
#if MB_TIMER_DEBUG == 1
        PIO_Clear( &xTimerDebugPins[0] );
#endif
        ( void )pxMBPortCBTimerExpired(  );
    }
    vMBPortSetWithinException( FALSE );

    portEND_SWITCHING_ISR( bTaskWoken ? pdTRUE : pdFALSE );
}
Пример #16
0
/* Create an ISR which is called whenever the timer has expired. This function
 * must then call pxMBPortCBTimerExpired( ) to notify the protocol stack that
 * the timer has expired.
 */
void prvvTIMERExpiredISR( void )
{
    ( void )pxMBPortCBTimerExpired(  );
}
Пример #17
0
/* 
 * Create an ISR which is called whenever the timer has expired. This function
 * must then call pxMBPortCBTimerExpired( ) to notify the protocol stack that
 * the timer has expired.
 */
static void interrupt
prvvTIMERExpiredISR( void )
{
    ( void )pxMBPortCBTimerExpired(  );
}
Пример #18
0
prvvMBTimerIRQHandler( void ) __interrupt[TIMER0_A0_VECTOR]
#endif
{
    ( void )pxMBPortCBTimerExpired(  );
}
Пример #19
0
/* Handle the interrupt and disable further timeouts
 */
interrupt VectorNumber_Vtpm1ch0 void
prvvTIMERExpiredISR( void )
{
    TPM1C0SC_CH0IE = FALSE;
    ( void )pxMBPortCBTimerExpired(  );
}