Hi,
As far as I've seen, when you create a timer (or ticker or timeout) it is put in the timer3 group. You can lower the priority of this group by doing 
NVIC_SetPriority(TIMER3_IRQn, 1);
However, I want the one timer to have a different priority than the other. How do I do this? Can I set the priority individualy somehow? Or should I declare the other timer in the TIMER2_IRQn group somehow?
Thanks in advance!
Melchior
Edit: I would very much like to keep the timer.attach() functionality :p
Edit2: I currently have something like:
 
void TIMER0_init(void)
{ 
    LPC_SC->PCONP |= 1<<1; // Timer0 Power On
    LPC_TIM0->MR0 = 2398;  // Match count for 100uS
    LPC_TIM0->MCR = 3;     // Interrupt and Reset on Match
    LPC_TIM0->TCR = 1;     // Enable Timer0
    testing.printf("TIMER0 initialized.\r\n");
}
extern "C" void TIMER0_IRQHandler(void)
{ // send a message every 2398 ms
    testing.printf("TIMER0_IRQHandler is live!\r\n");
}
int main() 
{
    NVIC_SetVector(TIMER0_IRQn,uint32_t(TIMER0_IRQHandler));
    TIMER0_init();
    NVIC_SetPriority(TIMER0_IRQn, 2);
    while(1) 
    {
        setdata(0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00);
        if(can.write(CANMessage((1792+node_id),candata,1))) 
        {
            canact=!canact;
        }
        wait(1); // send a bootup message every second
    }
}
Which does nothing. (interrupt wise)
                    
                 
                
             
        
Hi,
As far as I've seen, when you create a timer (or ticker or timeout) it is put in the timer3 group. You can lower the priority of this group by doing
NVIC_SetPriority(TIMER3_IRQn, 1);
However, I want the one timer to have a different priority than the other. How do I do this? Can I set the priority individualy somehow? Or should I declare the other timer in the TIMER2_IRQn group somehow?
Thanks in advance!
Melchior
Edit: I would very much like to keep the timer.attach() functionality :p
Edit2: I currently have something like:
void TIMER0_init(void) { LPC_SC->PCONP |= 1<<1; // Timer0 Power On LPC_TIM0->MR0 = 2398; // Match count for 100uS LPC_TIM0->MCR = 3; // Interrupt and Reset on Match LPC_TIM0->TCR = 1; // Enable Timer0 testing.printf("TIMER0 initialized.\r\n"); } extern "C" void TIMER0_IRQHandler(void) { // send a message every 2398 ms testing.printf("TIMER0_IRQHandler is live!\r\n"); } int main() { NVIC_SetVector(TIMER0_IRQn,uint32_t(TIMER0_IRQHandler)); TIMER0_init(); NVIC_SetPriority(TIMER0_IRQn, 2); while(1) { setdata(0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00); if(can.write(CANMessage((1792+node_id),candata,1))) { canact=!canact; } wait(1); // send a bootup message every second } }Which does nothing. (interrupt wise)