| aBus_ReadPadInt | Index |
Definition:
Parameters:
| cModule | - | The address of the remote module you want to read a value from. |
| cIndex | - | The index of the high byte of the int to be retrieved from the remote scratch pad. |
Return Value:
Description:
This routine retrieves a int value from the scratch pad. An int takes up two bytes in the scratch pad. The bytes are stored in high-byte low-byte order. The index x is the address of the high byte.
The scratch pad is accessible by all processes and reflexes. It provides a convenient means for parameter passing between processes and reflexes and is more efficient than using semaphores. It is the user's responsibility to keep track of scratch pad locations and prevent overwriting of data.
The GP 1.0 module has 32 bytes of scratch pad RAM. It can store up to 16 int values. Because an int is 2 bytes, valid indexes for storing and retrieving an int are 0-30. The index does not have to be an even number. (Some firmware versions may require an even index. )
When the desired scratchpad is on the Brainstem that is running the routine, it is more efficient to use the aPad_ReadInt routine.
| Note: | This routine is available in builds later than build 60323. |
Example:
n = aBus_ReadPadInt(2,0);
This would return an int whose high byte is stored at location 0 and whose low byte is stored at location 1 in scratch pad RAM on a module with address of 2.
Related: