diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/idm-ringbuffer/ringbuffer.c | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/tools/idm-ringbuffer/ringbuffer.c b/tools/idm-ringbuffer/ringbuffer.c index c4e6373..0baa2a3 100644 --- a/tools/idm-ringbuffer/ringbuffer.c +++ b/tools/idm-ringbuffer/ringbuffer.c @@ -88,17 +88,6 @@ void rbuf_next() } } -void beginRead() -{ - spiData = underrun ? -1 : *readPtr; -} - -void endRead() -{ - *readPtr = 0; - rbuf_next(); -} - void timer2Interrupt() { static char value = 0; @@ -111,11 +100,12 @@ void timer2Interrupt() void sspInterrupt() { if (cmd_read && spiData == 0) { - endRead(); - beginRead(); + *readPtr = 0; + rbuf_next(); + spiData = underrun ? -1 : *readPtr; } else if (spiData == 'r') { cmd_read = TRUE; - beginRead(); + spiData = underrun ? -1 : *readPtr; } else { cmd_read = FALSE; printf("%s\n", "I don't like you!"); |