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:
Ken Van Hoeylandt
2023-12-26 23:04:40 +01:00
parent 25b0aa09e2
commit 88c5c55be3
20 changed files with 138 additions and 108 deletions
+5 -2
View File
@@ -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();
+2 -1
View File
@@ -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
+2
View File
@@ -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;
+2 -8
View File
@@ -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
+17
View File
@@ -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