tuupola / hagl

Hardware Agnostic Graphics Library for embedded

Home Page:https://www.appelsiini.net/tags/hagl/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

is it possible to use HAGL with platformio and arduino framework?

smarq8 opened this issue · comments

Hello.
Is it possible to use this library with ESP32 (TTGO TDISPLAY, buildin screen not used, attached DFR0665 screen) + platformio + arduino framework? I never used kconfig, makefile and stuff like that so im not sure how to prepare it.

here is my current attempt but can not compile it
https://github.com/smarq8/ESP32_arduino_platformIO_HAGL

main.cpp

#include <Arduino.h>
#include <hagl_hal.h>
#include <hagl.h>


void setup(){
    hagl_init();
}

void loop(){
    hagl_clear_screen();
    // some drawing stuff
    hagl_flush();
    delay(500);
}

platformio.ini

[env:esp32dev]
platform = espressif32
board = esp32dev
framework = arduino
> Executing task: C:\Users\xXx\.platformio\penv\Scripts\platformio.exe run --environment esp32dev <

Processing esp32dev (platform: espressif32; board: esp32dev; framework: arduino)
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32dev.html
PLATFORM: Espressif 32 (3.3.2) > Espressif ESP32 Dev Module
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (esp-prog) External (esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES:
 - framework-arduinoespressif32 3.10006.210326 (1.0.6)
 - tool-esptoolpy 1.30100.210531 (3.1.0)
 - toolchain-xtensa32 2.50200.97 (5.2.0)
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 29 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <hagl>
Building in release mode
Compiling .pio\build\esp32dev\src\main.cpp.o
Compiling .pio\build\esp32dev\lib3a2\hagl\hagl.c.o
In file included from lib\hagl\src\hagl.c:49:0:
lib\hagl\include/hagl.h:45:22: fatal error: hagl_hal.h: No such file or directory

******************************************************************
* Looking for hagl_hal.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:hagl_hal.h"
* Web  > https://platformio.org/lib/search?query=header:hagl_hal.h
*
******************************************************************

compilation terminated.
src\main.cpp:2:22: fatal error: hagl_hal.h: No such file or directory

******************************************************************
* Looking for hagl_hal.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:hagl_hal.h"
* Web  > https://platformio.org/lib/search?query=header:hagl_hal.h
*
******************************************************************

compilation terminated.
*** [.pio\build\esp32dev\lib3a2\hagl\hagl.c.o] Error 1
*** [.pio\build\esp32dev\src\main.cpp.o] Error 1
====================================================================================== [FAILED] Took 2.17 seconds ======================================================================================The terminal process "C:\Users\xXx\.platformio\penv\Scripts\platformio.exe 'run', '--environment', 'esp32dev'" terminated with exit code: 1.

Terminal will be reused by tasks, press any key to close it.

I don't use PlatformIO myself, but looking at your repository you are missing the HAL itself.

https://github.com/tuupola/hagl_esp_mipi

How to use sdkconfig with PlatformIO seems to be documented here:

https://docs.platformio.org/en/latest/frameworks/espidf.html#configuration-for-4-0

There also is ready made config files for some usual dev boards:

https://github.com/tuupola/hagl_esp_mipi/tree/master/sdkconfig

Hello
I already succefully run it under platformio without any sdkconfig etc, I also made some modyfication to split into the modules like drawing(line,rectangle,circles...)/font engine(adafruit,X11)/pointer(mouseSDL,touch)/display(MIPI,eSPI,SLD) so its easy swapable between different platform like ESP32 or pc by just define which module to use, every drawing thing is passing thru very few function hline,vline,setPixel,pushArea,pushColor, additionally I added module to support platform specific function like milli,serial,in the future threads, timers etc so it functions more like platform wrapper (or something like SDL that provide common interface for varius platform) than display driver and now I can run nearly same code on my ESP32 and PC and eventually I do not need to upload mu code to ESP32 in 99% cases to develoop my project that save tons of time (most of HW dependecies i just pass thru some Serial protocol to drive code at PC).
Ofc. I really appreciate ur library which is magnificent seed for my project that I was looking for so long, in the near future I'll try to share some issues I found at ur library.