Part Number: MSP432P401R
Hi there,
When I debug using `printf` the ISRs associated with Pin6.1 and Pin5.0 do not get triggered. However, when I comment out `printf` the ISRs work as expected. Thank you very much for your support!
void tachometer_init(void(*userTaskLeft)(void), void(*userTaskRight)(void) ){
//setup the hooks for the tachometers ISRs
taskLeft = userTaskLeft;
taskRight = userTaskRight;
// configure pin 6.1 as input and enable interrupt
P6->SEL0 &= ~(BIT1);
P6->SEL1 &= ~(BIT1);
P6->DIR &= ~(BIT1);
P6->IFG &= ~(BIT1);
P6->IES &= ~(BIT1);
P6->IE |= (BIT1);
NVIC->IP[10] &= (NVIC->IP[10] &0xFFFFFF00 )|0x00000020;
NVIC->ISER[1] = 1 << (PORT6_IRQn & 31);
// configure pin 5.0 as input and enable interrupt
P5->SEL0 &= ~(BIT0);
P5->SEL1 &= ~(BIT0);
P5->DIR &= ~(BIT0);
P5->IFG &= ~(BIT0);
P5->IES &= ~(BIT0);
P5->IE |= (BIT0);
NVIC->IP[9] &= (NVIC->IP[9] &0x00FFFFFF)|0x20000000;
NVIC->ISER[1] = 1 << (PORT5_IRQn & 31);
}
void PORT6_IRQHandler(void){
if(P6->IFG & BIT1){
P6->IFG &= ~BIT1;
// execute user hook
(*taskLeft)();
}
}
void PORT5_IRQHandler(void){
if(P5->IFG & BIT0){
P5->IFG &= ~BIT0;
// execute user hook
(*taskRight)();
}
}
// debugging code
uint16_t static printf_flag=50;
printf_flag--;
if(printf_flag==49){
printf("x=%.4f y=%.4f theta=%.4f\n",x,y, theta);
printf_flag=50;
}