Most recent activity
-
-
-
Hmm, I tried to figure out, how to use graphicsInternal, .....
and found only something in lcd_st7789-8bit where setPixel is not set again.Next try was to add JSGRAPHICSTYPE_OTHERS in JsGraphicsType (graphics.h)
and an if-statement in graphicsSetCallbacks(graphics.c) to skip xxxSetCallbacks.
In my own driver, this worked fine, but in all functions from jswrap_graphics(for example setPixel) I've got runtime error. Looks to me like setCallback is necessary (?)My actual solution for my problem is to add a weak function for JSGRAPHICSTYPE_OTHERS, which can be overroled in my driver. My driver for ILI9341 now is much faster compared to JS-solution.
See following sources.
If this is of interest for Espruino, I would create a pull request.graphics.h:
typedef enum { JSGRAPHICSTYPE_ARRAYBUFFER, ///< Write everything into an ArrayBuffer JSGRAPHICSTYPE_JS, ///< Call JavaScript when we want to write something JSGRAPHICSTYPE_FSMC, ///< FSMC (or fake FSMC) ILI9325 16bit-wide LCDs JSGRAPHICSTYPE_SDL, ///< SDL graphics library for linux JSGRAPHICSTYPE_SPILCD, ///< SPI LCD library JSGRAPHICSTYPE_ST7789_8BIT, ///< ST7789 in 8 bit mode JSGRAPHICSTYPE_MEMLCD, ///< Memory LCD JSGRAPHICSTYPE_LCD_SPI_UNBUF, ///< LCD SPI unbuffered 16 bit driver JSGRAPHICSTYPE_OTHERS ///< Driver that support callbacks only } JsGraphicsType; bool graphicsSetCallbacksOthers(JsGraphics *gfx);
graphics.c:
/// Set up the callbacks for this graphics instance (usually done by graphicsGetFromVar) __attribute__((weak))bool graphicsSetCallbacksOthers(JsGraphics *gfx){ return false; } bool graphicsSetCallbacks(JsGraphics *gfx) { if(gfx->data.type >= JSGRAPHICSTYPE_OTHERS){ return graphicsSetCallbacksOthers(gfx); }
Last not least in myOwnDriver.c:
bool graphicsSetCallbacksOthers(JsGraphics *gfx){ gfx->setPixel = myOwnCallbackSetPixel; gfx->fillRect = myOwnCallbackFillRect; return true; }
-
-
-
- 18 comments
- 2,784 views
-
@SimonGAndrews
Good news- got a pico w
- got it connected from Espruino to my wireless
Bad news - don't get my hands on a http-server. There is a first step in Github, but my understanding is poor. My way right now is a mix of trial/error and copy/paste
BTW, Gordon already offered to help changing from cmake to espruino like make, once the port is kind of stable. For me this port is having some fun, don't have to make money for the family.
- got a pico w
-
Well.. could be me ;-)
May be, this can help for audio output http://forum.espruino.com/conversations/363093/#comment15963863
I used it for some simple speech, but it can be used for sound, music etc.
last not least its cheap.
I agree, ESP32 with ESP-IDF eats memory like crazy.