Compare commits
10
Commits
3bfbcc7779
...
dev
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
864be4475c | ||
|
|
f0c611c5c8 | ||
|
|
74e449a214 | ||
|
|
e8e32b8993 | ||
|
|
be80536843 | ||
|
|
6494380cb5 | ||
|
|
1afcb24daf | ||
|
|
c884a61f6e | ||
|
|
b57a9eac15 | ||
|
|
2a7b9e17bc |
No files matched your search
@@ -4,3 +4,4 @@ build
|
||||
managed_components
|
||||
dependencies.lock
|
||||
sdkconfig.old
|
||||
sdkconfig
|
||||
+1
-1
@@ -1 +1 @@
|
||||
idf_component_register(SRCS "zh_sim_race_button_box.c" INCLUDE_DIRS "" REQUIRES zh_160x_i2c zh_encoder zh_ota_server zh_menu esp_wifi nvs_flash)
|
||||
idf_component_register(SRCS "zh_sim_race_button_box.c" INCLUDE_DIRS "" REQUIRES zh_160x_i2c zh_encoder zh_ota_server zh_menu zh_aht esp_wifi nvs_flash)
|
||||
@@ -14,3 +14,5 @@ dependencies:
|
||||
git: "https://github.com/aZholtikov/zh_encoder.git"
|
||||
zh_menu:
|
||||
git: "https://github.com/aZholtikov/zh_menu.git"
|
||||
zh_aht:
|
||||
git: "https://github.com/aZholtikov/zh_aht.git"
|
||||
+556
-535
File diff suppressed because it is too large.
Load diff
@@ -2,84 +2,57 @@
|
||||
|
||||
#include "nvs_flash.h"
|
||||
#include "esp_wifi.h"
|
||||
#include "math.h"
|
||||
#include "zh_menu.h"
|
||||
#include "zh_160x_i2c.h"
|
||||
#include "zh_encoder.h"
|
||||
#include "zh_ota_server.h"
|
||||
#include "zh_aht.h"
|
||||
|
||||
#define ENCODER_NUMBER 0x01
|
||||
#define MENU_VIEWPORT_ROWS 3
|
||||
#define MENU_LABEL_LEN 17
|
||||
#define LCD_TOTAL_ROWS 4
|
||||
#define LCD_TOTAL_COLS 16
|
||||
|
||||
/* ---------- Размеры view ---------- */
|
||||
#define VIEW_CELLS 5 /* ячеек в массиве данных (main) */
|
||||
#define VIEW_ROWS 4 /* строк отрисовывается на LCD */
|
||||
#define NVS_NAMESPACE "sim_race_box"
|
||||
#define NVS_KEY_SETTINGS "settings"
|
||||
|
||||
/* ---------- Пул основных экранов (idle) — 5 массивов ---------- */
|
||||
extern int16_t main_race_data[VIEW_CELLS];
|
||||
extern int16_t main_engine_data[VIEW_CELLS];
|
||||
extern int16_t main_times_data[VIEW_CELLS];
|
||||
extern int16_t main_debug_data[VIEW_CELLS];
|
||||
extern int16_t main_blank_data[VIEW_CELLS];
|
||||
#define STATS_TASK_PRIORITY tskIDLE_PRIORITY
|
||||
#define STATS_TASK_STACK_SIZE configMINIMAL_STACK_SIZE
|
||||
#define AHT_TASK_PRIORITY tskIDLE_PRIORITY + 3
|
||||
#define AHT_TASK_STACK_SIZE configMINIMAL_STACK_SIZE
|
||||
#define EXPANDER_TASK_PRIORITY tskIDLE_PRIORITY + 5
|
||||
#define EXPANDER_TASK_STACK_SIZE configMINIMAL_STACK_SIZE
|
||||
#define ENCODER_TASK_PRIORITY tskIDLE_PRIORITY + 4
|
||||
#define ENCODER_TASK_STACK_SIZE configMINIMAL_STACK_SIZE
|
||||
#define ENCODER_QUEUE_SIZE 5
|
||||
#define MENU_TASK_PRIORITY tskIDLE_PRIORITY + 4
|
||||
#define MENU_TASK_STACK_SIZE configMINIMAL_STACK_SIZE + 1280
|
||||
#define MENU_QUEUE_SIZE 20
|
||||
|
||||
/* ---------- Динамические буферы меток ---------- */
|
||||
extern char lbl_temp_on[MENU_LABEL_LEN];
|
||||
extern char lbl_temp_off[MENU_LABEL_LEN];
|
||||
extern char lbl_pw_ch_1[MENU_LABEL_LEN];
|
||||
extern char lbl_pw_ch_2[MENU_LABEL_LEN];
|
||||
extern char lbl_pw_ch_3[MENU_LABEL_LEN];
|
||||
extern char lbl_pw_ch_4[MENU_LABEL_LEN];
|
||||
extern char lbl_boot_screen[MENU_LABEL_LEN]; /* "B: <имя load-экрана>" */
|
||||
extern char lbl_main_screen[MENU_LABEL_LEN]; /* "M: <имя main-экрана>" */
|
||||
#define WIFI_AP_SSID "CABANLEO"
|
||||
#define WIFI_AP_PASS "cabanleo"
|
||||
#define WIFI_AP_CHANNEL 1
|
||||
#define MAX_AP_CONNECTION 4
|
||||
|
||||
/* ---------- Переменные значений ---------- */
|
||||
extern int16_t g_temp_on;
|
||||
extern int16_t g_temp_off;
|
||||
extern uint8_t g_pw_ch[4];
|
||||
#define MODE_ENCODER_NUMBER 1
|
||||
#define MODE_ENCODER_A_GPIO GPIO_NUM_4
|
||||
#define MODE_ENCODER_B_GPIO GPIO_NUM_16
|
||||
#define MODE_ENCODER_S_GPIO GPIO_NUM_15
|
||||
|
||||
/* ---------- Callbacks ---------- */
|
||||
void zh_menu_enter_main_menu_callback(void *arg);
|
||||
void zh_menu_exit_main_menu_callback(void *arg);
|
||||
void zh_menu_change_menu_callback(zh_menu_node_t *current_node, uint8_t current_index);
|
||||
void zh_menu_selectable_item_callback(void *arg);
|
||||
void zh_menu_simple_item_callback(void *args);
|
||||
void zh_menu_back_command_callback(void *arg);
|
||||
void zh_menu_boot_screen_callback(void *arg);
|
||||
void zh_menu_main_screen_callback(void *arg);
|
||||
#define EXPANDERS_I2C_SCL_GPIO GPIO_NUM_26
|
||||
#define EXPANDERS_I2C_SDA_GPIO GPIO_NUM_25
|
||||
#define EXPANDERS_INT_GPIO GPIO_NUM_17
|
||||
|
||||
#define AHT_I2C_SCL_GPIO GPIO_NUM_22
|
||||
#define AHT_I2C_SDA_GPIO GPIO_NUM_21
|
||||
|
||||
#define LCD_I2C_ADDRESS 0x27
|
||||
#define BUTTON_I2C_ADDRESS 0x24
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
zh_menu_node_t main_menu = {
|
||||
.label = "Settings",
|
||||
.submenu = (zh_menu_node_t[]){
|
||||
{.label = "Screens", .submenu = (zh_menu_node_t[]){
|
||||
{.label = lbl_boot_screen, .item_cb = &zh_menu_boot_screen_callback, .selectable = true},
|
||||
{.label = lbl_main_screen, .item_cb = &zh_menu_main_screen_callback, .selectable = true},
|
||||
{.label = "Back", .item_cb = &zh_menu_back_command_callback},
|
||||
},
|
||||
.item_numbers = 3},
|
||||
{.label = "Air condition", .submenu = (zh_menu_node_t[]){
|
||||
{.label = lbl_temp_on, .item_cb = &zh_menu_selectable_item_callback, .selectable = true},
|
||||
{.label = lbl_temp_off, .item_cb = &zh_menu_selectable_item_callback, .selectable = true},
|
||||
{.label = "Back", .item_cb = &zh_menu_back_command_callback},
|
||||
},
|
||||
.item_numbers = 3},
|
||||
{.label = "Lights", .submenu = (zh_menu_node_t[]){
|
||||
{.label = lbl_pw_ch_1, .item_cb = &zh_menu_selectable_item_callback, .selectable = true},
|
||||
{.label = lbl_pw_ch_2, .item_cb = &zh_menu_selectable_item_callback, .selectable = true},
|
||||
{.label = lbl_pw_ch_3, .item_cb = &zh_menu_selectable_item_callback, .selectable = true},
|
||||
{.label = lbl_pw_ch_4, .item_cb = &zh_menu_selectable_item_callback, .selectable = true},
|
||||
{.label = "Back", .item_cb = &zh_menu_back_command_callback},
|
||||
},
|
||||
.item_numbers = 5},
|
||||
{.label = "Exit", .item_cb = &zh_menu_back_command_callback},
|
||||
},
|
||||
.item_numbers = 4,
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
@@ -1,8 +0,0 @@
|
||||
# Name, Type, SubType, Offset, Size, Flags
|
||||
# Note: if you have increased the bootloader size, make sure to update the offsets to avoid overlap
|
||||
nvs, data, nvs, , 0x6000,
|
||||
otadata, data, ota, , 0x2000,
|
||||
phy_init, data, phy, , 0x1000,
|
||||
ota_0, app, ota_0, , 3500K,
|
||||
ota_1, app, ota_1, , 3500K,
|
||||
storage, data,fat , , 1M,
|
||||
|
@@ -670,26 +670,17 @@ CONFIG_ESPTOOLPY_FLASHFREQ_40M=y
|
||||
# CONFIG_ESPTOOLPY_FLASHFREQ_20M is not set
|
||||
# default:
|
||||
CONFIG_ESPTOOLPY_FLASHFREQ="40m"
|
||||
# default:
|
||||
# CONFIG_ESPTOOLPY_FLASHSIZE_1MB is not set
|
||||
# default:
|
||||
CONFIG_ESPTOOLPY_FLASHSIZE_2MB=y
|
||||
# default:
|
||||
# CONFIG_ESPTOOLPY_FLASHSIZE_4MB is not set
|
||||
# default:
|
||||
# CONFIG_ESPTOOLPY_FLASHSIZE_2MB is not set
|
||||
CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y
|
||||
# CONFIG_ESPTOOLPY_FLASHSIZE_8MB is not set
|
||||
# default:
|
||||
# CONFIG_ESPTOOLPY_FLASHSIZE_16MB is not set
|
||||
# default:
|
||||
# CONFIG_ESPTOOLPY_FLASHSIZE_32MB is not set
|
||||
# default:
|
||||
# CONFIG_ESPTOOLPY_FLASHSIZE_64MB is not set
|
||||
# default:
|
||||
# CONFIG_ESPTOOLPY_FLASHSIZE_128MB is not set
|
||||
# default:
|
||||
CONFIG_ESPTOOLPY_FLASHSIZE="2MB"
|
||||
# default:
|
||||
# CONFIG_ESPTOOLPY_HEADER_FLASHSIZE_UPDATE is not set
|
||||
CONFIG_ESPTOOLPY_FLASHSIZE="4MB"
|
||||
CONFIG_ESPTOOLPY_HEADER_FLASHSIZE_UPDATE=y
|
||||
# default:
|
||||
CONFIG_ESPTOOLPY_BEFORE_RESET=y
|
||||
# default:
|
||||
@@ -709,20 +700,15 @@ CONFIG_ESPTOOLPY_MONITOR_BAUD=115200
|
||||
#
|
||||
# Partition Table
|
||||
#
|
||||
# default:
|
||||
CONFIG_PARTITION_TABLE_SINGLE_APP=y
|
||||
# default:
|
||||
# CONFIG_PARTITION_TABLE_SINGLE_APP is not set
|
||||
# CONFIG_PARTITION_TABLE_SINGLE_APP_LARGE is not set
|
||||
# default:
|
||||
# CONFIG_PARTITION_TABLE_TWO_OTA is not set
|
||||
# default:
|
||||
# CONFIG_PARTITION_TABLE_TWO_OTA_LARGE is not set
|
||||
# default:
|
||||
CONFIG_PARTITION_TABLE_TWO_OTA_LARGE=y
|
||||
# CONFIG_PARTITION_TABLE_CUSTOM is not set
|
||||
# default:
|
||||
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv"
|
||||
# default:
|
||||
CONFIG_PARTITION_TABLE_FILENAME="partitions_singleapp.csv"
|
||||
CONFIG_PARTITION_TABLE_FILENAME="partitions_two_ota_large.csv"
|
||||
# default:
|
||||
CONFIG_PARTITION_TABLE_OFFSET=0x8000
|
||||
# default:
|
||||
@@ -1655,14 +1641,11 @@ CONFIG_ESP_STDIO_MAX_VFS_ENTRIES=2
|
||||
#
|
||||
# ESP System Settings
|
||||
#
|
||||
# default:
|
||||
# CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_80 is not set
|
||||
# CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_160 is not set
|
||||
CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_240=y
|
||||
# default:
|
||||
CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_160=y
|
||||
# default:
|
||||
# CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_240 is not set
|
||||
# default:
|
||||
CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ=160
|
||||
CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ=240
|
||||
|
||||
#
|
||||
# Memory
|
||||
@@ -2400,28 +2383,26 @@ CONFIG_LOG_VERSION=1
|
||||
#
|
||||
# Log Level
|
||||
#
|
||||
# default:
|
||||
# CONFIG_LOG_DEFAULT_LEVEL_NONE is not set
|
||||
# default:
|
||||
# CONFIG_LOG_DEFAULT_LEVEL_ERROR is not set
|
||||
# default:
|
||||
CONFIG_LOG_DEFAULT_LEVEL_ERROR=y
|
||||
# CONFIG_LOG_DEFAULT_LEVEL_WARN is not set
|
||||
# default:
|
||||
CONFIG_LOG_DEFAULT_LEVEL_INFO=y
|
||||
# default:
|
||||
# CONFIG_LOG_DEFAULT_LEVEL_INFO is not set
|
||||
# CONFIG_LOG_DEFAULT_LEVEL_DEBUG is not set
|
||||
# default:
|
||||
# CONFIG_LOG_DEFAULT_LEVEL_VERBOSE is not set
|
||||
# default:
|
||||
CONFIG_LOG_DEFAULT_LEVEL=3
|
||||
CONFIG_LOG_DEFAULT_LEVEL=1
|
||||
# default:
|
||||
CONFIG_LOG_MAXIMUM_EQUALS_DEFAULT=y
|
||||
# default:
|
||||
# CONFIG_LOG_MAXIMUM_LEVEL_WARN is not set
|
||||
# default:
|
||||
# CONFIG_LOG_MAXIMUM_LEVEL_INFO is not set
|
||||
# default:
|
||||
# CONFIG_LOG_MAXIMUM_LEVEL_DEBUG is not set
|
||||
# default:
|
||||
# CONFIG_LOG_MAXIMUM_LEVEL_VERBOSE is not set
|
||||
# default:
|
||||
CONFIG_LOG_MAXIMUM_LEVEL=3
|
||||
CONFIG_LOG_MAXIMUM_LEVEL=1
|
||||
|
||||
#
|
||||
# Level Settings
|
||||
@@ -3598,9 +3579,9 @@ CONFIG_CONSOLE_UART=y
|
||||
CONFIG_CONSOLE_UART_NUM=0
|
||||
CONFIG_CONSOLE_UART_BAUDRATE=115200
|
||||
# CONFIG_ESP32_DEFAULT_CPU_FREQ_80 is not set
|
||||
CONFIG_ESP32_DEFAULT_CPU_FREQ_160=y
|
||||
# CONFIG_ESP32_DEFAULT_CPU_FREQ_240 is not set
|
||||
CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ=160
|
||||
# CONFIG_ESP32_DEFAULT_CPU_FREQ_160 is not set
|
||||
CONFIG_ESP32_DEFAULT_CPU_FREQ_240=y
|
||||
CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ=240
|
||||
CONFIG_TRACEMEM_RESERVE_DRAM=0x0
|
||||
# CONFIG_ESP32_PANIC_PRINT_HALT is not set
|
||||
CONFIG_ESP32_PANIC_PRINT_REBOOT=y
|
||||
|
||||
Reference in new issue
Block a user