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