| aPad_ReadInt | Index |
Definition:
Parameters:
| x | - | The index of the high byte of the int to be retrieved from the scratch pad. |
Return Value:
Description:
This routine retrieves an 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 and 2.0 modules have 56 bytes of scratch pad RAM. This allows storage of up to 28 int values. Because an int is 2 bytes, valid indexes for storing and retrieving an int are 0-54. The index does not have to be an even number. (Some firmware versions may require an even index. )
Example:
n = aPad_ReadInt(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.
Related: