I am trying to measure the time between 2 interrupts (about 8 msec apart). I get stuck forever in my "while (zcrsv_flag==0)" statement. I do get the interrupts and the flag gets set. If I comment out the "while" statements the program runs but of course the measurement is inaccurate.
timer.reset();
zcrsv_flag = 0;
LPC_GPIOINT->IO2IntEnF |= 0x00000020; Enable zcrsv int
while (zcrsv_flag == 0);
LPC_GPIOINT->IO2IntEnF &= 0xFFFFDF; Disable zcrs int
timer.start();
zcrsv_flag=0;
LPC_GPIOINT->IO2IntEnF |= 0x00000020; Enable zcrsv int
while (zcrsv_flag==0);
LPC_GPIOINT->IO2IntEnF &= 0xFFFFCF; Disable zcrs int
timer.stop();
void
zcrsv_handler(void)
{
LPC_GPIOINT->IO2IntEnF &= 0xFFFFDF; Disable zcrsv int
printf("z");
zcrsv_flag=1;
return;
}end zcrsv_handler
Sorry. I don't know why the listing above is messed up.
I tried putting in single character printfs but they also don't work if the "whiles" are in the code. Even printfs that are at the very beginning of the program will not print???
I am trying to measure the time between 2 interrupts (about 8 msec apart). I get stuck forever in my "while (zcrsv_flag==0)" statement. I do get the interrupts and the flag gets set. If I comment out the "while" statements the program runs but of course the measurement is inaccurate.
timer.reset(); zcrsv_flag = 0; LPC_GPIOINT->IO2IntEnF |= 0x00000020; Enable zcrsv int while (zcrsv_flag == 0); LPC_GPIOINT->IO2IntEnF &= 0xFFFFDF; Disable zcrs int timer.start(); zcrsv_flag=0; LPC_GPIOINT->IO2IntEnF |= 0x00000020; Enable zcrsv int while (zcrsv_flag==0); LPC_GPIOINT->IO2IntEnF &= 0xFFFFCF; Disable zcrs int timer.stop();
void zcrsv_handler(void) { LPC_GPIOINT->IO2IntEnF &= 0xFFFFDF; Disable zcrsv int printf("z"); zcrsv_flag=1; return; }end zcrsv_handler
Sorry. I don't know why the listing above is messed up.
I tried putting in single character printfs but they also don't work if the "whiles" are in the code. Even printfs that are at the very beginning of the program will not print???