demo: CSV rofreq

parent d2dfdee6
...@@ -27,9 +27,9 @@ static volatile struct TDC_WB *tdc = (void *)0xa0000000; ...@@ -27,9 +27,9 @@ static volatile struct TDC_WB *tdc = (void *)0xa0000000;
void rofreq() void rofreq()
{ {
int channel;
int val; int val;
int last; int last;
int t;
/* reset into debug mode, so this will always work */ /* reset into debug mode, so this will always work */
tdc->DCTL = TDC_DCTL_REQ; tdc->DCTL = TDC_DCTL_REQ;
...@@ -37,14 +37,13 @@ void rofreq() ...@@ -37,14 +37,13 @@ void rofreq()
while(!(tdc->DCTL & TDC_DCTL_ACK)); while(!(tdc->DCTL & TDC_DCTL_ACK));
while(!readchar_nonblock()) { while(!readchar_nonblock()) {
temp(); t = gettemp();
channel = 0; printf("%d.%04d", t/16, (t%16)*625);
do { do {
tdc->FCC = TDC_FCC_ST; tdc->FCC = TDC_FCC_ST;
while(!(tdc->FCC & TDC_FCC_RDY)); while(!(tdc->FCC & TDC_FCC_RDY));
val = tdc->FCR; val = tdc->FCR;
printf("CHANNEL %d: %d\n", channel, val); printf(",%d", val);
channel++;
last = tdc->CSEL & TDC_CSEL_LAST; last = tdc->CSEL & TDC_CSEL_LAST;
tdc->CSEL = TDC_CSEL_NEXT; tdc->CSEL = TDC_CSEL_NEXT;
} while(!last); } while(!last);
......
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