backup_sram_write()
Description
Writes to SRAM specific memory address. To use this function user must add #include <backup_sram>.
Syntax
backup_sram_write(address, value);
Parameters
Variable | Input |
|---|---|
| Any address number from 1 to 10. |
| Variable or 32-bit value to be written in SRAM. |
Returns
Return value | Return explanation |
SCRIPT_OPERATION_SUCCESS | Successful SRAM write operation. |
SCRIPT_OPERATION_FAILED | Failed to write to SRAM. |
SCRIPT_PARAM_INVALID | Invalid parameters. This error indicates that one or more of the arguments are not valid. |
Function call example
#include <io>
#include <read>
#include <float>
#include <string>
#include <core>
#include <write>
#include <define>
#include <socket>
#include <backup_sram>
#define VARIABLE_ID 1
#define NUMBER_ID 2
new sram_variable = 0;
main()
{
backup_sram_write(NUMBER_ID, 300000);
for(;;)
{
sram_variable++;
backup_sram_write(VARIABLE_ID, sram_variable);
Delay(100);
}
}