eeEmulClean — clearance of all the cells of read-only memory.

Description:

u8 eeEmulClean();

Clears all the cells of read-only memory of and returns the result of cleanse process.

Return values:

· Returns 0 if the error occurred when flushing the memory.

· Returns not 0 if the memory flush was successful.

Example:

<item addr="524:248" name="Test for eeEmulClean function" type="script">
V-ID/V-ADDR {
        	u8 addr = 1;
        	if(opt0()) {
                    	u8 testWriteVar = 41;
                    	u8 resultOfWrite = eeEmulWrite(addr, testWriteVar); 
                    	u8 strForMess[70]; 
                    	sprintf(strForMess, "%cValue %d", 1, testWriteVar);
                    	if(resultOfWrite != 0) {
                               		strcat(&strForMess, " recorded");
                    	} else {
                               		strcat(&strForMess, " not recorded");
                    	}
                    	sprintf(strForMess, "%s into a cell %d.", strForMess, addr);
                    	setStatus(@exciterId():32, &strForMess);
                    	u8 testClean = eeEmulClean();
                    	if(testClean != 0) {
        	                    	sprintf(strForMess, "%Memory is erased!", 8);
                    	} else {
                               		sprintf(strForMess, "%Memory is not erased!", 8);
                    	}
                    	setStatus(@exciterId():32, &strForMess);
                    	u8 testReadVar = 0;
                    	u8 resultOfRead = eeEmulRead(addr, &testReadVar);
                    	sprintf(strForMess, "%cС cells%d", 4, addr);
                    	if(resultOfRead != 0) {
                               		strcat(&strForMess, " is read");
                    	} else {
                               		strcat(&strForMess, "the value is not read!");
                               	return;
                    	}
                    	sprintf(strForMess, "%s value %d.", strForMess, testReadVar);
                    	setStatus(@exciterId():32, &strForMess);
        	}
}
</item>

The result of performing the example in the interface:

When clicking the element script in the interface the following messages will appear:

“Value 41 is stored to the cell 4” “The memory is erased!”