You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While playing around with the library i found a small bug in the code.
I generated code for a ILI9844 display with the "LE SPI 4-Line" + "LE External Controller" Modules.
MPLabX 6.05, XC32 v4.21, GFX library v3.12.2 (Latest).
Bug:
drv_gfx_external_controller.c - DRV_ILI9488_Update() calls GFX_Disp_Intf_Open() from drv_gfx_disp_intf_spi4.c which normally returns a Pointer of type GFX_Disp_Intf.
On failure GFX_Disp_Intf_Open() returns -1.
But the DRV_ILI9488_Update() function checks for 0 (NULL) instead of -1.
Which later results in a data bus exception when the GFX_Disp_Intf_Write() function dereferences the -1 pointer.
Fix:
GFX_Disp_Intf_Open() should return 0 instead of -1 on failure which would be consistent with how invalid pointers are usually handled.
Personal opinion / coding style stuff:
The GFX_Disp_Intf type is typedef'd as a uint32_t which might be why it was confused for a handle instead of a pointer.
So maybe put a void* or uintptr_t there instead of uint32_t so it is 100% clear that this should be a pointer.
The text was updated successfully, but these errors were encountered:
While playing around with the library i found a small bug in the code.
I generated code for a ILI9844 display with the "LE SPI 4-Line" + "LE External Controller" Modules.
MPLabX 6.05, XC32 v4.21, GFX library v3.12.2 (Latest).
Bug:
drv_gfx_external_controller.c - DRV_ILI9488_Update() calls GFX_Disp_Intf_Open() from drv_gfx_disp_intf_spi4.c which normally returns a Pointer of type GFX_Disp_Intf.
On failure GFX_Disp_Intf_Open() returns -1.
But the DRV_ILI9488_Update() function checks for 0 (NULL) instead of -1.
Which later results in a data bus exception when the GFX_Disp_Intf_Write() function dereferences the -1 pointer.
Fix:
GFX_Disp_Intf_Open() should return 0 instead of -1 on failure which would be consistent with how invalid pointers are usually handled.
Personal opinion / coding style stuff:
The GFX_Disp_Intf type is typedef'd as a uint32_t which might be why it was confused for a handle instead of a pointer.
So maybe put a void* or uintptr_t there instead of uint32_t so it is 100% clear that this should be a pointer.
The text was updated successfully, but these errors were encountered: