예제 #1
0
void Button_debounce() {
   //disable switch interrupts
   Button_interruptDisable();
   //start timer to reenable switch after 250ms
   msp430_clock_init();
   msp430_register_timer_cb(Button_interruptEnable, 500, 0);
}
예제 #2
0
void Button_debounce() {
   //disable switch interrupts
   Button_interruptDisable();
   //start timer to reenable switch after 250ms
   TA1CCR0 = 8192;                     //250ms
   TA1CCTL0 = CCIE;
   TA1CTL = TASSEL_1 + MC_1 + TACLR;   //ACLK, continuous mode, clear TBR
}