uGFX Port for Teensy 3 / ChibiOS available?

Status
Not open for further replies.
Hi Christoph!

I am curious if you have ever tried using Pixmaps with the SSD1351 in ugfx?
Whenever I add #define GDISP_NEED_PIXMAP TRUE to my gfxconf.h, I get these errors:

Code:
In file included from /Users/tenkai/Desktop/Projects/Arduino/libraries/ugfx/src/gdisp/gdisp_mk.c:23:0,
from /Users/tenkai/Desktop/Projects/Arduino/libraries/ugfx/src/gfx_mk.c:12,
from /Users/tenkai/Desktop/Projects/Arduino/libraries/ugfx-arduino/ugfx-arduino.c:1:
/Users/tenkai/Desktop/Projects/Arduino/libraries/ugfx/src/gdisp/gdisp_pixmap.c: In function 'gdispPixmapCreate':
/Users/tenkai/Desktop/Projects/Arduino/libraries/ugfx/src/gdisp/gdisp_pixmap.c:83:35: error: 'GDISPVMT_pixmap' undeclared (first use in this function)
g = (GDisplay *)gdriverRegister(&GDISPVMT_pixmap->d, p);
^
/Users/tenkai/Desktop/Projects/Arduino/libraries/ugfx/src/gdisp/gdisp_pixmap.c: At top level:
/Users/tenkai/Desktop/Projects/Arduino/libraries/ugfx/src/gdisp/gdisp_pixmap.c:113:1: error: unknown type name 'LLDSPEC'
LLDSPEC bool_t gdisp_lld_init(GDisplay *g) {
^

any idea what might be going on?
 
When just one single display is used uGFX will statically link the driver. However, as soon as multiple displays are used, the GDRIVER module is used to manage these drivers. This allows to create an arbitrary combination of any kind of displays. A pixmap is nothing but a virtual display. To provide full compatibility we decided to implement pixmaps as a second display and hence the multiple-displays support gets enabled once pixmaps are enabled.

The problems that you guys are experiencing is that multiple-display support currently doesn't work with our single-file-inclusion mechanism. Currently you can't use pixmaps unless you are not using the single-file-inclusion mechanism. If someone skilled like christoph whants to take a shot on removing this limitation we are happy to include the corresponding patch. Currently our ToDo list is very big and there are many things we need to take care of that have a higher priority than removing this limitation.
More information can be found in the corresponding uGFX forum answer: http://forum.ugfx.org/viewtopic.php?f=23&t=323&start=20#p2612


~ Tectu
 
To clarify: The proper way of handling this issue is either fixing what ever causes this limitation of the single-file-inclusion mechanism (we didn't investigate yet) or properly including each file individually rather than including gfx_mk.c


~ Tectu
 
Thank you Christoph!

I will keep hammering at it too. I am trying to figure out what files need to be included where, but I haven't had any luck yet.
 
This will definitely need some digging, the first thing is to find out what exactly the multiple display features of ugfx need that gfx_mk.c cannot provide as it is.
 
So I tried what Jakesays from the ugfx forum:
http://forum.ugfx.org/viewtopic.php?f=23&t=323#wrap

Actually its not a missing header issue. It's related to the single file build method.

For some reason GDISP_DRIVER_VMT is undefined when gdisp_driver.h is included in gdisp_pixmap.c
If I comment out gdisp_pixmap.c from gdisp_mk.c and add gdisp_pixmap.c directly to my project the GDISPVMT_pixmap related errors go away.

However now I'm getting "GDISP: Unsupported color system for low level drivers" :( it appears RGB565 is not supported in a lot of places.

If I change the contents of ssd1351_ugfx_config.h to:

Code:
#ifndef SSD1351_UGFX_CONFIG_H
#define SSD1351_UGFX_CONFIG_H

#include <ugfx-arduino.h> // main library
#include "src/gdisp/gdisp_pixmap.c"
#include <ugfx-arduino-gdisp-ssd1351.h> // display driver library

#endif // SSD1351_UGFX_CONFIG_H

and comment out gdisp_pixmap.c in gdisp_mk.c I get different errors than before. It seems to resolve the GDISPVMT_pixmap errors, but I get lots of duplicate const errors. I am wondering maybe there needs to be a second driver loaded for the framebuffer display? Maybe the makefile automatically creates it if pixmap is used, so it doesnt get automatically translated over to the single file mechanism?

Code:
In file included from /Users/tenkai/Desktop/Projects/Arduino/libraries/ugfx/src/gdisp/gdisp_driver.h:22:0,
from /Users/tenkai/Desktop/Projects/Arduino/libraries/ugfx/src/gdisp/gdisp_pixmap.c:42,
from /Users/tenkai/Desktop/Projects/Arduino/libraries/ssd1351-ugfx-config/ssd1351-ugfx-config.h:5,
from /Users/tenkai/Desktop/Projects/FLXS1/FLXS1.ino:4:
/Users/tenkai/Desktop/Projects/Arduino/libraries/ugfx/src/gdisp/../gdriver/gdriver.h:90:33: error: duplicate 'const'
typedef const struct GDriverVMT const GDriverVMTList[1];
^
In file included from /Users/tenkai/Desktop/Projects/Arduino/libraries/ugfx/src/gdisp/gdisp_pixmap.c:42:0,
from /Users/tenkai/Desktop/Projects/Arduino/libraries/ssd1351-ugfx-config/ssd1351-ugfx-config.h:5,
from /Users/tenkai/Desktop/Projects/FLXS1/FLXS1.ino:4:
/Users/tenkai/Desktop/Projects/Arduino/libraries/ugfx/src/gdisp/gdisp_driver.h:731:17: error: duplicate 'const'
const GDISPVMT const GDISP_DRIVER_VMT[1] = {{
^
In file included from /Users/tenkai/Desktop/Projects/Arduino/libraries/ssd1351-ugfx-config/ssd1351-ugfx-config.h:5:0,
from /Users/tenkai/Desktop/Projects/FLXS1/FLXS1.ino:4:
/Users/tenkai/Desktop/Projects/Arduino/libraries/ugfx/src/gdisp/gdisp_pixmap.c: In function 'GDisplay* gdispPixmapCreate(coord_t, coord_t)':
/Users/tenkai/Desktop/Projects/Arduino/libraries/ugfx/src/gdisp/gdisp_pixmap.c:63:55: error: invalid conversion from 'void*' to 'pixmap*' [-fpermissive]
if (!(p = gfxAlloc(i+sizeof(pixmap)-sizeof(p->pixels))))
^
In file included from /Users/tenkai/Desktop/Projects/Arduino/libraries/ugfx/src/gdisp/gdisp_pixmap.c:42:0,
from /Users/tenkai/Desktop/Projects/Arduino/libraries/ssd1351-ugfx-config/ssd1351-ugfx-config.h:5,
from /Users/tenkai/Desktop/Projects/FLXS1/FLXS1.ino:4:
/Users/tenkai/Desktop/Projects/Arduino/libraries/ugfx/src/gdisp/gdisp_pixmap.c: In function 'void gdispPixmapDelete(GDisplay*)':
/Users/tenkai/Desktop/Projects/Arduino/libraries/ugfx/src/gdisp/gdisp_driver.h:318:37: error: duplicate 'const'
#define gvmt(g)  ((const GDISPVMT const *)((g)->d.vmt)) // For ease of access to the vmt member
^
/Users/tenkai/Desktop/Projects/Arduino/libraries/ugfx/src/gdisp/gdisp_pixmap.c:90:6: note: in expansion of macro 'gvmt'
if (gvmt(g) != GDISPVMT_pixmap)
^
/Users/tenkai/Desktop/Projects/Arduino/libraries/ugfx/src/gdisp/gdisp_pixmap.c: In function 'pixel_t* gdispPixmapGetBits(GDisplay*)':
/Users/tenkai/Desktop/Projects/Arduino/libraries/ugfx/src/gdisp/gdisp_driver.h:318:37: error: duplicate 'const'
#define gvmt(g)  ((const GDISPVMT const *)((g)->d.vmt)) // For ease of access to the vmt member
^
/Users/tenkai/Desktop/Projects/Arduino/libraries/ugfx/src/gdisp/gdisp_pixmap.c:96:6: note: in expansion of macro 'gvmt'
if (gvmt(g) != GDISPVMT_pixmap)
^
In file included from /Users/tenkai/Desktop/Projects/Arduino/libraries/ssd1351-ugfx-config/ssd1351-ugfx-config.h:5:0,
from /Users/tenkai/Desktop/Projects/FLXS1/FLXS1.ino:4:
/Users/tenkai/Desktop/Projects/Arduino/libraries/ugfx/src/gdisp/gdisp_pixmap.c: In function 'void gdisp_lld_control(GDisplay*)':
/Users/tenkai/Desktop/Projects/Arduino/libraries/ugfx/src/gdisp/gdisp_pixmap.c:192:48: error: invalid cast from type 'void*' to type 'orientation_t {aka orientation}'
if (g->g.Orientation == (orientation_t)g->p.ptr)
^
/Users/tenkai/Desktop/Projects/Arduino/libraries/ugfx/src/gdisp/gdisp_pixmap.c:194:31: error: invalid cast from type 'void*' to type 'orientation_t {aka orientation}'
switch((orientation_t)g->p.ptr) {
^
/Users/tenkai/Desktop/Projects/Arduino/libraries/ugfx/src/gdisp/gdisp_pixmap.c:218:43: error: invalid cast from type 'void*' to type 'orientation_t {aka orientation}'
g->g.Orientation = (orientation_t)g->p.ptr;
 
The source file shouldn't be included in a header. The header is used in multiple places (as it should be) so duplicate const errors are a natural thing to happen. Try adding it to the ssd1351. C file instead
 
The source file shouldn't be included in a header. The header is used in multiple places (as it should be) so duplicate const errors are a natural thing to happen. Try adding it to the ssd1351. C file instead

ah! by adding the include line into ugfx-arduino.c before #include "src/gfx_mk.c" I am able to get the code to all compile, but my Teensy freezes upon upload.
 
Without seeing your sketch and libraries it's impossible to tell what is going wrong.

My first guess is some pointer weirdness or not enough memory. Are you possibly trying to create a pixmap that is simply too large?
 
Hi Christoph, Tectu,

Sorry for the delayed response, I got caught up with other problems and haven't had a chance to hammer on this much in the past few days.

I have uploaded the code I am trying to get this to work with right now to github so you can check it out:

https://github.com/cosmikwolf/ugfx_pixmap_arduino_test


I don't think I am trying to make a pixmap that is too large. I have tested with small sizes (10x40) and larger (the size of my SSD1351 is 128x96 pixels).

Anywho, any info you might be able to glean from this would be super helpful. Since it compiles now, I am kind of lost as to where to look next. Would I be correct to assume that since I get no compile errors, that everything I need to do pixmaps should be loaded, and it is a matter of configuring the pixmaps properly in order to get it to work?

thank you!
T
 
Status
Not open for further replies.
Back
Top