ok got it working... sort of.
still having some issues.
Code: Select all
EEPROM.PageBase0 = 0x0801F000;
EEPROM.PageBase1 = 0x0801F400;
EEPROM.PageSize = 0x400;
placing at what i thought would be the last KB of memory in the program. As I was wrong to assume the library partitions off the storage from the program space. So as long as my program doesnt feel the whole memory space up it should be safe...
However. i have some code thats meant to store touch screen config data.
Code: Select all
if (((EEPROM.read(0) >> 8) != 0x7c))
{
GD.self_calibrate();
for (int i = 0; i < 12; i++)
{
if (i == 0)
{
EEPROM.write(0, ((0x7c << 8) | GD.rd(REG_TOUCH_TRANSFORM_A)));
}
else
{
EEPROM.write(i, GD.rd( ((REG_TOUCH_TRANSFORM_A + (i * 2)) << 8) | GD.rd(REG_TOUCH_TRANSFORM_A + (i * 2) + 1)));
}
}
}
else
{
for (int i = 0; i < 12; i++)
{
if (i == 0)
{
GD.wr(REG_TOUCH_TRANSFORM_A + (1), (EEPROM.read(0)) & 0xff);
}
else
{
GD.wr(REG_TOUCH_TRANSFORM_A + (i * 2),(EEPROM.read(i) >> 8 & 0xff));
GD.wr(REG_TOUCH_TRANSFORM_A + (i * 2) + 1,(EEPROM.read(i) & 0xff));
}
}
}
}
but when loaded the config data is coming back wrong and the touch screen not accurate. The commented out code is the original loop, where as I took the 8bit data and reworked it to fit the 16bit data address blocks...
But I decided to hard code a few values and the data isnt being stored where I expected and its confusing me...
The data isnt going where i expected. There seems to be loads of header space.... Is something wrong?
Just a dogs body developer, mostly making props and stuff...