demo: dump raw measurements

parent ba44ce28
...@@ -221,6 +221,7 @@ static void do_command(char *c) ...@@ -221,6 +221,7 @@ static void do_command(char *c)
/* payload */ /* payload */
else if(strcmp(token, "rofreq") == 0) rofreq(); else if(strcmp(token, "rofreq") == 0) rofreq();
else if(strcmp(token, "calinfo") == 0) calinfo(); else if(strcmp(token, "calinfo") == 0) calinfo();
else if(strcmp(token, "mraw") == 0) mraw();
else if(strcmp(token, "") != 0) else if(strcmp(token, "") != 0)
printf("Command not found\n"); printf("Command not found\n");
......
...@@ -93,3 +93,20 @@ void calinfo() ...@@ -93,3 +93,20 @@ void calinfo()
tdc->DCTL = 0; tdc->DCTL = 0;
} }
void mraw()
{
if(!(tdc->CS & TDC_CS_RDY)) {
printf("Startup calibration not done\n");
return;
}
tdc->EIC_IER = TDC_EIC_IER_IE0;
while(1) {
while(!(tdc->EIC_ISR & TDC_EIC_ISR_IE0)) {
if(readchar_nonblock()) return;
}
printf("%d[%d]\n", tdc->RAW0, tdc->POL & 0x01);
tdc->EIC_ISR = TDC_EIC_ISR_IE0;
}
}
...@@ -21,5 +21,6 @@ ...@@ -21,5 +21,6 @@
void rofreq(); void rofreq();
void calinfo(); void calinfo();
void mraw();
#endif /* __TDC_H */ #endif /* __TDC_H */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment