Exported C files in Arduino

What do you want to achieve?

Compile exported files from SLS in Arduino sketch

Do you see alternative options and workaround to achieve it?

Yes, if I add this define to my sketch, it will not complain with lot of errors.

#ifdef ARDUINO
#include <lvgl.h>
#else
#include "lvgl/lvgl.h"
#endif

Mention some use cases

Everytime when you want to use exported files in Arduino IDE :slight_smile:

Could this be added for export to ui.h a ui_helpers.h files?

Hi,

Can you try this:

#ifdef __has_include
    #if __has_include("lvgl.h")
        #include "lvgl.h"
    #else
        #include "lvgl/lvgl.h"
    #endif
#else
    #include "lvgl/lvgl.h"
#endif

instead of

#ifdef ARDUINO
#include <lvgl.h>
#else
#include "lvgl/lvgl.h"
#endif

Yes, that also works. :slight_smile:

1 Like

Thanks for testing it. Will add this pattern in v1.04.

2 Likes