mirror of
https://github.com/ByteWelder/Tactility.git
synced 2026-02-18 19:03:16 +00:00
consistent header includes
replaced <> with "" for non-system headers
This commit is contained in:
parent
34a067c2b1
commit
11f26d4980
@ -1,4 +1,3 @@
|
|||||||
#ifndef NANOBAKE_BOARD_2432S024_H
|
|
||||||
#define NANOBAKE_BOARD_2432S024_H
|
#define NANOBAKE_BOARD_2432S024_H
|
||||||
|
|
||||||
#include "board_2432s024_display.h"
|
#include "board_2432s024_display.h"
|
||||||
|
|||||||
@ -1,14 +1,13 @@
|
|||||||
#include "board_2432s024_display.h"
|
#include "board_2432s024_display.h"
|
||||||
|
|
||||||
#include <esp_lcd_ili9341.h>
|
#include "esp_lcd_ili9341.h"
|
||||||
#include <esp_log.h>
|
#include "esp_log.h"
|
||||||
#include <esp_err.h>
|
#include "esp_err.h"
|
||||||
#include <esp_check.h>
|
#include "esp_lcd_panel_ops.h"
|
||||||
#include <esp_lcd_panel_ops.h>
|
#include "driver/gpio.h"
|
||||||
#include <driver/gpio.h>
|
#include "driver/spi_master.h"
|
||||||
#include <driver/spi_master.h>
|
#include "freertos/FreeRTOS.h"
|
||||||
#include <freertos/FreeRTOS.h>
|
#include "freertos/semphr.h"
|
||||||
#include <freertos/semphr.h>
|
|
||||||
|
|
||||||
static const char* TAG = "2432s024_ili9341";
|
static const char* TAG = "2432s024_ili9341";
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
#ifndef NANOBAKE_BOARD_2432S024_DISPLAY_H
|
#ifndef NANOBAKE_BOARD_2432S024_DISPLAY_H
|
||||||
#define NANOBAKE_BOARD_2432S024_DISPLAY_H
|
#define NANOBAKE_BOARD_2432S024_DISPLAY_H
|
||||||
|
|
||||||
#include <nb_display.h>
|
#include "nb_display.h"
|
||||||
|
|
||||||
extern NbDisplayDriver board_2432s024_create_display_driver();
|
extern NbDisplayDriver board_2432s024_create_display_driver();
|
||||||
|
|
||||||
|
|||||||
@ -1,9 +1,9 @@
|
|||||||
#include "board_2432s024_touch.h"
|
#include "board_2432s024_touch.h"
|
||||||
|
|
||||||
#include <esp_lcd_touch_cst816s.h>
|
#include "esp_lcd_touch_cst816s.h"
|
||||||
#include <esp_log.h>
|
#include "esp_log.h"
|
||||||
#include <esp_err.h>
|
#include "esp_err.h"
|
||||||
#include <driver/i2c.h>
|
#include "driver/i2c.h"
|
||||||
|
|
||||||
#define CST816_I2C_PORT (0)
|
#define CST816_I2C_PORT (0)
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
#ifndef NANOBAKE_BOARD_2432S024_TOUCH_H
|
#ifndef NANOBAKE_BOARD_2432S024_TOUCH_H
|
||||||
#define NANOBAKE_BOARD_2432S024_TOUCH_H
|
#define NANOBAKE_BOARD_2432S024_TOUCH_H
|
||||||
|
|
||||||
#include <nb_touch.h>
|
#include "nb_touch.h"
|
||||||
|
|
||||||
NbTouchDriver board_2432s024_create_touch_driver();
|
NbTouchDriver board_2432s024_create_touch_driver();
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
#include "desktop.h"
|
#include "desktop.h"
|
||||||
#include "nb_hardware.h"
|
#include "nb_hardware.h"
|
||||||
#include <core_defines.h>
|
#include "core_defines.h"
|
||||||
|
|
||||||
static int32_t prv_desktop_main(void* param) {
|
static int32_t prv_desktop_main(void* param) {
|
||||||
UNUSED(param);
|
UNUSED(param);
|
||||||
|
|||||||
@ -1,19 +1,19 @@
|
|||||||
#include "gui_i.h"
|
#include "gui_i.h"
|
||||||
#include "core_defines.h"
|
#include "core_defines.h"
|
||||||
#include <record.h>
|
#include "record.h"
|
||||||
#include <check.h>
|
#include "check.h"
|
||||||
|
|
||||||
static ScreenId screen_counter = 0;
|
static NbScreenId screen_counter = 0;
|
||||||
|
|
||||||
NbGuiHandle gui_alloc() {
|
NbGuiHandle gui_alloc() {
|
||||||
struct NbGui* gui = malloc(sizeof(struct NbGui));
|
struct NbGui* gui = malloc(sizeof(struct NbGui));
|
||||||
screen_dict_init(gui->screens);
|
ScreenDict_init(gui->screens);
|
||||||
gui->mutex = furi_mutex_alloc(FuriMutexTypeNormal);
|
gui->mutex = furi_mutex_alloc(FuriMutexTypeNormal);
|
||||||
return gui;
|
return gui;
|
||||||
}
|
}
|
||||||
|
|
||||||
void gui_free(NbGuiHandle gui) {
|
void gui_free(NbGuiHandle gui) {
|
||||||
screen_dict_clear(gui->screens);
|
ScreenDict_clear(gui->screens);
|
||||||
furi_mutex_free(gui->mutex);
|
furi_mutex_free(gui->mutex);
|
||||||
free(gui);
|
free(gui);
|
||||||
}
|
}
|
||||||
@ -28,15 +28,15 @@ void gui_unlock(NbGuiHandle gui) {
|
|||||||
furi_check(furi_mutex_release(gui->mutex) == FuriStatusOk);
|
furi_check(furi_mutex_release(gui->mutex) == FuriStatusOk);
|
||||||
}
|
}
|
||||||
|
|
||||||
ScreenId gui_screen_create(NbGuiHandle gui, InitScreen callback) {
|
NbScreenId gui_screen_create(NbGuiHandle gui, InitScreen callback) {
|
||||||
ScreenId id = screen_counter++;
|
NbScreenId id = screen_counter++;
|
||||||
NbScreen screen = {
|
NbScreen screen = {
|
||||||
.id = id,
|
.id = id,
|
||||||
.parent = NULL,
|
.parent = NULL,
|
||||||
.callback = callback
|
.callback = callback
|
||||||
};
|
};
|
||||||
|
|
||||||
screen_dict_set_at(gui->screens, id, screen);
|
ScreenDict_set_at(gui->screens, id, screen);
|
||||||
|
|
||||||
// TODO: notify desktop of change
|
// TODO: notify desktop of change
|
||||||
// TODO: have desktop update views
|
// TODO: have desktop update views
|
||||||
@ -49,26 +49,26 @@ ScreenId gui_screen_create(NbGuiHandle gui, InitScreen callback) {
|
|||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
lv_obj_t* gui_screen_get_parent(NbGuiHandle gui, ScreenId id) {
|
lv_obj_t* gui_screen_get_parent(NbGuiHandle gui, NbScreenId id) {
|
||||||
NbScreen* screen = screen_dict_get(gui->screens, id);
|
NbScreen* screen = ScreenDict_get(gui->screens, id);
|
||||||
furi_check(screen != NULL);
|
furi_check(screen != NULL);
|
||||||
return screen->parent;
|
return screen->parent;
|
||||||
}
|
}
|
||||||
|
|
||||||
void gui_screen_set_parent(NbGuiHandle gui, ScreenId id, lv_obj_t* parent) {
|
void gui_screen_set_parent(NbGuiHandle gui, NbScreenId id, lv_obj_t* parent) {
|
||||||
NbScreen* screen = screen_dict_get(gui->screens, id);
|
NbScreen* screen = ScreenDict_get(gui->screens, id);
|
||||||
furi_check(screen != NULL);
|
furi_check(screen != NULL);
|
||||||
screen->parent = parent;
|
screen->parent = parent;
|
||||||
}
|
}
|
||||||
|
|
||||||
void gui_screen_free(NbGuiHandle gui, ScreenId id) {
|
void gui_screen_free(NbGuiHandle gui, NbScreenId id) {
|
||||||
NbScreen* screen = screen_dict_get(gui->screens, id);
|
NbScreen* screen = ScreenDict_get(gui->screens, id);
|
||||||
furi_check(screen != NULL);
|
furi_check(screen != NULL);
|
||||||
|
|
||||||
// TODO: notify? use callback? (done from desktop service)
|
// TODO: notify? use callback? (done from desktop service)
|
||||||
lv_obj_clean(screen->parent);
|
lv_obj_clean(screen->parent);
|
||||||
|
|
||||||
screen_dict_erase(gui->screens, id);
|
ScreenDict_erase(gui->screens, id);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int32_t prv_gui_main(void* param) {
|
static int32_t prv_gui_main(void* param) {
|
||||||
|
|||||||
@ -8,16 +8,16 @@ extern "C" {
|
|||||||
|
|
||||||
#define RECORD_GUI "gui"
|
#define RECORD_GUI "gui"
|
||||||
|
|
||||||
typedef uint16_t ScreenId;
|
typedef uint16_t NbScreenId;
|
||||||
|
|
||||||
typedef struct NbGui* NbGuiHandle;
|
typedef struct NbGui* NbGuiHandle;
|
||||||
typedef void (*InitScreen)(lv_obj_t*, ScreenId);
|
typedef void (*InitScreen)(lv_obj_t*, NbScreenId);
|
||||||
|
|
||||||
ScreenId gui_screen_create(NbGuiHandle _Nonnull gui, InitScreen callback);
|
NbScreenId gui_screen_create(NbGuiHandle _Nonnull gui, InitScreen callback);
|
||||||
void gui_screen_free(NbGuiHandle _Nonnull gui, ScreenId id);
|
void gui_screen_free(NbGuiHandle _Nonnull gui, NbScreenId id);
|
||||||
// TODO make internal
|
// TODO make internal
|
||||||
void gui_screen_set_parent(NbGuiHandle _Nonnull gui, ScreenId id, lv_obj_t* parent);
|
void gui_screen_set_parent(NbGuiHandle _Nonnull gui, NbScreenId id, lv_obj_t* parent);
|
||||||
lv_obj_t* gui_screen_get_parent(NbGuiHandle _Nonnull gui, ScreenId id);
|
lv_obj_t* gui_screen_get_parent(NbGuiHandle _Nonnull gui, NbScreenId id);
|
||||||
|
|
||||||
extern const NbApp gui_app;
|
extern const NbApp gui_app;
|
||||||
|
|
||||||
|
|||||||
@ -1,20 +1,20 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "gui.h"
|
#include "gui.h"
|
||||||
#include <mutex.h>
|
#include "mutex.h"
|
||||||
#include <m-dict.h>
|
#include "m-dict.h"
|
||||||
#include <m-core.h>
|
#include "m-core.h"
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
ScreenId id;
|
NbScreenId id;
|
||||||
lv_obj_t* parent;
|
lv_obj_t* parent;
|
||||||
InitScreen _Nonnull callback;
|
InitScreen _Nonnull callback;
|
||||||
} NbScreen;
|
} NbScreen;
|
||||||
|
|
||||||
DICT_DEF2(screen_dict, ScreenId, M_BASIC_OPLIST, NbScreen, M_POD_OPLIST)
|
DICT_DEF2(ScreenDict, NbScreenId, M_BASIC_OPLIST, NbScreen, M_POD_OPLIST)
|
||||||
|
|
||||||
struct NbGui {
|
struct NbGui {
|
||||||
// TODO: use mutex
|
// TODO: use mutex
|
||||||
FuriMutex* mutex;
|
FuriMutex* mutex;
|
||||||
screen_dict_t screens;
|
ScreenDict_t screens;
|
||||||
};
|
};
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
#include "system_info.h"
|
#include "system_info.h"
|
||||||
#include "nanobake.h"
|
#include "nanobake.h"
|
||||||
#include <core_defines.h>
|
#include "core_defines.h"
|
||||||
#include <thread.h>
|
#include "thread.h"
|
||||||
|
|
||||||
static int32_t system_info_entry_point(void* param) {
|
static int32_t system_info_entry_point(void* param) {
|
||||||
UNUSED(param);
|
UNUSED(param);
|
||||||
|
|||||||
@ -3,12 +3,12 @@
|
|||||||
#include "nb_lvgl_i.h"
|
#include "nb_lvgl_i.h"
|
||||||
#include "nb_app_i.h"
|
#include "nb_app_i.h"
|
||||||
#include "applications/nb_applications.h"
|
#include "applications/nb_applications.h"
|
||||||
#include <esp_log.h>
|
#include "esp_log.h"
|
||||||
#include <m-list.h>
|
#include "m-list.h"
|
||||||
// Furi
|
// Furi
|
||||||
#include <thread.h>
|
#include "thread.h"
|
||||||
#include <kernel.h>
|
#include "kernel.h"
|
||||||
#include <record.h>
|
#include "record.h"
|
||||||
|
|
||||||
M_LIST_DEF(thread_ids, FuriThreadId);
|
M_LIST_DEF(thread_ids, FuriThreadId);
|
||||||
|
|
||||||
|
|||||||
@ -11,7 +11,7 @@ extern "C" {
|
|||||||
// Forward declarations
|
// Forward declarations
|
||||||
typedef void* FuriThreadId;
|
typedef void* FuriThreadId;
|
||||||
|
|
||||||
__attribute__((unused)) extern void nanobake_start(NbConfig _Nonnull * config);
|
__attribute__((unused)) extern void nanobake_start(NbConfig _Nonnull* config);
|
||||||
|
|
||||||
extern FuriThreadId nanobake_get_app_thread_id(size_t index);
|
extern FuriThreadId nanobake_get_app_thread_id(size_t index);
|
||||||
extern size_t nanobake_get_app_thread_count();
|
extern size_t nanobake_get_app_thread_count();
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#include "nb_app_i.h"
|
#include "nb_app_i.h"
|
||||||
#include <check.h>
|
#include "check.h"
|
||||||
|
|
||||||
const char* prv_type_service = "service";
|
const char* prv_type_service = "service";
|
||||||
const char* prv_type_system = "system";
|
const char* prv_type_system = "system";
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <esp_err.h>
|
#include "esp_err.h"
|
||||||
#include <lvgl.h>
|
#include "lvgl.h"
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#include "nb_display.h"
|
#include "nb_display.h"
|
||||||
#include <check.h>
|
#include "check.h"
|
||||||
|
|
||||||
NbDisplay _Nonnull* nb_display_alloc(NbDisplayDriver _Nonnull* driver) {
|
NbDisplay _Nonnull* nb_display_alloc(NbDisplayDriver _Nonnull* driver) {
|
||||||
NbDisplay _Nonnull* display = malloc(sizeof(NbDisplay));
|
NbDisplay _Nonnull* display = malloc(sizeof(NbDisplay));
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
#include "nb_hardware_i.h"
|
#include "nb_hardware_i.h"
|
||||||
#include <esp_check.h>
|
#include "esp_check.h"
|
||||||
#include <esp_err.h>
|
#include "esp_err.h"
|
||||||
#include <check.h>
|
#include "check.h"
|
||||||
|
|
||||||
static const char* TAG = "nb_hardware";
|
static const char* TAG = "nb_hardware";
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
#include "nb_lvgl_i.h"
|
#include "nb_lvgl_i.h"
|
||||||
#include <esp_lvgl_port.h>
|
#include "esp_lvgl_port.h"
|
||||||
#include <check.h>
|
#include "check.h"
|
||||||
|
|
||||||
static const char* TAG = "nb_lvgl";
|
static const char* TAG = "nb_lvgl";
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <lvgl.h>
|
#include "lvgl.h"
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "esp_lcd_touch.h"
|
#include "esp_lcd_touch.h"
|
||||||
#include <esp_lcd_panel_io.h>
|
#include "esp_lcd_panel_io.h"
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
|||||||
@ -1,11 +1,11 @@
|
|||||||
#include "hello_world.h"
|
#include "hello_world.h"
|
||||||
#include <core_defines.h>
|
#include "core_defines.h"
|
||||||
#include <record.h>
|
#include "record.h"
|
||||||
#include <nb_lvgl.h>
|
#include "nb_lvgl.h"
|
||||||
#include <nb_hardware.h>
|
#include "nb_hardware.h"
|
||||||
#include <applications/services/gui/gui.h>
|
#include "applications/services/gui/gui.h"
|
||||||
#include <esp_lvgl_port.h>
|
#include "esp_lvgl_port.h"
|
||||||
#include <esp_log.h>
|
#include "esp_log.h"
|
||||||
|
|
||||||
static const char* TAG = "app_helloworld";
|
static const char* TAG = "app_helloworld";
|
||||||
|
|
||||||
@ -15,7 +15,7 @@ static void prv_on_button_click(lv_event_t _Nonnull* event) {
|
|||||||
struct NbGui* gui = furi_record_open(RECORD_GUI);
|
struct NbGui* gui = furi_record_open(RECORD_GUI);
|
||||||
|
|
||||||
// Free this screen
|
// Free this screen
|
||||||
ScreenId screen_id = (ScreenId)event->user_data;
|
NbScreenId screen_id = (NbScreenId)event->user_data;
|
||||||
gui_screen_free(gui, screen_id);
|
gui_screen_free(gui, screen_id);
|
||||||
|
|
||||||
// Close Gui record
|
// Close Gui record
|
||||||
@ -23,7 +23,7 @@ static void prv_on_button_click(lv_event_t _Nonnull* event) {
|
|||||||
gui = NULL;
|
gui = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void prv_hello_world_lvgl(lv_obj_t* parent, ScreenId screen_id) {
|
static void prv_hello_world_lvgl(lv_obj_t* parent, NbScreenId screen_id) {
|
||||||
lvgl_port_lock(0);
|
lvgl_port_lock(0);
|
||||||
|
|
||||||
lv_obj_t* label = lv_label_create(parent);
|
lv_obj_t* label = lv_label_create(parent);
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
#include <nanobake.h>
|
#include "nanobake.h"
|
||||||
|
|
||||||
// Hardware
|
// Hardware
|
||||||
#include <board_2432s024_touch.h>
|
#include "board_2432s024_touch.h"
|
||||||
#include <board_2432s024_display.h>
|
#include "board_2432s024_display.h"
|
||||||
|
|
||||||
// Apps
|
// Apps
|
||||||
#include "hello_world/hello_world.h"
|
#include "hello_world/hello_world.h"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user