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

Force the interrupt type for unkn. reason and setup main to trigger the timer...

Force the interrupt type for unkn. reason and setup main to trigger the timer for the first time, only gets to the first time and then sticks in LPM0,
parent b523dc2f
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
......@@ -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
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment