AllJoyn/Samples/BACnetAdapter/bacnet-stack-0.8.2/ports/xplained/timer1.c
static void my_callback(void)
{
    uint32_t now, t, interval, i;

    Millisecond_Counter++;
    now = Millisecond_Counter;
    for (i = 0; i < TIMER_CALLBACK_MAX; i++) {
        /* check for callback */
        if (Callback_Data[i].callback) {
            t = Callback_Data[i].milliseconds;
            if (now >= t) {
                Callback_Data[i].callback();
                interval = Callback_Data[i].interval;
                if (interval) {
                    Callback_Data[i].milliseconds = now + interval;
                } else {
                    /* disable any one-shot timers */
                    Callback_Data[i].callback = NULL;
                }
            }            
        }
    }        
}
/**
 * Handles the interrupt from the timer
 */
Handles the interrupt from the timer
Handles the interrupt from the timer
static void my_callback(void)
{
    uint32_t now, t, interval, i;
    Millisecond_Counter++;
    now = Millisecond_Counter;
    for (i = 0; i < TIMER_CALLBACK_MAX; i++) {
        if (Callback_Data[i].callback) {
            t = Callback_Data[i].milliseconds;
            if (now >= t) {
                Callback_Data[i].callback();
                interval = Callback_Data[i].interval;
                if (interval) {
                    Callback_Data[i].milliseconds = now + interval;
                } else {
                    Callback_Data[i].callback = NULL;
                }
            }            
        }
    }        
}
static void my_callback ( void ) { uint32_t now , t , interval , i ; Millisecond_Counter ++ ; now = Millisecond_Counter ; for ( i = 0 ; i < TIMER_CALLBACK_MAX ; i ++ ) { if ( Callback_Data [ i ] . callback ) { t = Callback_Data [ i ] . milliseconds ; if ( now >= t ) { Callback_Data [ i ] . callback ( ) ; interval = Callback_Data [ i ] . interval ; if ( interval ) { Callback_Data [ i ] . milliseconds = now + interval ; } else { Callback_Data [ i ] . callback = NULL ; } } } } }
Handles the interrupt from the timer
Handles the interrupt from the timer
/* check for callback */ /* disable any one-shot timers */