aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormichael-west <michael.west@ettus.com>2016-06-16 10:17:24 -0700
committerMartin Braun <martin.braun@ettus.com>2016-06-16 18:46:07 -0700
commit86630133e42592b045823903a5db9618e9576a1c (patch)
tree0466f66c8ba6f0f03c3d4603275a4468951060f8
parentd53fd56c70531aa1cc7feaa5a3dffdb130bb2e95 (diff)
downloaduhd-86630133e42592b045823903a5db9618e9576a1c.tar.gz
uhd-86630133e42592b045823903a5db9618e9576a1c.tar.bz2
uhd-86630133e42592b045823903a5db9618e9576a1c.zip
Octoclock: Fix off by one errors in uart code
-rw-r--r--host/lib/usrp_clock/octoclock/octoclock_uart.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/host/lib/usrp_clock/octoclock/octoclock_uart.cpp b/host/lib/usrp_clock/octoclock/octoclock_uart.cpp
index f366bac30..4d02aad3b 100644
--- a/host/lib/usrp_clock/octoclock/octoclock_uart.cpp
+++ b/host/lib/usrp_clock/octoclock/octoclock_uart.cpp
@@ -137,7 +137,7 @@ namespace uhd{
//We may have wrapped around locally
if(_state.pos == 0) _state.num_wraps++;
}
- _state.pos = (_state.pos+1) % _poolsize;
+ if (_cache[_state.pos] == '\n') _state.pos = (_state.pos+1) % _poolsize;
//We may have wrapped around locally
if(_state.pos == 0) _state.num_wraps++;
}
@@ -145,7 +145,7 @@ namespace uhd{
}
char octoclock_uart_iface::_getchar(){
- if(LOCAL_STATE_AHEAD){
+ if(STATES_EQUAL or LOCAL_STATE_AHEAD){
return 0;
}