cleanup and improvements
improved driver creation fixed compile warnings in check.h hello_world example is now working again with lvgl
This commit is contained in:
@@ -2,14 +2,17 @@
|
||||
|
||||
#include "nb_hardware.h"
|
||||
#include "nb_app.h"
|
||||
#include "nb_config.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern void nanobake_start(nb_config_t _Nonnull * config);
|
||||
|
||||
// Forward declarations
|
||||
typedef void* FuriThreadId;
|
||||
typedef struct nb_lvgl nb_lvgl_t;
|
||||
|
||||
extern void nanobake_start(nb_config_t _Nonnull * config);
|
||||
|
||||
extern FuriThreadId nanobake_get_app_thread_id(size_t index);
|
||||
extern size_t nanobake_get_app_thread_count();
|
||||
|
||||
@@ -18,7 +18,8 @@ struct nb_config {
|
||||
// Optional driver for touch input
|
||||
const create_touch_driver _Nullable touch_driver;
|
||||
// List of user applications
|
||||
const nb_app_t* apps[];
|
||||
const size_t apps_count;
|
||||
const nb_app_t* const apps[];
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -15,6 +15,8 @@ struct nb_display {
|
||||
uint16_t bits_per_pixel;
|
||||
esp_lcd_panel_io_handle_t _Nonnull io_handle;
|
||||
esp_lcd_panel_handle_t _Nonnull display_handle;
|
||||
bool mirror_x;
|
||||
bool mirror_y;
|
||||
};
|
||||
|
||||
typedef struct nb_display_driver nb_display_driver_t;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "nb_config.h"
|
||||
#include <lvgl.h>
|
||||
#include "nb_display.h"
|
||||
#include "nb_touch.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -13,12 +13,6 @@ struct nb_hardware {
|
||||
nb_touch_t* _Nullable touch;
|
||||
};
|
||||
|
||||
/**
|
||||
* @param[in] config
|
||||
* @return a newly allocated platform instance (caller takes ownership)
|
||||
*/
|
||||
nb_hardware_t _Nonnull* nb_hardware_alloc(nb_config_t _Nonnull* config);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
#pragma once
|
||||
|
||||
#include <lvgl.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct nb_lvgl nb_lvgl_t;
|
||||
struct nb_lvgl {
|
||||
lv_disp_t* _Nonnull disp;
|
||||
lv_indev_t* _Nullable touch_indev;
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
Reference in New Issue
Block a user