Skip to content
Snippets Groups Projects
Commit 6cb7d807 authored by Edward Longman's avatar Edward Longman
Browse files

Fix timer interrupt so it is not always blocking and remove UART delay

parent 2aa5fe3e
No related branches found
No related tags found
No related merge requests found
......@@ -290,7 +290,7 @@ unsigned int hal_timer_wait(unsigned int time) {
*
*/
//HAL_ISR_FUNC_DECLARATION(timer_a1_isr,TIMER0_A0){
void __attribute__((interrupt(TIMER0_A0_VECTOR),used)) timer_a1_isr(void){
void __attribute__((interrupt(TIMER0_A1_VECTOR),used)) timer_a1_isr(void){
//#pragma vector=TIMERA0_VECTOR
//__interrupt void TIMERA0_ISR(void) {
......@@ -304,7 +304,7 @@ void __attribute__((interrupt(TIMER0_A0_VECTOR),used)) timer_a1_isr(void){
_BIC_SR_IRQ(LPM3_bits); // Clear LPM3 bits from 0(SR)
break;
case TA0IV_TACCR2: // Use as secondary timer function
timer_event = TA0IV_TACCR2;
timer_event = TA0IV_TACCR2;
_BIC_SR_IRQ(LPM3_bits); // Clear LPM3 bits from 0(SR)
break;
/* case TA0IV_TACCR3: // CCR3 not used
......
......@@ -57,7 +57,6 @@ void main (void)
// Setup the timer
hal_timer_init(0xFFFF);
P1DIR |= BIT0 | BIT1;
P1OUT |= BIT0 | BIT1;
__enable_interrupt();
......@@ -70,20 +69,16 @@ void main (void)
idle_counter=main_time_counter;
ee_printf("Cnt:%3i\n\r", idle_counter);
ee_printf("TA0CCR:0x%4X\n\r", TA0R);
//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;
/*while(get_reset_timer_wake_event()==0){
NOP();
P3OUT |= BIT4;
//_BIS_SR(LPM0_bits + GIE); // Enter LPM0
}*/
}
if(idle_counter>10){
......@@ -111,5 +106,4 @@ HAL_ISR_FUNC_DECLARATION(wdt_isr,WDT)
main_time_counter++;
/* global "0.5 second" counter used for printing time stamped packet sniffer data */
P1OUT ^= BIT0;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment