PIC32MX150F256L Graphics Reinitialize
I have a project that uses a PIC32MX150F256L with LCC driver to control a 4.3" touch screen. It uses V1.11 Harmony Stack.
After long periods of run time the device stops being able to display text any widget that displays text. I've put in a support case, not received any help from the tech or graphics engineer that was on the case.
What I've determined:
- The schemes are in-tact when the issue happens
- Font's still exist in program memory
- Characters I'm attempting to print exist in the range of the font and are null terminated
I've also found some major flaws in the Harmony graphics stack that should be made aware of.
1.
gfx_primitive.c -GFX_TextCharDraw // make sure characters are printable
if(pFont == NULL)
statusBit = GFX_STATUS_ERROR_BIT;
else if((GFX_UXCHAR)ch < (GFX_UXCHAR)pFont->resource.font.header.firstChar)
statusBit = GFX_STATUS_ERROR_BIT;
else if((GFX_UXCHAR)ch > (GFX_UXCHAR)pFont->resource.font.header.lastChar)
statusBit = GFX_STATUS_ERROR_BIT;
#ifdef GFX_CONFIG_FONT_ANTIALIASED_DISABLE
else if(pFont->resource.font.header.bpp > 1)
statusBit = GFX_STATUS_ERROR_BIT;
#endif
if (statusBit == GFX_STATUS_ERROR_BIT)
return GFX_STATUS_SUCCESS;
else
state = TC_GET_INFO;
You can clearly see that if there is a failure while attempting to print the character, this function will return success.
2.
gfx_gol.c -
GFX_GOL_Tasks switch ( obj->task )
{
case GFX_GOL_TASK_STATE_OPEN_MODULE:
break;
case GFX_GOL_TASK_STATE_RUNNING:
/* process list of objects */
GFX_GOL_ObjectListDraw(index);
break;
}
GFX_GOL_ObjectListDraw(index) calls the draw function associated with each gfx widget. Any widget that requires text will eventually call the GFX_TextCharDraw for each character to draw, which is the function above that doesn't return the correct value. Here inside the GFX_GOL_Tasks, the return status of whether or not an object drew is not checked.
If the return status of the ObjetListDraw function is a failure, I'd like to safely reinitialize the graphics stack. I cannot find any documentation on doing this.
Has anyone done this?