does GETPTR only work with streamer?
Rayman
Posts: 14,646
GETPTR doesn't seem to be working like I'd like...
I'm trying to use it with a wflong loop, to mark where a trigger occurred...
When I search here for info, I just see stuff about using it with the streamer...
As a test, I did this:
I would have expected that d1 would have same value as pBuf, put it doesn't. Looks at it is pointing to where it would wrap.
But, in real code it just seems to give quasi random values...
I'm trying to use it with a wflong loop, to mark where a trigger occurred...
When I search here for info, I just see stuff about using it with the streamer...
As a test, I did this:
wrfast #nBlocks/2,pBuf 'we keep writing to buffer in a loop until triggered and then read a bit more getptr d1
I would have expected that d1 would have same value as pBuf, put it doesn't. Looks at it is pointing to where it would wrap.
But, in real code it just seems to give quasi random values...
Comments
GETPTR just increments according to RFBYTE/RFWORD/RFLONG. It doesn't wrap. I tried to make it wrap, but it was very complicated, so I didn't do it.
Only RFxxxx, not WFxxxx?
Whoops! Both reads and writes work.
I guess the math is easy with a buffer size like $1000
The AND operation above gets you position in buffer.