/** * Imposta l'ora del kernel, aggiornata dal pit */ static void clock_callback(regs_t *r) { clock_data.hours = clock_get_hours(); clock_data.minutes = clock_get_minutes(); clock_data.seconds = clock_get_seconds(); clock_data.month = clock_get_month(); clock_data.year = clock_get_year(); clock_data.day = clock_get_day(); }
void high_isr(void){ /* TIMER 0 INTERRUPT HANDLING */ // T0IF generates the interrupt for the internal clock // TMR0 expires every 125 ms if (INTCONbits.TMR0IF) { WriteTimer0(TMR0_VAL); clock_increment(); if (clock_get_seconds()==0){ check_timer_table = 1; } INTCONbits.TMR0IF = 0; } /* USART RX INTERRUPT HANDLING */ if (PIR1bits.RCIF==1){ process_uart(ReadUSART()); PIR1bits.RCIF = 0; } return; }