This is about a college project which is giving us a lot of headaches, so we have a "central computer unit" to handle the modules added to the project via wifi, that part is not the real problem, the user interface is, we are using Adafruit's HX8357D 3.5 TFT with touch, thou touch is still not working because we are awaiting the STMPE controller for the SPI on the touch
For building the GUI, we used GUISlice, with Adafruit's GFX and HX8357 driver, it took a bit of time, but trough the examples we made it work. Most of the software is divided by classes in our program, however for some strange I cannot identify, the block handles the GUISlice stuff cannot be made into a class, the variables have to be global, on my testing, when the variables are global, they appear okay in the screen, but when they are class attributes, even static ones, they appear mirroed and with negative colors, I guess the memory region where they are saved is written in reverse byte order maybe??? I don't know, but it worked with the global variables, and I was able to create a line, and two text strings, then I tried to add a button, but the screen stop updating, and then I removed the button, but the problem persisted, from that point on, my code stopped working on the TFT, and I don't know why, the example codes from GUISlice work well, but mine doesn't...
It keeps throwing the exception (29)
ets Jan 8 2013,rst cause:2, boot mode:(3,6)
load 0x4010f000, len 1384, room 16
tail 8
chksum 0x2d
csum 0x2d
vbb28d4a3
~ld
Exception (29):
epc1=0x40201efb epc2=0x00000000 epc3=0x00000000 excvaddr=0x0000001e depc=0x00000000
ctx: cont
sp: 3ffffd60 end: 3fffffd0 offset: 01a0
>>>stack>>>
3fffff00: 00000080 00000008 3fff19f0 40207b60
3fffff10: 00000080 00000001 00000005 401065b5
3fffff20: 3fff18ec 000000a0 3fff19f0 40207ac3
3fffff30: 3fff18ec 000000a0 3fff19f0 40208218
3fffff40: 3f000000 3fff19f0 3fff18f8 40204c1f
3fffff50: 00000000 014001e0 3fff18f8 40201ef4
3fffff60: 00012480 00000001 3fff18f8 3fff1fbc
3fffff70: 3fffdad0 3fff18f8 00000000 40204512
3fffff80: 3f000000 00000001 3fff1efc 40208b48
3fffff90: 00012480 00000000 3fff1fb4 40203f91
3fffffa0: feefeffe 00000000 3fff1fb4 40204960
3fffffb0: feefeffe feefeffe feefeffe 40209388
3fffffc0: feefeffe feefeffe 3ffe85e0 40100739 Memory definitions:
size: 4M with 1M SPIFFS
mode: QIO
freq: 40 MHz
So we have a class resposible for handling all blocks together and the block responsible for the interface separated like this:
Cnt.cpp
#include "Cnt.h"
#include "CntIC.h"
namespace Controller
{
gslc_tsGui _gui;
gslc_tsDriver _drv;
gslc_tsFont _fonts[CON_CONF_FONTS];
gslc_tsPage _pages[CON_CONF_PAGES];
gslc_tsElem _mainPageElems[CON_CONF_MAIN_PAGE_ELEMS];
gslc_tsElemRef _mainPageElemRefs[CON_CONF_MAIN_PAGE_ELEMS];
bool Cnt::bootupHandler()
{
ic_bootup();
return true;
}
}
CntIC.cpp
#include "CntIC.h"
namespace Controller
{
gslc_tsElemRef* _elemRef;
bool _lockEnable;
enum pageGui _currentPage;
void ic_bootup()
{
_elemRef = NULL;
_lockEnable = false;
title[0] = '\0';
// Init
gslc_Init(&_gui, &_drv, _pages, CON_CONF_PAGES, _fonts, CON_CONF_FONTS);
gslc_FontAdd(&_gui, CON_MAIN_FONT, GSLC_FONTREF_PTR, NULL, 2);
gslc_SetBkgndColor(&_gui, GSLC_COL_BLACK);
//ic_mainPageSetup();
ic_changePage(CON_MAIN_PAGE);
}
void ic_update()
{
gslc_Update(&_gui);
}
}
CntIC.h
#ifndef _CNTIC_H_
#define _CNTIC_H_
#include "GUIslice.h"
#include "GUIslice_ex.h"
#include "GUIslice_drv.h"
#define CON_CONF_FONTS 1
#define CON_CONF_PAGES 6
#define CON_CONF_MAIN_PAGE_ELEMS 16
#define CON_CONF_TEXT_COLS 25
#define CON_CONF_TEXT_ROWS 1
namespace Controller
{
extern gslc_tsGui _gui;
extern gslc_tsDriver _drv;
extern gslc_tsFont _fonts[CON_CONF_FONTS];
extern gslc_tsPage _pages[CON_CONF_PAGES];
extern gslc_tsElem _mainPageElems[CON_CONF_MAIN_PAGE_ELEMS];
extern gslc_tsElemRef _mainPageElemRefs[CON_CONF_MAIN_PAGE_ELEMS];
extern gslc_tsXTextbox _titleTextBox;
enum fontGui {CON_MAIN_FONT};
enum pageGui {CON_MAIN_PAGE, CON_SETTINGS_PAGE, CON_MODULES_PAGE, CON_MODULE_CONF_PAGE, CON_MODULE_STAT_PAGE, CON_STATS_PAGE, CON_KEYBOARD_PAGE};
enum elemGeneralGui {PAGE_TITLE, PAGE_SEPARATOR, PAGE_ID, PAGE_WIFI};
enum elemMainPageGui {MAIN_POWER_LABEL = 4, MAIN_POWEL_VALUE, MAIN_POWER_REF, MAIN_POWER_BAR, MAIN_SETTINGS, MAIN_NETWORK, MAIN_MODULES, MAIN_STATISTICS};
void ic_bootup();
void ic_update();
void ic_changePage(enum pageGui page);
}
#endifI do believe the problem is arround these parts, there is more code, but right now, most is commented out for testing purposes, or caused no visible changes before and after the problem, thank you in advance for any help and tell me if more data is required