diff --git a/source/lib/hal_mcu/hal_fr5_timer.c b/source/lib/hal_mcu/hal_fr5_timer.c index 2bc3fbf5bda4f4974fbbd0f9084165205ef74735..2081775785216e1de2ff9751f82ce5c34316555a 100644 --- a/source/lib/hal_mcu/hal_fr5_timer.c +++ b/source/lib/hal_mcu/hal_fr5_timer.c @@ -289,13 +289,15 @@ unsigned int hal_timer_wait(unsigned int time) { * @return void * */ -HAL_ISR_FUNC_DECLARATION(timer_a1_isr,TIMER_A0){ +//HAL_ISR_FUNC_DECLARATION(timer_a1_isr,TIMER0_A0){ +void __attribute__((interrupt(TIMER0_A0_VECTOR),used)) timer_a1_isr(void){ //#pragma vector=TIMERA0_VECTOR //__interrupt void TIMERA0_ISR(void) { /* Any access, read or write, of the TBIV register automatically * resets the highest "pending" interrupt flag. */ - switch( __even_in_range(TAIV,14) ) { + P1OUT ^= BIT1; + switch( __even_in_range(TA0IV,14) ) { case TA0IV_NONE: break; // No interrupt case TA0IV_TACCR1: // Used to wake up radio from sleep timer_event = TA0IV_TACCR1; diff --git a/source/test/min2.c b/source/test/min2.c index d3ce675d682a86ed57a421115a784261144c2d7f..9f60a9e91a892b0c306e454b4047fb8470aadcd4 100644 --- a/source/test/min2.c +++ b/source/test/min2.c @@ -70,7 +70,24 @@ void main (void) idle_counter=main_time_counter; ee_printf("Cnt:%3i\n\r", idle_counter); ee_printf("TA0CCR:0x%4X\n\r", TA0R); - _delay_us(100000); + //Allow the UART to finish + _delay_us(1736); + //Toggle LED, wait Toggle again + P1OUT ^= BIT1; + TA0R = 1; + TA0CCTL1 = CCIE; // interrupt enabled + _BIS_SR(LPM0_bits + GIE); // Enter LPM0 + + // while(get_reset_timer_wake_event()==0){ + // NOP(); + // //_BIS_SR(LPM0_bits + GIE); // Enter LPM0 + // } + //We've exited by some means this LPM0 + P1OUT ^= BIT0; + + } + if(idle_counter>10){ + //Use LPM0 For sleep } } }