Subject:
|
Re: Using NXT Port 4 EIA-485
|
Newsgroups:
|
lugnet.robotics.nxt
|
Date:
|
Tue, 10 Apr 2007 16:15:33 GMT
|
Viewed:
|
15940 times
|
| |
| |
In lugnet.robotics.nxt, John Barnes wrote:
> Do you know how large the OutBuf and InBuf are?
They are tiny.
#define SIZE_OF_HSBUF 128
typedef struct
{
UBYTE Buf[SIZE_OF_HSBUF];
UBYTE InPtr;
UBYTE OutPtr;
UBYTE Spare1;
UBYTE Spare2;
}HSBUF;
// HI Speed related entries
HSBUF HsInBuf;
HSBUF HsOutBuf;
The IOMap hi speed buffer is copied into the VarsComm structure's high speed
buffer like this:
void cCommSendHiSpeedData(void)
{
VarsComm.HsModuleOutBuf.OutPtr = 0;
for (VarsComm.HsModuleOutBuf.InPtr = 0; VarsComm.HsModuleOutBuf.InPtr <
IOMapComm.HsOutBuf.InPtr; VarsComm.HsModuleOutBuf.InPtr++)
{
VarsComm.HsModuleOutBuf.Buf[VarsComm.HsModuleOutBuf.InPtr] =
IOMapComm.HsOutBuf.Buf[IOMapComm.HsOutBuf.OutPtr];
IOMapComm.HsOutBuf.OutPtr++;
}
dHiSpeedSendData(VarsComm.HsModuleOutBuf.Buf, (VarsComm.HsModuleOutBuf.InPtr -
VarsComm.HsModuleOutBuf.OutPtr));
}
The HsModuleOutBuf.Buf is 256 bytes but there isn't any way exposed in the
standard NXT firmware to directly access this buffer. Also, the standard NXT
firmware limits the number of bytes that can be read or written using the
IOMapRead and IOMapWrite syscall functions to 64 bytes per call. Using my
enhanced version of the standard NXT firmware you can read and write up to 800
bytes per call and you can avoid the module search overhead by using the
IOMapReadByID and IOMapWriteByID syscall functions.
John Hansen
|
|
Message is in Reply To:
| | Re: Using NXT Port 4 EIA-485
|
| (...) Hi John. I must have misunderstood something I was told a while back which went along the lines of "there isn't enough time to implement support for this feature". Perhaps there was some time after all ;) Do you know how large the OutBuf and (...) (18 years ago, 9-Apr-07, to lugnet.robotics.nxt)
|
15 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|