/*---------------------------------------------------------------------------*/ static int irq(void) { if(BUTTON_CHECK_IRQ()) { if(timer_expired(&debouncetimer)) { timer_set(&debouncetimer, CLOCK_SECOND / 4); sensors_changed(&button_sensor); return 1; } } return 0; }
irq_p2(void) { ENERGEST_ON(ENERGEST_TYPE_IRQ); if(BUTTON_CHECK_IRQ()) { if(timer_expired(&debouncetimer)) { timer_set(&debouncetimer, CLOCK_SECOND / 4); sensors_changed(&button_sensor); LPM4_EXIT; } } //Added by Atena as the ISR for P2.3 which will be connected to the precipitation sensor with pulse output //***************************************************************************************** if(P2IFG & BIT3){ pulses++; P2IFG = 0x00; ENERGEST_OFF(ENERGEST_TYPE_IRQ); } }