implemented furi from flipper zero
added cmsis_core, furi, mlib and nanobake implemented basic app structure from furi implemented basic placeholder apps
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
|
||||
idf_component_register(
|
||||
SRC_DIRS "src"
|
||||
"src/hello_world"
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
#include "hello_world.h"
|
||||
#include "core_defines.h"
|
||||
|
||||
#include "esp_lvgl_port.h"
|
||||
#include <esp_log.h>
|
||||
#include "nb_platform.h"
|
||||
#include "nb_hardware.h"
|
||||
|
||||
static const char* TAG = "app_helloworld";
|
||||
|
||||
@@ -10,30 +11,32 @@ static void prv_on_button_click(lv_event_t _Nonnull* event) {
|
||||
ESP_LOGI(TAG, "button clicked");
|
||||
}
|
||||
|
||||
static void prv_on_create(nb_platform_t _Nonnull* platform, lv_obj_t _Nonnull* lv_parent) {
|
||||
lvgl_port_lock(0);
|
||||
|
||||
lv_obj_t* label = lv_label_create(lv_parent);
|
||||
lv_label_set_recolor(label, true);
|
||||
lv_obj_set_width(label, (lv_coord_t)platform->display->horizontal_resolution);
|
||||
lv_obj_set_style_text_align(label, LV_TEXT_ALIGN_CENTER, 0);
|
||||
lv_label_set_text(label, "Hello, world!");
|
||||
lv_obj_align(label, LV_ALIGN_CENTER, 0, -30);
|
||||
|
||||
lv_obj_t* btn = lv_btn_create(lv_parent);
|
||||
label = lv_label_create(btn);
|
||||
lv_label_set_text_static(label, "Button");
|
||||
lv_obj_align(btn, LV_ALIGN_CENTER, 0, 30);
|
||||
lv_obj_add_event_cb(btn, prv_on_button_click, LV_EVENT_CLICKED, NULL);
|
||||
|
||||
lvgl_port_unlock();
|
||||
static int32_t prv_on_create(void* param) {
|
||||
UNUSED(param);
|
||||
// lvgl_port_lock(0);
|
||||
//
|
||||
// lv_obj_t* label = lv_label_create(lv_parent);
|
||||
// lv_label_set_recolor(label, true);
|
||||
// lv_obj_set_width(label, (lv_coord_t)platform->display->horizontal_resolution);
|
||||
// lv_obj_set_style_text_align(label, LV_TEXT_ALIGN_CENTER, 0);
|
||||
// lv_label_set_text(label, "Hello, world!");
|
||||
// lv_obj_align(label, LV_ALIGN_CENTER, 0, -30);
|
||||
//
|
||||
// lv_obj_t* btn = lv_btn_create(lv_parent);
|
||||
// label = lv_label_create(btn);
|
||||
// lv_label_set_text_static(label, "Button");
|
||||
// lv_obj_align(btn, LV_ALIGN_CENTER, 0, 30);
|
||||
// lv_obj_add_event_cb(btn, prv_on_button_click, LV_EVENT_CLICKED, NULL);
|
||||
//
|
||||
// lvgl_port_unlock();
|
||||
return 0;
|
||||
}
|
||||
|
||||
nb_app_t hello_world_app = {
|
||||
const nb_app_t hello_world_app = {
|
||||
.id = "helloworld",
|
||||
.name = "Hello World",
|
||||
.type = USER,
|
||||
.on_create = &prv_on_create,
|
||||
.on_update = NULL,
|
||||
.on_destroy = NULL
|
||||
.entry_point = &prv_on_create,
|
||||
.stack_size = 2048,
|
||||
.priority = 10
|
||||
};
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
#ifndef NANOBAKE_HELLO_WORLD_H
|
||||
#define NANOBAKE_HELLO_WORLD_H
|
||||
#pragma once
|
||||
|
||||
#include "nb_app.h"
|
||||
|
||||
extern nb_app_t hello_world_app;
|
||||
|
||||
#endif //NANOBAKE_HELLO_WORLD_H
|
||||
extern const nb_app_t hello_world_app;
|
||||
|
||||
+2
-2
@@ -8,7 +8,7 @@
|
||||
#include "hello_world/hello_world.h"
|
||||
|
||||
void app_main(void) {
|
||||
static nb_platform_config_t platform_config = {
|
||||
static nb_config_t platform_config = {
|
||||
.display_driver = &board_2432s024_create_display_driver,
|
||||
.touch_driver = &board_2432s024_create_touch_driver,
|
||||
.apps = {
|
||||
@@ -16,5 +16,5 @@ void app_main(void) {
|
||||
}
|
||||
};
|
||||
|
||||
nanobake_run(&platform_config);
|
||||
nanobake_start(&platform_config);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user