예제 #1
0
파일: main.c 프로젝트: HITliuyu/NES15_HEVC
void millisecond_task(
    void)
{
    Time ticks = 0;     /* task cycle */
    int i = 0;  /* loop counter */

    ticks = RTKGetTime() + MilliSecsToTicks(1);
    while (TRUE) {
        RTKDelayUntil(ticks);
        dlmstp_millisecond_timer();
        ticks += MilliSecsToTicks(1);
    }
}
예제 #2
0
void *milliseconds_task(
    void *pArg)
{
    struct timespec timeOut, remains;

    timeOut.tv_sec = 0;
    timeOut.tv_nsec = 10000000; /* 1 milliseconds */

    for (;;) {
        nanosleep(&timeOut, &remains);
        dlmstp_millisecond_timer();
    }

    return NULL;
}
예제 #3
0
파일: isr.c 프로젝트: empeeoh/BACnet
void InterruptHandlerLow(
    void)
{
    /* check for timer2 int */
    if ((PIR1bits.TMR2IF) && (PIE1bits.TMR2IE)) {
        PIR1bits.TMR2IF = 0;
        Interrupt_Timer2();
    }

    /* check for timer3 int */
    if ((PIR2bits.TMR3IF) && (PIE2bits.TMR3IE)) {
        PIR2bits.TMR3IF = 0;
        Interrupt_Timer3();
    }

    /* check for timer4 int */
    if ((PIR3bits.TMR4IF) && (PIE3bits.TMR4IE)) {
        PIR3bits.TMR4IF = 0;
        dlmstp_millisecond_timer();
        Interrupt_Timer4();
    }

    /* check for compare int */
    if ((PIR2bits.CCP2IF) && (PIE2bits.CCP2IE)) {
        PIR2bits.CCP2IF = 0;
        Interrupt_CCP2();
    }

    /* check for USART Tx int */
    if ((PIR3bits.TX2IF) && (PIE3bits.TX2IE)) {
        RS485_Interrupt_Tx();
    }

    /* check for USART Rx int */
    if ((PIR3bits.RC2IF) && (PIE3bits.RC2IE)) {
        RS485_Interrupt_Rx();
    }

/* Unused Interrupts
  //check for timer1 int
  if ((PIR1bits.TMR1IF) && (PIE1bits.TMR1IE))
  {						
    PIR1bits.TMR1IF = 0; 
    Interrupt_Timer1();
  }

  //check for compare int
  if ((PIR1bits.CCP1IF) && (PIE1bits.CCP1IE))
  {						
    PIR1bits.CCP1IF = 0; 
    Interrupt_CCP1();
  }

  //check for compare int
  if ((PIR3bits.CCP3IF) && (PIE3bits.CCP3IE))
  {						
    PIR3bits.CCP3IF = 0; 
    Interrupt_CCP3();
  }

  //check for compare int
  if ((PIR3bits.CCP4IF) && (PIE3bits.CCP4IE))
  {						
    PIR3bits.CCP4IF = 0; 

    Interrupt_CCP4();
  }

  //check for AD int
  if ((PIR1bits.ADIF) && (PIE1bits.ADIE))
  {						
    PIR1bits.ADIF = 0;   
    Interrupt_ADC();
  }

  //check for MSSP int
  if ((PIR1bits.SSPIF) && (PIE1bits.SSPIE))
  {						
    PIR1bits.SSPIF = 0;     
    Interrupt_SSP();
  }

*/
}