-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Arduino IDE compability #11
Comments
Have you added the project's root path to the include paths? Can you copy here a few from the error messages? |
well, arduino is set up differently, and i don't know how to do that on arduino ide. then i came across alot of "file not found" (due to root include paths), fixed those manually, but then i got "undefined reference to" errors, so i had to include every .c file in my sketch too, and now i get even more errors saying this:
why not simply make everything easy to integrate in arduino too? :P |
note that this is with the application framework enabled |
Hm. Please attache the whole compile log as a txt file. |
okay, i set compiler warnings to "all" so beware of a HUGE list of errors, here's the list: https://pastebin.com/dJZmD2rp |
It seems like compiiler threat the source files as cpp files instead of c. Have you changes the file extensions to .cpp from .c? |
the arduino ide does that by default i think, and i cant find a way on how to disable that, and i leaved the file extentions at their default ones ( .h, .c ) |
I googled on it and found that it a limitation of the Arduino IDE. I have never used Arduino so far but others say there are problems when you begin to use things outside of Arduino. Therefore they recommend to work with an other IDE. Here is a description about a C compatible IDE: |
i see, so that basically means i need to port the entire device support package to another IDE... (the teensy 3.x support package in my case, which will be a pain) and i was so hopeful that lvgl could work relatively easy on arduino.. :'( |
just a question, will it ever be ported to arduino? or not? |
Yes, I'm planning to port it to Arduino (and make the required updates) but I will have time for it only a few month later... :( Teensy 3 doesn't support other IDE/compiler then Arduino? |
awesome that it's going to be ported! no worries on time, do everything at your tempo, will donate some money for the awesome support :) and for the teensy 3 not as far as i know.. ^^; |
You can create a wrapper class around lvgl to make it arduino compatible, converting whole project to c++ will be a big job. |
never did that kind of coding before, so i wouldn't know how to do that tbh ^^; |
I don't know Arduino, but I suppose that regardless to the wrappers the Arduino compiler has to compile the code. The wrappers helps you only when you use the functions, don't they? |
I have been working on Arduino recently to add support for a new platform that I am making. And lot of code that I write is in C. Arduino core is actually mix bag of C and C++ sources so I am not sure why compiler is throwing errors. It may be the way you are including the files in your project/sketch. |
Good news! Thanks for that! |
I've downloaded the Arduino IDE and tried to setup an example dummy library. The first thing I faced that I had to modify the .h files: at the end If you have time for that can you try it? Also to not waste time I recommend you to try the PC simulator. It is a very good to know the LittevGL and also your code can be copied to an embedded environment later. Here is a guide about the PC simulator: http://www.gl.littlev.hu/pc-simulator |
you mean at every .h file? that's gonna take some time. and i will try the pc emulator :) |
also, regarding the pc simulator, why not make a single visual studio project? if needed i can give you a project that's exactly doing that :) |
Yes, I mean all .h files... :( Visual studio project: I've chosen Eclipse CDT because it is cross platform. Please create an issue in proj_pc repository to continue the discussion about Visual Studio there. |
Okay, will change all files and try again upcoming week and tell you the result |
i midified all the .h files, and now getting "undefined reference to lv_init()" and the same errors with other functions. looks like i need to include the dedicated .c files as well in each .h file? :O |
Thank you for the effort to modify the files. Please, send me the lvgl, misc and hal folders and I will check/try them. |
attached is the arduino folder including ili9341 and touch libraries for the adafruit 2.8" tft ( https://www.adafruit.com/product/1651 ) with a teensy 3.1 (i used teensyduino 1.36 & arduino 1.8.1) the whole zip needs to be extracted in my documents/Arduino |
I've checked the files, tried to compile and saw multiple type of issues. On next week I'll try to solve them! |
Firstly I have tried to port the misc library and I've succeeded! It was required to solve several issues because of the limitations in the Arduino IDE but I was able to compile it! Please try it and if it is working for |
it compiles, but it doesn't go past the misc_init(); function on a teensy 3.2 (fastest, with lto, 96mhz), aka a system halt is thrown. this is the sketch:
|
In misc_conf.h disable the IDLE module. USE_IDLE 0 |
Hi, It is good to here that you have tried that IDE. Were you able to solve the issue meanwhile? |
Sadly not :( |
Hi Ramon, Good news for Arduino! In the upcoming v5.0 release I modified the architecture the graphics library and now it is compatible with the default Arduino IDE. I was able to easily compile it with Teensy 3.6. I cannot test it because I don't have Teensy hardware, but I hope you can do the testing! :) You need to write a disp_fill and disp_map function (see below) Here is the library: An this is my sketch: #include <lvgl.h>
void hal_init(void)
{
/*Initialize the display*/
lv_disp_drv_t disp_drv;
disp_drv.fill = NULL; /*function to fill an area: void fill(int32_t x1, int32_t y1, int32_t x2, int32_t y2, lv_color_t color) */
disp_drv.map = NULL; /*function copy pixels to an area: void map(int32_t x1, int32_t y1, int32_t x2, int32_t y2, lv_color_t *color_p) */
disp_drv.copy = NULL; /*ignored*/
lv_disp_register(&disp_drv);
/*Initialize the graphics library's tick*/
/*In a Timer call lv_tich_handler() in every milliseconds*/
}
void setup() {
lv_init();
hal_init();
lv_obj_t *label = lv_label_create(lv_scr_act(), NULL);
lv_label_set_text(label, "Hello Arduino!");
lv_obj_align(label, NULL, LV_ALIGN_CENTER, 0, 0);
}
void loop() {
// put your main code here, to run repeatedly:
} |
awesome, altho i see a problem, the arduino IDE has a macro called map, which is used in LV_HAL_DISP.H |
hmm... i get errors when assigning my own function to the null pointers:
|
I updated the library to not use 'map' name. /*Initialize the display*/
lv_disp_drv_t disp_drv;
disp_drv.fill_fp = NULL; /*function to fill an area: void fill(int32_t x1, int32_t y1, int32_t x2, int32_t y2, lv_color_t color) */
disp_drv.map_fp = NULL; /*function copy pixels to an area: void map(int32_t x1, int32_t y1, int32_t x2, int32_t y2, lv_color_t *color_p) */
disp_drv.blend_fp = NULL; /*ignored*/
lv_disp_register(&disp_drv); You get the error because you have to initialize it like this: |
ok, didn't know that now i get this error(?) nevermind me, was being dumb |
Look the previous code example! To be consistent with |
yeah, i figured it out, i am pretty sleepy right now got it to compile, going to test soon |
it compiled, but doesn't work with my ili9341, while it does work when i call the tft driver library (the non lvgl) functions directly, so it must be something inside of lvgl that refuses to run. btw, i am running a tick timer for the lvgl as documented edit: if usefull, my main arduino file
|
Just thinking out loud now: the teensy support package runs as multi thread within each yield call (which happens alot!) Also note that the lvgl doesn't just give no output on the screen, but also no change on the SPI bus to which the screen is connected to. Yes I have configured the lvgl config file for correct screen resolution, also reduced buffer to 10 lines to fit on my teensy 3.2 |
Oh sorry, I forget to add |
it works, lvgl clears the screen to black, but.... no text is displayed :P |
Please show me your disp_map function. |
|
It seems you forget to increment c = tft.color565(color_p->red, color_p->green, color_p->blue);
tft.drawPixel(x,y,c);
color_p++; |
this proves how newb i am with lvgl xD issue can be closed :) |
Awesome ^^ Please keep in mind the |
@ramonschepers Instead of .drawPixel try to use .pushColor - this may speed things up... ;-) |
i am desperate to get this to the Arduino IDE, but i get a huge list of errors when compiling and i can't figure it out due to lack of knowing lvgl well enough... perhaps port it to arduino as well?
The text was updated successfully, but these errors were encountered: