Buffer entries read back in reverse order
dbpage
Posts: 217
I created a byte buffer to help me track down a communication issue. Unfortunately, I am having trouble with my buffer. The buffer records up to 1153 bytes. Why does RxView display bytes in reverse order?
Note: SDA is an address that is initialized by another method. Buffer1 is an offset of 20 longs from @SDA. RxView displays only the Rx buffer.
Note: SDA is an address that is initialized by another method. Buffer1 is an offset of 20 longs from @SDA. RxView displays only the Rx buffer.
CON En = (Buffer1*4)+1280 ' bytes 1280-128+1=1153 bytes in Rx buffer St = (Buffer1*4)+128 ' bytes 128 bytes in Tx buffer VAR long n PUB RxStart n := En RxClear PUB RxClear bytefill(SDA+(Buffer1*4),0,1280) ' Clear buffer (includes 128-byte Tx buffer) PUB RxSave(c) if n =< St return byte[SDA][n--] := c if n < St n := En PUB RxView | i i := n-1 repeat 1153 if i < St i := En if (byte[SDA][i] < 32) or (byte[SDA][i] > 127) StrUSB(Format.hexstr(byte[SDA][i--],2)) CharUSB(" ") else CharUSB(byte[SDA][i--])
Comments
Issue resolved.