Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
/*****************************************************************
* functions *
*****************************************************************/
void TBLWRPOSTINC_Func (void)
{ _asm TBLWTPOSTINC _endasm }
void TBLRDPOSTDEC_Func (void)
{ _asm TBLRDPOSTDEC _endasm }
void TBLRDPOSTINC_Func (void)
{ _asm TBLRDPOSTINC _endasm }
void TBLWR_Func (void)
{ _asm TBLWT _endasm }
/*****************************************************************
* erase, write, and verify buffer (64 code or 8 IDLOC bytes) *
*****************************************************************/
void Write_Buffer (void)
{ if (Row_Count) // don't write an empty buffer
{ Set_TBLPTR (); // erase 64 byte 'row'
Write (0b10010100); // EEPGD=1/CFGS=0/FREE=1/WREN=1
for (x=0; x<Row_Count; x++) // write 64 byte 'row'
{ TABLAT = Row_Buffer[x];
TBLWRPOSTINC_Func (); //
}
TBLRDPOSTDEC_Func (); // fix TBLPTR, do "long write"
Write (0b10000100); // EEPGD=1/CFGS=0/FREE=0/WREN=1
Set_TBLPTR (); // verify 64 byte 'row'
for (x=0; x<Row_Count; x++)
{ TBLRDPOSTINC_Func ();
if (TABLAT != Row_Buffer[x])
{ Error_Flag = 0x04; // indicate verify error
}
Row_Buffer[x] = 0xFF; // reset row buffer byte to FF
}
Row_Count = 0; // indicate row buffer empty
}
}