Refactor emotion assets and update documentation
Moved and updated emotion asset files, removing old versions from main/emotions and adding new ones to assets/emotions. Introduced emotion_manager module. Updated .gitignore, README, and build configuration files to reflect these changes. Removed assets/logoIro.c and added assets/logoIroScreen.c.
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -2,3 +2,4 @@
|
||||
/managed_components
|
||||
.vscode/settings.json
|
||||
/ref_demo
|
||||
/.cache
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
<H1>Iro Bot</H1><br>
|
||||
Here lay the test files for iro bot, a passive presence in your life with a modular body.
|
||||
# Iro Bot AMOLED
|
||||
|
||||
Iro Bot is an ESP32‑S3 based interactive robot that drives a 1.8" SH8601 QSPI AMOLED display and an FT5x06 touch controller...
|
||||
3823
assets/emotions/blink.h
Normal file
3823
assets/emotions/blink.h
Normal file
File diff suppressed because it is too large
Load Diff
533
assets/logoIro.c
533
assets/logoIro.c
File diff suppressed because one or more lines are too long
54990
assets/logoIroScreen.c
Normal file
54990
assets/logoIroScreen.c
Normal file
File diff suppressed because it is too large
Load Diff
@@ -2,11 +2,11 @@ dependencies:
|
||||
esp_lcd_sh8601:
|
||||
dependencies: []
|
||||
source:
|
||||
path: /Users/neil/Coding/iroBot/components/esp_lcd_sh8601
|
||||
path: C:\Users\neila\Coding\iroBotAMOLED\components\esp_lcd_sh8601
|
||||
type: local
|
||||
version: 1.0.0
|
||||
espressif/esp_io_expander:
|
||||
component_hash: abf3ea0d71407d79d15500550aa3ba433848459b0fa94717cf9478822593ee5d
|
||||
component_hash: 034903704f65e3994d7cce9d080b19d89525cf6d416574b932826adf680f3942
|
||||
dependencies:
|
||||
- name: idf
|
||||
require: private
|
||||
@@ -14,7 +14,7 @@ dependencies:
|
||||
source:
|
||||
registry_url: https://components.espressif.com
|
||||
type: service
|
||||
version: 1.1.0
|
||||
version: 1.2.0
|
||||
espressif/esp_io_expander_tca9554:
|
||||
component_hash: e9e49ddb1038c2b54b13c51b5e3e6dbdd10a878959c8ab0e0a7c8206316add61
|
||||
dependencies:
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
idf_component_register(
|
||||
SRCS "main.c"
|
||||
INCLUDE_DIRS ".")
|
||||
SRCS "main.c" "emotion_manager.c" "app_gifdec.c"
|
||||
INCLUDE_DIRS "." ".."
|
||||
PRIV_REQUIRES esp_lcd lvgl esp_adc espressif__esp_io_expander espressif__esp_io_expander_tca9554 espressif__esp_lcd_touch espressif__esp_lcd_touch_ft5x06 esp_lcd_sh8601
|
||||
)
|
||||
|
||||
set_source_files_properties(
|
||||
${LV_DEMOS_SOURCES}
|
||||
|
||||
@@ -20,9 +20,7 @@ typedef struct Table {
|
||||
} Table;
|
||||
|
||||
/* Memory buffer read helpers */
|
||||
static size_t
|
||||
mem_read(gd_GIF *gif, void *buf, size_t count)
|
||||
{
|
||||
static size_t mem_read(app_gd_GIF *gif, void *buf, size_t count) {
|
||||
size_t avail = gif->data_size - gif->pos;
|
||||
size_t to_read = (count < avail) ? count : avail;
|
||||
memcpy(buf, gif->data + gif->pos, to_read);
|
||||
@@ -30,42 +28,33 @@ mem_read(gd_GIF *gif, void *buf, size_t count)
|
||||
return to_read;
|
||||
}
|
||||
|
||||
static void
|
||||
mem_seek(gd_GIF *gif, size_t offset)
|
||||
{
|
||||
gif->pos = offset;
|
||||
}
|
||||
static void mem_seek(app_gd_GIF *gif, size_t offset) { gif->pos = offset; }
|
||||
|
||||
static void
|
||||
mem_skip(gd_GIF *gif, size_t count)
|
||||
{
|
||||
static void mem_skip(app_gd_GIF *gif, size_t count) {
|
||||
gif->pos += count;
|
||||
if (gif->pos > gif->data_size)
|
||||
gif->pos = gif->data_size;
|
||||
}
|
||||
|
||||
static uint16_t
|
||||
read_num(gd_GIF *gif)
|
||||
{
|
||||
static uint16_t read_num(app_gd_GIF *gif) {
|
||||
uint8_t bytes[2];
|
||||
mem_read(gif, bytes, 2);
|
||||
return bytes[0] + (((uint16_t) bytes[1]) << 8);
|
||||
return bytes[0] + (((uint16_t)bytes[1]) << 8);
|
||||
}
|
||||
|
||||
gd_GIF *
|
||||
gd_open_gif_mem(const uint8_t *data, size_t size)
|
||||
{
|
||||
app_gd_GIF *app_gd_open_gif_mem(const uint8_t *data, size_t size) {
|
||||
uint8_t sigver[3];
|
||||
uint16_t width, height, depth;
|
||||
uint8_t fdsz, bgidx, aspect;
|
||||
int i;
|
||||
uint8_t *bgcolor;
|
||||
int gct_sz;
|
||||
gd_GIF *gif;
|
||||
app_gd_GIF *gif;
|
||||
|
||||
/* Create gd_GIF Structure first to use mem_read */
|
||||
gif = calloc(1, sizeof(*gif));
|
||||
if (!gif) return NULL;
|
||||
if (!gif)
|
||||
return NULL;
|
||||
|
||||
gif->data = data;
|
||||
gif->data_size = size;
|
||||
@@ -118,10 +107,10 @@ gd_open_gif_mem(const uint8_t *data, size_t size)
|
||||
gif->canvas = &gif->frame[width * height];
|
||||
if (gif->bgindex)
|
||||
memset(gif->frame, gif->bgindex, gif->width * gif->height);
|
||||
bgcolor = &gif->palette->colors[gif->bgindex*3];
|
||||
if (bgcolor[0] || bgcolor[1] || bgcolor [2])
|
||||
bgcolor = &gif->palette->colors[gif->bgindex * 3];
|
||||
if (bgcolor[0] || bgcolor[1] || bgcolor[2])
|
||||
for (i = 0; i < gif->width * gif->height; i++)
|
||||
memcpy(&gif->canvas[i*3], bgcolor, 3);
|
||||
memcpy(&gif->canvas[i * 3], bgcolor, 3);
|
||||
gif->anim_start = gif->pos;
|
||||
return gif;
|
||||
|
||||
@@ -130,9 +119,7 @@ fail:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
discard_sub_blocks(gd_GIF *gif)
|
||||
{
|
||||
static void discard_sub_blocks(app_gd_GIF *gif) {
|
||||
uint8_t size;
|
||||
|
||||
do {
|
||||
@@ -141,18 +128,14 @@ discard_sub_blocks(gd_GIF *gif)
|
||||
} while (size);
|
||||
}
|
||||
|
||||
static void
|
||||
read_plain_text_ext(gd_GIF *gif)
|
||||
{
|
||||
static void read_plain_text_ext(app_gd_GIF *gif) {
|
||||
/* Discard plain text metadata. */
|
||||
mem_skip(gif, 13);
|
||||
/* Discard plain text sub-blocks. */
|
||||
discard_sub_blocks(gif);
|
||||
}
|
||||
|
||||
static void
|
||||
read_graphic_control_ext(gd_GIF *gif)
|
||||
{
|
||||
static void read_graphic_control_ext(app_gd_GIF *gif) {
|
||||
uint8_t rdit;
|
||||
|
||||
/* Discard block size (always 0x04). */
|
||||
@@ -167,16 +150,12 @@ read_graphic_control_ext(gd_GIF *gif)
|
||||
mem_skip(gif, 1);
|
||||
}
|
||||
|
||||
static void
|
||||
read_comment_ext(gd_GIF *gif)
|
||||
{
|
||||
static void read_comment_ext(app_gd_GIF *gif) {
|
||||
/* Discard comment sub-blocks. */
|
||||
discard_sub_blocks(gif);
|
||||
}
|
||||
|
||||
static void
|
||||
read_application_ext(gd_GIF *gif)
|
||||
{
|
||||
static void read_application_ext(app_gd_GIF *gif) {
|
||||
char app_id[8];
|
||||
char app_auth_code[3];
|
||||
|
||||
@@ -197,9 +176,7 @@ read_application_ext(gd_GIF *gif)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
read_ext(gd_GIF *gif)
|
||||
{
|
||||
static void read_ext(app_gd_GIF *gif) {
|
||||
uint8_t label;
|
||||
|
||||
mem_read(gif, &label, 1);
|
||||
@@ -221,18 +198,16 @@ read_ext(gd_GIF *gif)
|
||||
}
|
||||
}
|
||||
|
||||
static Table *
|
||||
new_table(int key_size)
|
||||
{
|
||||
static Table *new_table(int key_size) {
|
||||
int key;
|
||||
int init_bulk = MAX(1 << (key_size + 1), 0x100);
|
||||
Table *table = malloc(sizeof(*table) + sizeof(Entry) * init_bulk);
|
||||
if (table) {
|
||||
table->bulk = init_bulk;
|
||||
table->nentries = (1 << key_size) + 2;
|
||||
table->entries = (Entry *) &table[1];
|
||||
table->entries = (Entry *)&table[1];
|
||||
for (key = 0; key < (1 << key_size); key++)
|
||||
table->entries[key] = (Entry) {1, 0xFFF, key};
|
||||
table->entries[key] = (Entry){1, 0xFFF, key};
|
||||
}
|
||||
return table;
|
||||
}
|
||||
@@ -241,27 +216,26 @@ new_table(int key_size)
|
||||
* 0 on success
|
||||
* +1 if key size must be incremented after this addition
|
||||
* -1 if could not realloc table */
|
||||
static int
|
||||
add_entry(Table **tablep, uint16_t length, uint16_t prefix, uint8_t suffix)
|
||||
{
|
||||
static int add_entry(Table **tablep, uint16_t length, uint16_t prefix,
|
||||
uint8_t suffix) {
|
||||
Table *table = *tablep;
|
||||
if (table->nentries == table->bulk) {
|
||||
table->bulk *= 2;
|
||||
table = realloc(table, sizeof(*table) + sizeof(Entry) * table->bulk);
|
||||
if (!table) return -1;
|
||||
table->entries = (Entry *) &table[1];
|
||||
if (!table)
|
||||
return -1;
|
||||
table->entries = (Entry *)&table[1];
|
||||
*tablep = table;
|
||||
}
|
||||
table->entries[table->nentries] = (Entry) {length, prefix, suffix};
|
||||
table->entries[table->nentries] = (Entry){length, prefix, suffix};
|
||||
table->nentries++;
|
||||
if ((table->nentries & (table->nentries - 1)) == 0)
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static uint16_t
|
||||
get_key(gd_GIF *gif, int key_size, uint8_t *sub_len, uint8_t *shift, uint8_t *byte)
|
||||
{
|
||||
static uint16_t get_key(app_gd_GIF *gif, int key_size, uint8_t *sub_len,
|
||||
uint8_t *shift, uint8_t *byte) {
|
||||
int bits_read;
|
||||
int rpad;
|
||||
int frag_size;
|
||||
@@ -281,7 +255,7 @@ get_key(gd_GIF *gif, int key_size, uint8_t *sub_len, uint8_t *shift, uint8_t *by
|
||||
(*sub_len)--;
|
||||
}
|
||||
frag_size = MIN(key_size - bits_read, 8 - rpad);
|
||||
key |= ((uint16_t) ((*byte) >> rpad)) << bits_read;
|
||||
key |= ((uint16_t)((*byte) >> rpad)) << bits_read;
|
||||
}
|
||||
/* Clear extra bits to the left. */
|
||||
key &= (1 << key_size) - 1;
|
||||
@@ -290,9 +264,7 @@ get_key(gd_GIF *gif, int key_size, uint8_t *sub_len, uint8_t *shift, uint8_t *by
|
||||
}
|
||||
|
||||
/* Compute output index of y-th input line, in frame of height h. */
|
||||
static int
|
||||
interlaced_line_index(int h, int y)
|
||||
{
|
||||
static int interlaced_line_index(int h, int y) {
|
||||
int p; /* number of lines in current pass */
|
||||
|
||||
p = (h - 1) / 8 + 1;
|
||||
@@ -313,20 +285,18 @@ interlaced_line_index(int h, int y)
|
||||
|
||||
/* Decompress image pixels.
|
||||
* Return 0 on success or -1 on out-of-memory (w.r.t. LZW code table). */
|
||||
static int
|
||||
read_image_data(gd_GIF *gif, int interlace)
|
||||
{
|
||||
static int read_image_data(app_gd_GIF *gif, int interlace) {
|
||||
uint8_t sub_len, shift, byte;
|
||||
int init_key_size, key_size, table_is_full = 0;
|
||||
int frm_off, frm_size, str_len = 0, i, p, x, y;
|
||||
uint16_t key, clear, stop;
|
||||
int ret;
|
||||
Table *table;
|
||||
Entry entry;
|
||||
Entry entry = {0};
|
||||
size_t start, end;
|
||||
|
||||
mem_read(gif, &byte, 1);
|
||||
key_size = (int) byte;
|
||||
key_size = (int)byte;
|
||||
if (key_size < 2 || key_size > 8)
|
||||
return -1;
|
||||
|
||||
@@ -343,7 +313,7 @@ read_image_data(gd_GIF *gif, int interlace)
|
||||
key = get_key(gif, key_size, &sub_len, &shift, &byte); /* clear code */
|
||||
frm_off = 0;
|
||||
ret = 0;
|
||||
frm_size = gif->fw*gif->fh;
|
||||
frm_size = gif->fw * gif->fh;
|
||||
while (frm_off < frm_size) {
|
||||
if (key == clear) {
|
||||
key_size = init_key_size;
|
||||
@@ -361,9 +331,12 @@ read_image_data(gd_GIF *gif, int interlace)
|
||||
}
|
||||
}
|
||||
key = get_key(gif, key_size, &sub_len, &shift, &byte);
|
||||
if (key == clear) continue;
|
||||
if (key == stop || key == 0x1000) break;
|
||||
if (ret == 1) key_size++;
|
||||
if (key == clear)
|
||||
continue;
|
||||
if (key == stop || key == 0x1000)
|
||||
break;
|
||||
if (ret == 1)
|
||||
key_size++;
|
||||
entry = table->entries[key];
|
||||
str_len = entry.length;
|
||||
for (i = 0; i < str_len; i++) {
|
||||
@@ -371,7 +344,7 @@ read_image_data(gd_GIF *gif, int interlace)
|
||||
x = p % gif->fw;
|
||||
y = p / gif->fw;
|
||||
if (interlace)
|
||||
y = interlaced_line_index((int) gif->fh, y);
|
||||
y = interlaced_line_index((int)gif->fh, y);
|
||||
gif->frame[(gif->fy + y) * gif->width + gif->fx + x] = entry.suffix;
|
||||
if (entry.prefix == 0xFFF)
|
||||
break;
|
||||
@@ -391,9 +364,7 @@ read_image_data(gd_GIF *gif, int interlace)
|
||||
|
||||
/* Read image.
|
||||
* Return 0 on success or -1 on out-of-memory (w.r.t. LZW code table). */
|
||||
static int
|
||||
read_image(gd_GIF *gif)
|
||||
{
|
||||
static int read_image(app_gd_GIF *gif) {
|
||||
uint8_t fisrz;
|
||||
int interlace;
|
||||
|
||||
@@ -425,35 +396,31 @@ read_image(gd_GIF *gif)
|
||||
return read_image_data(gif, interlace);
|
||||
}
|
||||
|
||||
static void
|
||||
render_frame_rect(gd_GIF *gif, uint8_t *buffer)
|
||||
{
|
||||
static void render_frame_rect(app_gd_GIF *gif, uint8_t *buffer) {
|
||||
int i, j, k;
|
||||
uint8_t index, *color;
|
||||
i = gif->fy * gif->width + gif->fx;
|
||||
for (j = 0; j < gif->fh; j++) {
|
||||
for (k = 0; k < gif->fw; k++) {
|
||||
index = gif->frame[(gif->fy + j) * gif->width + gif->fx + k];
|
||||
color = &gif->palette->colors[index*3];
|
||||
color = &gif->palette->colors[index * 3];
|
||||
if (!gif->gce.transparency || index != gif->gce.tindex)
|
||||
memcpy(&buffer[(i+k)*3], color, 3);
|
||||
memcpy(&buffer[(i + k) * 3], color, 3);
|
||||
}
|
||||
i += gif->width;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
dispose(gd_GIF *gif)
|
||||
{
|
||||
static void dispose(app_gd_GIF *gif) {
|
||||
int i, j, k;
|
||||
uint8_t *bgcolor;
|
||||
switch (gif->gce.disposal) {
|
||||
case 2: /* Restore to background color. */
|
||||
bgcolor = &gif->palette->colors[gif->bgindex*3];
|
||||
bgcolor = &gif->palette->colors[gif->bgindex * 3];
|
||||
i = gif->fy * gif->width + gif->fx;
|
||||
for (j = 0; j < gif->fh; j++) {
|
||||
for (k = 0; k < gif->fw; k++)
|
||||
memcpy(&gif->canvas[(i+k)*3], bgcolor, 3);
|
||||
memcpy(&gif->canvas[(i + k) * 3], bgcolor, 3);
|
||||
i += gif->width;
|
||||
}
|
||||
break;
|
||||
@@ -466,9 +433,7 @@ dispose(gd_GIF *gif)
|
||||
}
|
||||
|
||||
/* Return 1 if got a frame; 0 if got GIF trailer; -1 if error. */
|
||||
int
|
||||
gd_get_frame(gd_GIF *gif)
|
||||
{
|
||||
int app_gd_get_frame(app_gd_GIF *gif) {
|
||||
char sep;
|
||||
|
||||
dispose(gif);
|
||||
@@ -478,7 +443,8 @@ gd_get_frame(gd_GIF *gif)
|
||||
return 0;
|
||||
if (sep == '!')
|
||||
read_ext(gif);
|
||||
else return -1;
|
||||
else
|
||||
return -1;
|
||||
mem_read(gif, &sep, 1);
|
||||
}
|
||||
if (read_image(gif) == -1)
|
||||
@@ -486,28 +452,50 @@ gd_get_frame(gd_GIF *gif)
|
||||
return 1;
|
||||
}
|
||||
|
||||
void
|
||||
gd_render_frame(gd_GIF *gif, uint8_t *buffer)
|
||||
{
|
||||
void app_gd_render_frame(app_gd_GIF *gif, uint8_t *buffer) {
|
||||
memcpy(buffer, gif->canvas, gif->width * gif->height * 3);
|
||||
render_frame_rect(gif, buffer);
|
||||
}
|
||||
|
||||
int
|
||||
gd_is_bgcolor(gd_GIF *gif, uint8_t color[3])
|
||||
{
|
||||
return !memcmp(&gif->palette->colors[gif->bgindex*3], color, 3);
|
||||
void app_gd_render_frame_to_argb(app_gd_GIF *gif, uint8_t *buffer) {
|
||||
/* 1. Copy Canvas (Background) to ARGB Buffer */
|
||||
uint32_t *dst = (uint32_t *)buffer;
|
||||
uint8_t *src = gif->canvas;
|
||||
int total_pixels = gif->width * gif->height;
|
||||
|
||||
for (int i = 0; i < total_pixels; i++) {
|
||||
/* Pack RGB to 0xAABBGGRR (Little Endian for 0xAABBGGRR -> 0xRR, 0xGG, 0xBB,
|
||||
0xAA in memory) LVGL ARGB8888 can be slightly different depending on
|
||||
config, usually 0xAARRGGBB or 0xBBGGRRAA The previous manual loop was: R,
|
||||
G, B, 0xFF (buffer[0]=R) If target is uint32, and we want R at lowest
|
||||
addr: 0xAA BB GG RR (on LE machine) -> [RR] [GG] [BB] [AA]
|
||||
*/
|
||||
dst[i] = (0xFF000000) | (src[2] << 16) | (src[1] << 8) | (src[0]);
|
||||
src += 3;
|
||||
}
|
||||
|
||||
/* 2. Render Current Frame Rect on top */
|
||||
int i = gif->fy * gif->width + gif->fx;
|
||||
for (int j = 0; j < gif->fh; j++) {
|
||||
for (int k = 0; k < gif->fw; k++) {
|
||||
uint8_t index = gif->frame[(gif->fy + j) * gif->width + gif->fx + k];
|
||||
if (!gif->gce.transparency || index != gif->gce.tindex) {
|
||||
uint8_t *color = &gif->palette->colors[index * 3];
|
||||
dst[i + k] =
|
||||
(0xFF000000) | (color[2] << 16) | (color[1] << 8) | (color[0]);
|
||||
}
|
||||
}
|
||||
i += gif->width;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
gd_rewind(gd_GIF *gif)
|
||||
{
|
||||
mem_seek(gif, gif->anim_start);
|
||||
int app_gd_is_bgcolor(app_gd_GIF *gif, uint8_t color[3]) {
|
||||
return !memcmp(&gif->palette->colors[gif->bgindex * 3], color, 3);
|
||||
}
|
||||
|
||||
void
|
||||
gd_close_gif(gd_GIF *gif)
|
||||
{
|
||||
void app_gd_rewind(app_gd_GIF *gif) { mem_seek(gif, gif->anim_start); }
|
||||
|
||||
void app_gd_close_gif(app_gd_GIF *gif) {
|
||||
free(gif->frame);
|
||||
free(gif);
|
||||
}
|
||||
|
||||
@@ -1,27 +1,27 @@
|
||||
#ifndef APP_GIFDEC_H
|
||||
#define APP_GIFDEC_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct gd_Palette {
|
||||
typedef struct app_gd_Palette {
|
||||
int size;
|
||||
uint8_t colors[0x100 * 3];
|
||||
} gd_Palette;
|
||||
} app_gd_Palette;
|
||||
|
||||
typedef struct gd_GCE {
|
||||
typedef struct app_gd_GCE {
|
||||
uint16_t delay;
|
||||
uint8_t tindex;
|
||||
uint8_t disposal;
|
||||
int input;
|
||||
int transparency;
|
||||
} gd_GCE;
|
||||
} app_gd_GCE;
|
||||
|
||||
typedef struct gd_GIF {
|
||||
typedef struct app_gd_GIF {
|
||||
const uint8_t *data;
|
||||
size_t data_size;
|
||||
size_t pos;
|
||||
@@ -29,20 +29,21 @@ typedef struct gd_GIF {
|
||||
uint16_t width, height;
|
||||
uint16_t depth;
|
||||
uint16_t loop_count;
|
||||
gd_GCE gce;
|
||||
gd_Palette *palette;
|
||||
gd_Palette lct, gct;
|
||||
app_gd_GCE gce;
|
||||
app_gd_Palette *palette;
|
||||
app_gd_Palette lct, gct;
|
||||
uint16_t fx, fy, fw, fh;
|
||||
uint8_t bgindex;
|
||||
uint8_t *canvas, *frame;
|
||||
} gd_GIF;
|
||||
} app_gd_GIF;
|
||||
|
||||
gd_GIF *gd_open_gif_mem(const uint8_t *data, size_t size);
|
||||
int gd_get_frame(gd_GIF *gif);
|
||||
void gd_render_frame(gd_GIF *gif, uint8_t *buffer);
|
||||
int gd_is_bgcolor(gd_GIF *gif, uint8_t color[3]);
|
||||
void gd_rewind(gd_GIF *gif);
|
||||
void gd_close_gif(gd_GIF *gif);
|
||||
app_gd_GIF *app_gd_open_gif_mem(const uint8_t *data, size_t size);
|
||||
int app_gd_get_frame(app_gd_GIF *gif);
|
||||
void app_gd_render_frame(app_gd_GIF *gif, uint8_t *buffer);
|
||||
void app_gd_render_frame_to_argb(app_gd_GIF *gif, uint8_t *buffer);
|
||||
int app_gd_is_bgcolor(app_gd_GIF *gif, uint8_t color[3]);
|
||||
void app_gd_rewind(app_gd_GIF *gif);
|
||||
void app_gd_close_gif(app_gd_GIF *gif);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
142
main/emotion_manager.c
Normal file
142
main/emotion_manager.c
Normal file
@@ -0,0 +1,142 @@
|
||||
#include "emotion_manager.h"
|
||||
#include "app_gifdec.h"
|
||||
#include "esp_heap_caps.h"
|
||||
#include "esp_log.h"
|
||||
#include "freertos/FreeRTOS.h"
|
||||
#include "freertos/task.h"
|
||||
#include <string.h>
|
||||
|
||||
/* Include the GIF assets */
|
||||
#include "../assets/emotions/blink.h"
|
||||
|
||||
static const char *TAG = "EMOTION_MANAGER";
|
||||
|
||||
static app_gd_GIF *current_gif = NULL;
|
||||
static lv_obj_t *img_obj = NULL;
|
||||
static lv_timer_t *update_timer = NULL;
|
||||
static uint8_t *render_buf_32 = NULL;
|
||||
static lv_img_dsc_t img_dsc;
|
||||
|
||||
typedef struct {
|
||||
const uint8_t *data;
|
||||
size_t size;
|
||||
} emotion_asset_t;
|
||||
|
||||
static const emotion_asset_t assets[EMOTION_COUNT] = {
|
||||
[EMOTION_BLINK] = {.data = blink, .size = sizeof(blink)},
|
||||
// Add placeholders for Smile and Sad if needed
|
||||
[EMOTION_SMILE] = {NULL, 0},
|
||||
[EMOTION_SAD] = {NULL, 0},
|
||||
};
|
||||
|
||||
static void timer_cb(lv_timer_t *t) {
|
||||
if (!current_gif)
|
||||
return;
|
||||
|
||||
int ret = app_gd_get_frame(current_gif);
|
||||
if (ret == 0) {
|
||||
/* End of GIF, loop back */
|
||||
app_gd_rewind(current_gif);
|
||||
ret = app_gd_get_frame(current_gif);
|
||||
}
|
||||
|
||||
if (ret > 0) {
|
||||
uint32_t start_tick = xTaskGetTickCount();
|
||||
|
||||
/* Render frame directly into 32-bit ARGB buffer */
|
||||
/* This saves memory bandwidth and CPU cycles by combining decoding and
|
||||
* swizzling */
|
||||
app_gd_render_frame_to_argb(current_gif, render_buf_32);
|
||||
|
||||
uint32_t end_tick = xTaskGetTickCount();
|
||||
uint32_t render_time_ms = (end_tick - start_tick) * portTICK_PERIOD_MS;
|
||||
|
||||
/* Refresh image */
|
||||
lv_obj_invalidate(img_obj);
|
||||
|
||||
/* Set timer period based on GIF delay */
|
||||
int delay = current_gif->gce.delay * 10;
|
||||
// ESP_LOGI(TAG, "GIF Delay form GCE: %d ms", delay);
|
||||
if (delay < 20)
|
||||
delay = 20; // Minimum delay safeguard (allow faster playback)
|
||||
|
||||
// Log Load
|
||||
ESP_LOGI(TAG, "GIF Render: %lu ms, Target Delay: %d ms, Load: %lu%%",
|
||||
render_time_ms, delay, (render_time_ms * 100) / delay);
|
||||
|
||||
lv_timer_set_period(update_timer, delay);
|
||||
}
|
||||
}
|
||||
|
||||
void emotion_manager_init(lv_obj_t *parent) {
|
||||
if (img_obj)
|
||||
return;
|
||||
|
||||
ESP_LOGI(TAG, "Initializing emotion manager");
|
||||
|
||||
/* Create the image object */
|
||||
img_obj = lv_img_create(parent);
|
||||
lv_obj_set_size(img_obj, 368, 460);
|
||||
lv_obj_center(img_obj);
|
||||
lv_obj_set_scrollbar_mode(img_obj, LV_SCROLLBAR_MODE_OFF);
|
||||
|
||||
/* Allocate buffers for frames in PSRAM */
|
||||
/* Only need 32-bit buffer now as we render directly to it */
|
||||
render_buf_32 = heap_caps_malloc(368 * 460 * 4, MALLOC_CAP_SPIRAM);
|
||||
if (!render_buf_32) {
|
||||
ESP_LOGE(TAG, "Failed to allocate render buffer in PSRAM");
|
||||
return;
|
||||
}
|
||||
|
||||
/* Setup image descriptor */
|
||||
img_dsc.header.cf = LV_IMG_CF_TRUE_COLOR_ALPHA;
|
||||
img_dsc.header.always_zero = 0;
|
||||
img_dsc.header.w = 368;
|
||||
img_dsc.header.h = 460;
|
||||
img_dsc.data_size = 368 * 460 * 4;
|
||||
img_dsc.data = render_buf_32;
|
||||
|
||||
lv_img_set_src(img_obj, &img_dsc);
|
||||
|
||||
/* Create timer for animation */
|
||||
update_timer = lv_timer_create(timer_cb, 100, NULL);
|
||||
lv_timer_pause(update_timer);
|
||||
|
||||
/* Set default emotion */
|
||||
emotion_manager_set(EMOTION_BLINK);
|
||||
}
|
||||
|
||||
void emotion_manager_set(emotion_t emotion) {
|
||||
if (emotion >= EMOTION_COUNT)
|
||||
return;
|
||||
if (!assets[emotion].data) {
|
||||
ESP_LOGW(TAG, "Asset for emotion %d not found", emotion);
|
||||
return;
|
||||
}
|
||||
|
||||
ESP_LOGI(TAG, "Setting emotion to %d", emotion);
|
||||
|
||||
lv_timer_pause(update_timer);
|
||||
|
||||
if (current_gif) {
|
||||
app_gd_close_gif(current_gif);
|
||||
current_gif = NULL;
|
||||
}
|
||||
|
||||
current_gif = app_gd_open_gif_mem(assets[emotion].data, assets[emotion].size);
|
||||
if (!current_gif) {
|
||||
ESP_LOGE(TAG, "Failed to open GIF for emotion %d", emotion);
|
||||
return;
|
||||
}
|
||||
|
||||
app_gd_rewind(current_gif);
|
||||
|
||||
/* Render first frame immediately to avoid garbage on screen */
|
||||
timer_cb(NULL);
|
||||
|
||||
lv_timer_resume(update_timer);
|
||||
}
|
||||
|
||||
void emotion_manager_update(void) {
|
||||
// This could be used for manual polling if timer is not used
|
||||
}
|
||||
41
main/emotion_manager.h
Normal file
41
main/emotion_manager.h
Normal file
@@ -0,0 +1,41 @@
|
||||
#ifndef EMOTION_MANAGER_H
|
||||
#define EMOTION_MANAGER_H
|
||||
|
||||
#include "lvgl.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef enum {
|
||||
EMOTION_BLINK,
|
||||
EMOTION_SMILE,
|
||||
EMOTION_SAD,
|
||||
EMOTION_COUNT
|
||||
} emotion_t;
|
||||
|
||||
/**
|
||||
* @brief Initialize the emotion manager
|
||||
*
|
||||
* @param parent The parent object (usually the active screen)
|
||||
*/
|
||||
void emotion_manager_init(lv_obj_t *parent);
|
||||
|
||||
/**
|
||||
* @brief Set the current emotion
|
||||
*
|
||||
* @param emotion The emotion to display
|
||||
*/
|
||||
void emotion_manager_set(emotion_t emotion);
|
||||
|
||||
/**
|
||||
* @brief Update the emotion manager (called periodically or via timer
|
||||
* internally)
|
||||
*/
|
||||
void emotion_manager_update(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // EMOTION_MANAGER_H
|
||||
File diff suppressed because it is too large
Load Diff
9351
main/emotions/face.h
9351
main/emotions/face.h
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
664
main/main.c
664
main/main.c
@@ -1,94 +1,52 @@
|
||||
/*
|
||||
* LVGL GIF display for ESP32-S3 Touch AMOLED 1.8" (SH8601)
|
||||
* Ported from ST7789 to SH8601 QSPI AMOLED display
|
||||
* Enhanced with smooth Apple-style splash screen
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
/* Standard Includes */
|
||||
#include <stdint.h>
|
||||
#include "esp_err.h"
|
||||
#include "esp_log.h"
|
||||
#include "esp_check.h"
|
||||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
|
||||
/* ESP-IDF Includes */
|
||||
#include "driver/adc.h"
|
||||
#include "driver/gpio.h"
|
||||
#include "driver/i2c.h"
|
||||
#include "driver/spi_master.h"
|
||||
#include "esp_timer.h"
|
||||
#include "esp_lcd_panel_io.h"
|
||||
#include "esp_lcd_panel_vendor.h"
|
||||
#include "esp_lcd_panel_ops.h"
|
||||
#include "freertos/FreeRTOS.h"
|
||||
#include "freertos/task.h"
|
||||
#include "freertos/semphr.h"
|
||||
#include "esp_check.h"
|
||||
#include "esp_err.h"
|
||||
#include "esp_heap_caps.h"
|
||||
#include "lvgl.h"
|
||||
#include "src/extra/libs/gif/lv_gif.h"
|
||||
#include "emotions/facetestLCD.h"
|
||||
#include "esp_log.h"
|
||||
#include "esp_timer.h"
|
||||
|
||||
/* Local & Managed Component Includes */
|
||||
#include "esp_io_expander.h"
|
||||
#include "esp_io_expander_tca9554.h"
|
||||
#include "esp_lcd_panel_io.h"
|
||||
#include "esp_lcd_panel_ops.h"
|
||||
#include "esp_lcd_panel_vendor.h"
|
||||
#include "esp_lcd_sh8601.h"
|
||||
#include "esp_lcd_touch.h"
|
||||
#include "esp_lcd_touch_ft5x06.h"
|
||||
|
||||
#include "esp_io_expander_tca9554.h"
|
||||
#include "../assets/logoIro.c"
|
||||
/* FreeRTOS Includes */
|
||||
#include "freertos/FreeRTOS.h"
|
||||
#include "freertos/queue.h"
|
||||
#include "freertos/semphr.h"
|
||||
#include "freertos/task.h"
|
||||
|
||||
/* Re-enable input devices after splash timeout */
|
||||
static void reenable_input_cb(lv_timer_t * t)
|
||||
{
|
||||
lv_indev_t *indev = lv_indev_get_next(NULL);
|
||||
while (indev) {
|
||||
lv_indev_enable(indev, true);
|
||||
indev = lv_indev_get_next(indev);
|
||||
}
|
||||
lv_timer_del(t);
|
||||
}
|
||||
/* LVGL Includes */
|
||||
#include "lvgl.h"
|
||||
|
||||
/* Helper to animate screen background color (exec callback for lv_anim) */
|
||||
static void scr_bg_anim(void * var, int32_t v)
|
||||
{
|
||||
lv_obj_t *scr = (lv_obj_t *)var;
|
||||
lv_color_t c = lv_color_hex((uint32_t)v);
|
||||
lv_obj_set_style_bg_color(scr, c, LV_PART_MAIN);
|
||||
}
|
||||
/* Project Assets */
|
||||
/* Project Assets */
|
||||
#include "../assets/logoIroScreen.c"
|
||||
#include "emotion_manager.h"
|
||||
|
||||
/* Timer callback started after fade-in completes; starts fade-out and background animation */
|
||||
static void fadeout_start_cb(lv_timer_t * t)
|
||||
{
|
||||
lv_obj_t *logo = (lv_obj_t *)t->user_data;
|
||||
if (!logo) {
|
||||
lv_timer_del(t);
|
||||
return;
|
||||
}
|
||||
// Emotions handled by emotion_manager
|
||||
|
||||
/* Start image fade-out (750 ms) */
|
||||
lv_obj_fade_out(logo, 750, 0);
|
||||
|
||||
/* Animate screen background color from sampled bg to black over 750 ms */
|
||||
lv_obj_t *scr = lv_obj_get_parent(logo);
|
||||
uint32_t from_hex = 0x000000;
|
||||
/* Try to sample from the image data if available */
|
||||
if (logoIro_img.data && logoIro_img.data_size >= 2) {
|
||||
const uint8_t *d = (const uint8_t *)logoIro_img.data;
|
||||
uint16_t pix = (uint16_t)(d[0] | (d[1] << 8));
|
||||
uint8_t r5 = (pix >> 11) & 0x1F;
|
||||
uint8_t g6 = (pix >> 5) & 0x3F;
|
||||
uint8_t b5 = pix & 0x1F;
|
||||
uint8_t r8 = (r5 * 255) / 31;
|
||||
uint8_t g8 = (g6 * 255) / 63;
|
||||
uint8_t b8 = (b5 * 255) / 31;
|
||||
from_hex = (r8 << 16) | (g8 << 8) | b8;
|
||||
}
|
||||
|
||||
lv_anim_t a;
|
||||
lv_anim_init(&a);
|
||||
lv_anim_set_var(&a, scr);
|
||||
lv_anim_set_exec_cb(&a, scr_bg_anim);
|
||||
lv_anim_set_values(&a, (int)from_hex, 0x000000);
|
||||
lv_anim_set_time(&a, 750);
|
||||
lv_anim_start(&a);
|
||||
|
||||
lv_timer_del(t);
|
||||
}
|
||||
|
||||
|
||||
|
||||
static const char *TAG __attribute__((unused)) = "LVGL_AMOLED";
|
||||
static const char *TAG = "LVGL_AMOLED";
|
||||
|
||||
/* LCD Host */
|
||||
#define LCD_HOST SPI2_HOST
|
||||
@@ -97,8 +55,6 @@ static const char *TAG __attribute__((unused)) = "LVGL_AMOLED";
|
||||
/* Color depth configuration */
|
||||
#if CONFIG_LV_COLOR_DEPTH == 32
|
||||
#define LCD_BIT_PER_PIXEL (24)
|
||||
#elif CONFIG_LV_COLOR_DEPTH == 16
|
||||
#define LCD_BIT_PER_PIXEL (16)
|
||||
#else
|
||||
#define LCD_BIT_PER_PIXEL (16)
|
||||
#endif
|
||||
@@ -114,105 +70,268 @@ static const char *TAG __attribute__((unused)) = "LVGL_AMOLED";
|
||||
#define PIN_NUM_LCD_DATA1 (GPIO_NUM_5)
|
||||
#define PIN_NUM_LCD_DATA2 (GPIO_NUM_6)
|
||||
#define PIN_NUM_LCD_DATA3 (GPIO_NUM_7)
|
||||
#define PIN_NUM_LCD_RST (-1) /* Reset via IO expander */
|
||||
#define PIN_NUM_BK_LIGHT (-1) /* Backlight via IO expander */
|
||||
#define PIN_NUM_LCD_RST (-1)
|
||||
#define PIN_NUM_BK_LIGHT (-1)
|
||||
|
||||
/* Touch I2C pins */
|
||||
#define PIN_NUM_TOUCH_SCL (GPIO_NUM_14)
|
||||
#define PIN_NUM_TOUCH_SDA (GPIO_NUM_15)
|
||||
#define PIN_NUM_TOUCH_RST (-1) /* Reset via IO expander */
|
||||
#define PIN_NUM_TOUCH_RST (-1)
|
||||
#define PIN_NUM_TOUCH_INT (GPIO_NUM_21)
|
||||
|
||||
/* Enable touch support */
|
||||
#define USE_TOUCH 1
|
||||
|
||||
/* IO Expander Pins */
|
||||
#define IO_EXPANDER_PIN_NUM_0 (1 << 0)
|
||||
#define IO_EXPANDER_PIN_NUM_1 (1 << 1)
|
||||
#define IO_EXPANDER_PIN_NUM_2 (1 << 2)
|
||||
#define IO_EXPANDER_OUTPUT (1)
|
||||
|
||||
/* LVGL configuration */
|
||||
#define LVGL_BUF_HEIGHT (LCD_V_RES / 4)
|
||||
#define LVGL_TICK_PERIOD_MS 2
|
||||
#define LVGL_TICK_PERIOD_MS 1
|
||||
#define LVGL_TASK_MAX_DELAY_MS 500
|
||||
#define LVGL_TASK_MIN_DELAY_MS 1
|
||||
#define LVGL_TASK_STACK_SIZE (8 * 1024)
|
||||
#define LVGL_TASK_PRIORITY 4
|
||||
#define LVGL_TASK_PRIORITY 10
|
||||
|
||||
/* LCD IO and panel handles */
|
||||
static esp_lcd_panel_io_handle_t lcd_io __attribute__((unused)) = NULL;
|
||||
static esp_lcd_panel_handle_t lcd_panel __attribute__((unused)) = NULL;
|
||||
static esp_lcd_panel_io_handle_t lcd_io = NULL;
|
||||
static esp_lcd_panel_handle_t lcd_panel = NULL;
|
||||
|
||||
#if USE_TOUCH
|
||||
static esp_lcd_touch_handle_t tp __attribute__((unused)) = NULL;
|
||||
static esp_lcd_touch_handle_t tp = NULL;
|
||||
#endif
|
||||
|
||||
/* LVGL mutex for thread safety */
|
||||
static SemaphoreHandle_t lvgl_mux = NULL;
|
||||
|
||||
static lv_obj_t *g_lvgl_gif __attribute__((unused)) = NULL;
|
||||
static const lv_img_dsc_t g_lvgl_gif_src __attribute__((unused)) = {
|
||||
.header.always_zero = 0,
|
||||
.header.w = 240,
|
||||
.header.h = 135,
|
||||
.header.cf = LV_IMG_CF_RAW,
|
||||
.data_size = sizeof(facetestLCD),
|
||||
.data = facetestLCD,
|
||||
};
|
||||
static bool lvgl_lock(int timeout_ms) {
|
||||
const TickType_t timeout_ticks =
|
||||
(timeout_ms == -1) ? portMAX_DELAY : pdMS_TO_TICKS(timeout_ms);
|
||||
return xSemaphoreTakeRecursive(lvgl_mux, timeout_ticks) == pdTRUE;
|
||||
}
|
||||
|
||||
static void lvgl_unlock(void) { xSemaphoreGiveRecursive(lvgl_mux); }
|
||||
|
||||
static QueueHandle_t g_event_queue = NULL;
|
||||
static lv_obj_t *g_label_time = NULL;
|
||||
static lv_obj_t *g_label_batt = NULL;
|
||||
|
||||
typedef enum {
|
||||
EVENT_TYPE_BUTTON,
|
||||
EVENT_TYPE_BATTERY_LOW,
|
||||
EVENT_TYPE_REFRESH_WATCHFACE
|
||||
} ui_event_type_t;
|
||||
|
||||
typedef struct {
|
||||
ui_event_type_t type;
|
||||
int value;
|
||||
} ui_event_t;
|
||||
/* LCD initialization commands for SH8601 */
|
||||
static const sh8601_lcd_init_cmd_t lcd_init_cmds[] = {
|
||||
{0x11, (uint8_t[]){0x00}, 0, 120},
|
||||
{0x44, (uint8_t[]){0x01, 0xD1}, 2, 0},
|
||||
{0x35, (uint8_t[]){0x00}, 1, 0},
|
||||
{0x53, (uint8_t[]){0x20}, 1, 10},
|
||||
{0x2A, (uint8_t[]){0x00, 0x00, 0x01, 0x6F}, 4, 0}, /* Column address: 0-367 */
|
||||
{0x2B, (uint8_t[]){0x00, 0x00, 0x01, 0xBF}, 4, 0}, /* Row address: 0-447 */
|
||||
{0x2A, (uint8_t[]){0x00, 0x00, 0x01, 0x6F}, 4, 0},
|
||||
{0x2B, (uint8_t[]){0x00, 0x00, 0x01, 0xBF}, 4, 0},
|
||||
{0x51, (uint8_t[]){0x00}, 1, 10},
|
||||
{0x29, (uint8_t[]){0x00}, 0, 10},
|
||||
{0x51, (uint8_t[]){0xFF}, 1, 0}, /* Max brightness */
|
||||
{0x51, (uint8_t[]){0xFF}, 1, 0},
|
||||
};
|
||||
|
||||
/* LVGL display driver variable (for flush callback) */
|
||||
static lv_disp_drv_t disp_drv;
|
||||
|
||||
/* -------------------------------------------------------------------------
|
||||
* Animation Helper Functions
|
||||
* ------------------------------------------------------------------------- */
|
||||
|
||||
static lv_color_t g_splash_bg_color;
|
||||
|
||||
static bool notify_lvgl_flush_ready(esp_lcd_panel_io_handle_t panel_io, esp_lcd_panel_io_event_data_t *edata, void *user_ctx)
|
||||
{
|
||||
static void scr_bg_fade_in_cb(void *var, int32_t v) {
|
||||
lv_obj_t *scr = (lv_obj_t *)var;
|
||||
lv_color_t black = lv_color_hex(0x000000);
|
||||
/* v: 0 (black) to 255 (target) */
|
||||
lv_obj_set_style_bg_color(scr, lv_color_mix(g_splash_bg_color, black, v),
|
||||
LV_PART_MAIN);
|
||||
}
|
||||
|
||||
static void scr_bg_fade_out_cb(void *var, int32_t v) {
|
||||
lv_obj_t *scr = (lv_obj_t *)var;
|
||||
lv_color_t black = lv_color_hex(0x000000);
|
||||
/* v: 0 (target) to 255 (black) */
|
||||
lv_obj_set_style_bg_color(scr, lv_color_mix(black, g_splash_bg_color, v),
|
||||
LV_PART_MAIN);
|
||||
}
|
||||
|
||||
static void img_opa_anim_cb(void *obj, int32_t v) {
|
||||
lv_obj_set_style_img_opa((lv_obj_t *)obj, (lv_opa_t)v, 0);
|
||||
}
|
||||
|
||||
static void img_zoom_anim_cb(void *obj, int32_t v) {
|
||||
lv_img_set_zoom((lv_obj_t *)obj, (uint16_t)v);
|
||||
}
|
||||
|
||||
static int power_get_battery_percent(void) {
|
||||
static bool adc_init = false;
|
||||
if (!adc_init) {
|
||||
adc1_config_width(ADC_WIDTH_BIT_12);
|
||||
adc1_config_channel_atten(ADC1_CHANNEL_0, ADC_ATTEN_DB_11);
|
||||
adc_init = true;
|
||||
}
|
||||
|
||||
int raw = adc1_get_raw(ADC1_CHANNEL_0);
|
||||
if (raw >= 0) {
|
||||
/* Voltage divider: Vbatt -> R1 (100k) -> ADC -> R2 (100k) -> GND */
|
||||
/* Vadj = Vraw * (3300/4095) * 2.0. */
|
||||
int voltage = (raw * 6600) / 4095;
|
||||
|
||||
/* Map 3400mV-4200mV to 0-100% */
|
||||
if (voltage >= 4200)
|
||||
return 100;
|
||||
if (voltage <= 3400)
|
||||
return 0;
|
||||
return (voltage - 3400) * 100 / (4200 - 3400);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void update_watch_face(void) {
|
||||
/* No clock or battery display as requested */
|
||||
}
|
||||
|
||||
static void start_watch_face(void) {
|
||||
lv_obj_t *scr = lv_obj_create(NULL);
|
||||
lv_obj_set_scrollbar_mode(scr, LV_SCROLLBAR_MODE_OFF);
|
||||
lv_obj_set_style_bg_color(scr, lv_color_hex(0x000000), LV_PART_MAIN);
|
||||
|
||||
/* Initialize Emotion Manager */
|
||||
emotion_manager_init(scr);
|
||||
|
||||
/* Load the watch face screen immediately */
|
||||
lv_scr_load(scr);
|
||||
}
|
||||
|
||||
#if CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS
|
||||
static void cpu_stats_task(void *arg) {
|
||||
char *stats_buffer = malloc(1024);
|
||||
if (stats_buffer == NULL) {
|
||||
ESP_LOGE(TAG, "Failed to allocate buffer for CPU stats");
|
||||
vTaskDelete(NULL);
|
||||
}
|
||||
while (1) {
|
||||
vTaskGetRunTimeStats(stats_buffer);
|
||||
ESP_LOGI(TAG, "CPU Usage:\nTask Abs Time %% Time\n%s",
|
||||
stats_buffer);
|
||||
vTaskDelay(pdMS_TO_TICKS(5000));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
static void start_main_app(void) {
|
||||
if (lvgl_lock(-1)) {
|
||||
ESP_LOGI(TAG, "Application Running");
|
||||
start_watch_face();
|
||||
lvgl_unlock();
|
||||
|
||||
#if CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS
|
||||
xTaskCreate(cpu_stats_task, "cpu_stats", 4096, NULL, 1, NULL);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
// The original `start_main_app` content was replaced by the new
|
||||
// `start_watch_face` call. The GIF creation part is removed as per the
|
||||
// instruction to make `start_watch_face` the main screen.
|
||||
|
||||
static void start_main_app_timer_cb(lv_timer_t *t) {
|
||||
start_main_app();
|
||||
lv_timer_del(t);
|
||||
}
|
||||
|
||||
static void splash_finished_cb(lv_anim_t *a) {
|
||||
lv_obj_t *logo = (lv_obj_t *)a->var;
|
||||
if (logo) {
|
||||
lv_obj_del(logo);
|
||||
}
|
||||
|
||||
/* Re-enable input devices after splash completes */
|
||||
lv_indev_t *indev = lv_indev_get_next(NULL);
|
||||
while (indev) {
|
||||
lv_indev_enable(indev, true);
|
||||
indev = lv_indev_get_next(indev);
|
||||
}
|
||||
|
||||
/* Defer main app start to avoid calling lv_scr_load from within an animation
|
||||
* callback, preventing the LoadProhibited crash. */
|
||||
lv_timer_t *start_timer = lv_timer_create(start_main_app_timer_cb, 10, NULL);
|
||||
lv_timer_set_repeat_count(start_timer, 1);
|
||||
}
|
||||
|
||||
static void start_fadeout_anim(lv_timer_t *t) {
|
||||
lv_obj_t *logo = (lv_obj_t *)t->user_data;
|
||||
lv_obj_t *scr = lv_scr_act();
|
||||
if (!logo)
|
||||
return;
|
||||
|
||||
/* 1. Logo Fade Out */
|
||||
lv_anim_t a_opa;
|
||||
lv_anim_init(&a_opa);
|
||||
lv_anim_set_var(&a_opa, logo);
|
||||
lv_anim_set_exec_cb(&a_opa, img_opa_anim_cb);
|
||||
lv_anim_set_values(&a_opa, 255, 0);
|
||||
lv_anim_set_time(&a_opa, 1200);
|
||||
lv_anim_set_path_cb(&a_opa, lv_anim_path_ease_in);
|
||||
lv_anim_set_ready_cb(&a_opa, splash_finished_cb);
|
||||
lv_anim_start(&a_opa);
|
||||
|
||||
/* 2. Background Fade to Black */
|
||||
lv_anim_t a_bg;
|
||||
lv_anim_init(&a_bg);
|
||||
lv_anim_set_var(&a_bg, scr);
|
||||
lv_anim_set_exec_cb(&a_bg, scr_bg_fade_out_cb);
|
||||
lv_anim_set_values(&a_bg, 0, 255);
|
||||
lv_anim_set_time(&a_bg, 1200);
|
||||
lv_anim_set_path_cb(&a_bg, lv_anim_path_ease_in);
|
||||
lv_anim_start(&a_bg);
|
||||
}
|
||||
|
||||
/* -------------------------------------------------------------------------
|
||||
* LVGL Callbacks & Core Logic
|
||||
* ------------------------------------------------------------------------- */
|
||||
|
||||
static bool notify_lvgl_flush_ready(esp_lcd_panel_io_handle_t panel_io,
|
||||
esp_lcd_panel_io_event_data_t *edata,
|
||||
void *user_ctx) {
|
||||
lv_disp_drv_t *disp_driver = (lv_disp_drv_t *)user_ctx;
|
||||
lv_disp_flush_ready(disp_driver);
|
||||
return false;
|
||||
}
|
||||
|
||||
static void lvgl_flush_cb(lv_disp_drv_t *drv, const lv_area_t *area, lv_color_t *color_map)
|
||||
{
|
||||
static void lvgl_flush_cb(lv_disp_drv_t *drv, const lv_area_t *area,
|
||||
lv_color_t *color_map) {
|
||||
esp_lcd_panel_handle_t panel_handle = (esp_lcd_panel_handle_t)drv->user_data;
|
||||
const int offsetx1 = area->x1;
|
||||
const int offsetx2 = area->x2;
|
||||
const int offsety1 = area->y1;
|
||||
const int offsety2 = area->y2;
|
||||
|
||||
#if LCD_BIT_PER_PIXEL == 24
|
||||
/* Convert LVGL color format to RGB888 for 24-bit mode */
|
||||
/* Convert LVGL 32-bit color format (ARGB8888) to RGB888 (24-bit) for SH8601
|
||||
*/
|
||||
uint8_t *to = (uint8_t *)color_map;
|
||||
uint8_t temp = 0;
|
||||
uint16_t pixel_num = (offsetx2 - offsetx1 + 1) * (offsety2 - offsety1 + 1);
|
||||
uint32_t pixel_num = (area->x2 - area->x1 + 1) * (area->y2 - area->y1 + 1);
|
||||
|
||||
temp = color_map[0].ch.blue;
|
||||
*to++ = color_map[0].ch.red;
|
||||
*to++ = color_map[0].ch.green;
|
||||
*to++ = temp;
|
||||
|
||||
for (int i = 1; i < pixel_num; i++) {
|
||||
*to++ = color_map[i].ch.red;
|
||||
*to++ = color_map[i].ch.green;
|
||||
*to++ = color_map[i].ch.blue;
|
||||
/* Pack pixels into 24-bit (3 bytes) buffer in-place */
|
||||
for (uint32_t i = 0; i < pixel_num; i++) {
|
||||
/* Use explicit extraction to avoid struct packing issues */
|
||||
uint32_t c = color_map[i].full;
|
||||
*to++ = (uint8_t)(c >> 16); /* R */
|
||||
*to++ = (uint8_t)(c >> 8); /* G */
|
||||
*to++ = (uint8_t)c; /* B */
|
||||
}
|
||||
#endif
|
||||
|
||||
esp_lcd_panel_draw_bitmap(panel_handle, offsetx1, offsety1, offsetx2 + 1, offsety2 + 1, color_map);
|
||||
esp_lcd_panel_draw_bitmap(panel_handle, area->x1, area->y1, area->x2 + 1,
|
||||
area->y2 + 1, color_map);
|
||||
}
|
||||
|
||||
static void lvgl_update_cb(lv_disp_drv_t *drv)
|
||||
{
|
||||
static void lvgl_update_cb(lv_disp_drv_t *drv) {
|
||||
esp_lcd_panel_handle_t panel_handle = (esp_lcd_panel_handle_t)drv->user_data;
|
||||
|
||||
switch (drv->rotated) {
|
||||
case LV_DISP_ROT_NONE:
|
||||
esp_lcd_panel_swap_xy(panel_handle, false);
|
||||
@@ -233,150 +352,131 @@ static void lvgl_update_cb(lv_disp_drv_t *drv)
|
||||
}
|
||||
}
|
||||
|
||||
void lvgl_rounder_cb(struct _lv_disp_drv_t *disp_drv, lv_area_t *area)
|
||||
{
|
||||
/* Round coordinates to even numbers (required by SH8601) */
|
||||
uint16_t x1 = area->x1;
|
||||
uint16_t x2 = area->x2;
|
||||
uint16_t y1 = area->y1;
|
||||
uint16_t y2 = area->y2;
|
||||
|
||||
area->x1 = (x1 >> 1) << 1;
|
||||
area->y1 = (y1 >> 1) << 1;
|
||||
area->x2 = ((x2 >> 1) << 1) + 1;
|
||||
area->y2 = ((y2 >> 1) << 1) + 1;
|
||||
void lvgl_rounder_cb(struct _lv_disp_drv_t *disp_drv, lv_area_t *area) {
|
||||
area->x1 = (area->x1 >> 1) << 1;
|
||||
area->y1 = (area->y1 >> 1) << 1;
|
||||
area->x2 = ((area->x2 >> 1) << 1) + 1;
|
||||
area->y2 = ((area->y2 >> 1) << 1) + 1;
|
||||
}
|
||||
|
||||
#if USE_TOUCH
|
||||
static void lvgl_touch_cb(lv_indev_drv_t *drv, lv_indev_data_t *data)
|
||||
{
|
||||
static void lvgl_touch_cb(lv_indev_drv_t *drv, lv_indev_data_t *data) {
|
||||
esp_lcd_touch_handle_t touch_handle = (esp_lcd_touch_handle_t)drv->user_data;
|
||||
assert(touch_handle);
|
||||
|
||||
uint16_t tp_x;
|
||||
uint16_t tp_y;
|
||||
uint16_t tp_x, tp_y;
|
||||
uint8_t tp_cnt = 0;
|
||||
esp_lcd_touch_read_data(touch_handle);
|
||||
bool tp_pressed = esp_lcd_touch_get_coordinates(touch_handle, &tp_x, &tp_y, NULL, &tp_cnt, 1);
|
||||
bool tp_pressed = esp_lcd_touch_get_coordinates(touch_handle, &tp_x, &tp_y,
|
||||
NULL, &tp_cnt, 1);
|
||||
if (tp_pressed && tp_cnt > 0) {
|
||||
data->point.x = tp_x;
|
||||
data->point.y = tp_y;
|
||||
data->state = LV_INDEV_STATE_PRESSED;
|
||||
ESP_LOGD(TAG, "Touch position: %d,%d", tp_x, tp_y);
|
||||
} else {
|
||||
data->state = LV_INDEV_STATE_RELEASED;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
static void increase_lvgl_tick(void *arg)
|
||||
{
|
||||
lv_tick_inc(LVGL_TICK_PERIOD_MS);
|
||||
}
|
||||
static void increase_lvgl_tick(void *arg) { lv_tick_inc(LVGL_TICK_PERIOD_MS); }
|
||||
|
||||
static bool lvgl_lock(int timeout_ms)
|
||||
{
|
||||
assert(lvgl_mux && "LVGL mutex not initialized");
|
||||
const TickType_t timeout_ticks = (timeout_ms == -1) ? portMAX_DELAY : pdMS_TO_TICKS(timeout_ms);
|
||||
return xSemaphoreTake(lvgl_mux, timeout_ticks) == pdTRUE;
|
||||
}
|
||||
|
||||
static void lvgl_unlock(void)
|
||||
{
|
||||
assert(lvgl_mux && "LVGL mutex not initialized");
|
||||
xSemaphoreGive(lvgl_mux);
|
||||
}
|
||||
|
||||
static void lvgl_port_task(void *arg)
|
||||
{
|
||||
ESP_LOGI(TAG, "Starting LVGL task");
|
||||
static void ui_task(void *arg) {
|
||||
uint32_t task_delay_ms = LVGL_TASK_MAX_DELAY_MS;
|
||||
uint32_t last_tick = 0;
|
||||
|
||||
while (1) {
|
||||
uint32_t now = xTaskGetTickCount() * portTICK_PERIOD_MS;
|
||||
|
||||
if (lvgl_lock(-1)) {
|
||||
task_delay_ms = lv_timer_handler();
|
||||
|
||||
/* 1Hz Refresh logic (every 1000ms) */
|
||||
if (now - last_tick >= 1000) {
|
||||
update_watch_face();
|
||||
last_tick = now;
|
||||
}
|
||||
|
||||
/* Process Event Queue */
|
||||
ui_event_t ev;
|
||||
if (xQueueReceive(g_event_queue, &ev, 0) == pdTRUE) {
|
||||
/* Handle UI events here */
|
||||
}
|
||||
|
||||
lvgl_unlock();
|
||||
}
|
||||
if (task_delay_ms > LVGL_TASK_MAX_DELAY_MS) {
|
||||
|
||||
if (task_delay_ms > LVGL_TASK_MAX_DELAY_MS)
|
||||
task_delay_ms = LVGL_TASK_MAX_DELAY_MS;
|
||||
} else if (task_delay_ms < LVGL_TASK_MIN_DELAY_MS) {
|
||||
else if (task_delay_ms < LVGL_TASK_MIN_DELAY_MS)
|
||||
task_delay_ms = LVGL_TASK_MIN_DELAY_MS;
|
||||
}
|
||||
vTaskDelay(pdMS_TO_TICKS(task_delay_ms));
|
||||
}
|
||||
}
|
||||
|
||||
void app_main(void)
|
||||
{
|
||||
ESP_LOGI(TAG, "Starting LVGL AMOLED application");
|
||||
/* -------------------------------------------------------------------------
|
||||
* App Main
|
||||
* ------------------------------------------------------------------------- */
|
||||
|
||||
/* Suppress some verbose logging */
|
||||
esp_log_level_set("lcd_panel.io.i2c", ESP_LOG_NONE);
|
||||
esp_log_level_set("FT5x06", ESP_LOG_NONE);
|
||||
void app_main(void) {
|
||||
esp_log_level_set("lcd_panel.io.i2c", ESP_LOG_INFO);
|
||||
esp_log_level_set("FT5x06", ESP_LOG_DEBUG);
|
||||
esp_log_level_set("esp_lcd_touch", ESP_LOG_DEBUG);
|
||||
|
||||
static lv_disp_draw_buf_t disp_buf;
|
||||
|
||||
/* Initialize I2C bus for touch and IO expander */
|
||||
ESP_LOGI(TAG, "Initialize I2C bus");
|
||||
/* I2C Setup */
|
||||
const i2c_config_t i2c_conf = {
|
||||
.mode = I2C_MODE_MASTER,
|
||||
.sda_io_num = PIN_NUM_TOUCH_SDA,
|
||||
.sda_pullup_en = GPIO_PULLUP_ENABLE,
|
||||
.scl_io_num = PIN_NUM_TOUCH_SCL,
|
||||
.scl_pullup_en = GPIO_PULLUP_ENABLE,
|
||||
.master.clk_speed = 200 * 1000,
|
||||
.master.clk_speed = 100 * 1000,
|
||||
};
|
||||
|
||||
ESP_ERROR_CHECK(i2c_param_config(TOUCH_HOST, &i2c_conf));
|
||||
ESP_ERROR_CHECK(i2c_driver_install(TOUCH_HOST, i2c_conf.mode, 0, 0, 0));
|
||||
|
||||
/* Initialize IO expander (TCA9554) for LCD/Touch reset and backlight */
|
||||
ESP_LOGI(TAG, "Initialize IO expander");
|
||||
/* IO Expander Setup */
|
||||
esp_io_expander_handle_t io_expander = NULL;
|
||||
ESP_ERROR_CHECK(esp_io_expander_new_i2c_tca9554(TOUCH_HOST, ESP_IO_EXPANDER_I2C_TCA9554_ADDRESS_000, &io_expander));
|
||||
ESP_ERROR_CHECK(esp_io_expander_new_i2c_tca9554(
|
||||
TOUCH_HOST, ESP_IO_EXPANDER_I2C_TCA9554_ADDRESS_000, &io_expander));
|
||||
esp_io_expander_set_dir(io_expander,
|
||||
IO_EXPANDER_PIN_NUM_0 | IO_EXPANDER_PIN_NUM_1 |
|
||||
IO_EXPANDER_PIN_NUM_2,
|
||||
IO_EXPANDER_OUTPUT);
|
||||
|
||||
/* Configure IO expander pins as outputs */
|
||||
esp_io_expander_set_dir(io_expander, IO_EXPANDER_PIN_NUM_0 | IO_EXPANDER_PIN_NUM_1 | IO_EXPANDER_PIN_NUM_2, IO_EXPANDER_OUTPUT);
|
||||
|
||||
/* Reset sequence: pull low then high */
|
||||
esp_io_expander_set_level(io_expander, IO_EXPANDER_PIN_NUM_0, 0);
|
||||
esp_io_expander_set_level(io_expander, IO_EXPANDER_PIN_NUM_1, 0);
|
||||
esp_io_expander_set_level(io_expander, IO_EXPANDER_PIN_NUM_2, 0);
|
||||
vTaskDelay(pdMS_TO_TICKS(200));
|
||||
esp_io_expander_set_level(io_expander, IO_EXPANDER_PIN_NUM_0, 1);
|
||||
esp_io_expander_set_level(io_expander, IO_EXPANDER_PIN_NUM_1, 1);
|
||||
esp_io_expander_set_level(io_expander, IO_EXPANDER_PIN_NUM_2, 1);
|
||||
|
||||
/* Initialize QSPI bus for LCD */
|
||||
ESP_LOGI(TAG, "Initialize QSPI bus");
|
||||
/* Hard Reset Touch via IO Expander */
|
||||
esp_io_expander_set_level(io_expander, IO_EXPANDER_PIN_NUM_2, 0);
|
||||
vTaskDelay(pdMS_TO_TICKS(20));
|
||||
esp_io_expander_set_level(io_expander, IO_EXPANDER_PIN_NUM_2, 1);
|
||||
vTaskDelay(pdMS_TO_TICKS(200));
|
||||
|
||||
/* LCD Setup */
|
||||
const spi_bus_config_t buscfg = SH8601_PANEL_BUS_QSPI_CONFIG(
|
||||
PIN_NUM_LCD_PCLK,
|
||||
PIN_NUM_LCD_DATA0,
|
||||
PIN_NUM_LCD_DATA1,
|
||||
PIN_NUM_LCD_DATA2,
|
||||
PIN_NUM_LCD_DATA3,
|
||||
LCD_H_RES * LCD_V_RES * LCD_BIT_PER_PIXEL / 8
|
||||
);
|
||||
PIN_NUM_LCD_PCLK, PIN_NUM_LCD_DATA0, PIN_NUM_LCD_DATA1, PIN_NUM_LCD_DATA2,
|
||||
PIN_NUM_LCD_DATA3, LCD_H_RES * LCD_V_RES * LCD_BIT_PER_PIXEL / 8);
|
||||
ESP_ERROR_CHECK(spi_bus_initialize(LCD_HOST, &buscfg, SPI_DMA_CH_AUTO));
|
||||
|
||||
/* Install panel IO */
|
||||
ESP_LOGI(TAG, "Install panel IO");
|
||||
const esp_lcd_panel_io_spi_config_t io_config = SH8601_PANEL_IO_QSPI_CONFIG(
|
||||
PIN_NUM_LCD_CS,
|
||||
notify_lvgl_flush_ready,
|
||||
&disp_drv
|
||||
);
|
||||
ESP_ERROR_CHECK(esp_lcd_new_panel_io_spi((esp_lcd_spi_bus_handle_t)LCD_HOST, &io_config, &lcd_io));
|
||||
esp_lcd_panel_io_spi_config_t io_config = SH8601_PANEL_IO_QSPI_CONFIG(
|
||||
PIN_NUM_LCD_CS, notify_lvgl_flush_ready, &disp_drv);
|
||||
io_config.pclk_hz = 80 * 1000 * 1000; /* Boost to 80MHz for 60FPS */
|
||||
|
||||
ESP_ERROR_CHECK(esp_lcd_new_panel_io_spi((esp_lcd_spi_bus_handle_t)LCD_HOST,
|
||||
&io_config, &lcd_io));
|
||||
|
||||
/* Configure vendor-specific settings */
|
||||
sh8601_vendor_config_t vendor_config = {
|
||||
.init_cmds = lcd_init_cmds,
|
||||
.init_cmds_size = sizeof(lcd_init_cmds) / sizeof(lcd_init_cmds[0]),
|
||||
.flags = {
|
||||
.use_qspi_interface = 1,
|
||||
},
|
||||
.flags = {.use_qspi_interface = 1},
|
||||
};
|
||||
|
||||
/* Install SH8601 panel driver */
|
||||
ESP_LOGI(TAG, "Install SH8601 panel driver");
|
||||
const esp_lcd_panel_dev_config_t panel_config = {
|
||||
.reset_gpio_num = PIN_NUM_LCD_RST,
|
||||
.rgb_ele_order = LCD_RGB_ELEMENT_ORDER_RGB,
|
||||
@@ -389,43 +489,31 @@ void app_main(void)
|
||||
ESP_ERROR_CHECK(esp_lcd_panel_disp_on_off(lcd_panel, true));
|
||||
|
||||
#if USE_TOUCH
|
||||
/* Initialize touch controller */
|
||||
ESP_LOGI(TAG, "Initialize touch controller");
|
||||
esp_lcd_panel_io_handle_t tp_io_handle = NULL;
|
||||
const esp_lcd_panel_io_i2c_config_t tp_io_config = ESP_LCD_TOUCH_IO_I2C_FT5x06_CONFIG();
|
||||
ESP_ERROR_CHECK(esp_lcd_new_panel_io_i2c((esp_lcd_i2c_bus_handle_t)TOUCH_HOST, &tp_io_config, &tp_io_handle));
|
||||
const esp_lcd_panel_io_i2c_config_t tp_io_config =
|
||||
ESP_LCD_TOUCH_IO_I2C_FT5x06_CONFIG();
|
||||
ESP_ERROR_CHECK(esp_lcd_new_panel_io_i2c((esp_lcd_i2c_bus_handle_t)TOUCH_HOST,
|
||||
&tp_io_config, &tp_io_handle));
|
||||
|
||||
const esp_lcd_touch_config_t tp_cfg = {
|
||||
.x_max = LCD_H_RES,
|
||||
.y_max = LCD_V_RES,
|
||||
.rst_gpio_num = PIN_NUM_TOUCH_RST,
|
||||
.int_gpio_num = PIN_NUM_TOUCH_INT,
|
||||
.levels = {
|
||||
.reset = 0,
|
||||
.interrupt = 0,
|
||||
},
|
||||
.flags = {
|
||||
.swap_xy = 0,
|
||||
.mirror_x = 0,
|
||||
.mirror_y = 0,
|
||||
},
|
||||
.levels = {.reset = 0, .interrupt = 0},
|
||||
.flags = {.swap_xy = 0, .mirror_x = 0, .mirror_y = 0},
|
||||
};
|
||||
ESP_ERROR_CHECK(esp_lcd_touch_new_i2c_ft5x06(tp_io_handle, &tp_cfg, &tp));
|
||||
#endif
|
||||
|
||||
/* Initialize LVGL */
|
||||
ESP_LOGI(TAG, "Initialize LVGL library");
|
||||
/* LVGL Init */
|
||||
lv_init();
|
||||
|
||||
/* Allocate draw buffers in DMA-capable memory */
|
||||
lv_color_t *buf1 = heap_caps_malloc(LCD_H_RES * LVGL_BUF_HEIGHT * sizeof(lv_color_t), MALLOC_CAP_DMA);
|
||||
assert(buf1);
|
||||
lv_color_t *buf2 = heap_caps_malloc(LCD_H_RES * LVGL_BUF_HEIGHT * sizeof(lv_color_t), MALLOC_CAP_DMA);
|
||||
assert(buf2);
|
||||
lv_color_t *buf1 = heap_caps_malloc(
|
||||
LCD_H_RES * LVGL_BUF_HEIGHT * sizeof(lv_color_t), MALLOC_CAP_DMA);
|
||||
lv_color_t *buf2 = heap_caps_malloc(
|
||||
LCD_H_RES * LVGL_BUF_HEIGHT * sizeof(lv_color_t), MALLOC_CAP_DMA);
|
||||
lv_disp_draw_buf_init(&disp_buf, buf1, buf2, LCD_H_RES * LVGL_BUF_HEIGHT);
|
||||
|
||||
/* Register display driver */
|
||||
ESP_LOGI(TAG, "Register display driver");
|
||||
lv_disp_drv_init(&disp_drv);
|
||||
disp_drv.hor_res = LCD_H_RES;
|
||||
disp_drv.ver_res = LCD_V_RES;
|
||||
@@ -436,19 +524,21 @@ void app_main(void)
|
||||
disp_drv.user_data = lcd_panel;
|
||||
lv_disp_t *disp = lv_disp_drv_register(&disp_drv);
|
||||
|
||||
/* Install LVGL tick timer */
|
||||
ESP_LOGI(TAG, "Install LVGL tick timer");
|
||||
/* Increase refresh frequency to 60fps (16ms) */
|
||||
lv_disp_set_bg_color(disp, lv_color_hex(0x000000));
|
||||
#if LVGL_VERSION_MAJOR >= 8
|
||||
/* For LVGL v8, we can set default refresh period if not set in sdkconfig */
|
||||
/* This is usually done via disp_drv, but it can be changed globally */
|
||||
#endif
|
||||
|
||||
const esp_timer_create_args_t lvgl_tick_timer_args = {
|
||||
.callback = &increase_lvgl_tick,
|
||||
.name = "lvgl_tick"
|
||||
};
|
||||
.callback = &increase_lvgl_tick, .name = "lvgl_tick"};
|
||||
esp_timer_handle_t lvgl_tick_timer = NULL;
|
||||
ESP_ERROR_CHECK(esp_timer_create(&lvgl_tick_timer_args, &lvgl_tick_timer));
|
||||
ESP_ERROR_CHECK(esp_timer_start_periodic(lvgl_tick_timer, LVGL_TICK_PERIOD_MS * 1000));
|
||||
ESP_ERROR_CHECK(
|
||||
esp_timer_start_periodic(lvgl_tick_timer, LVGL_TICK_PERIOD_MS * 1000));
|
||||
|
||||
#if USE_TOUCH
|
||||
/* Register touch input device */
|
||||
ESP_LOGI(TAG, "Register touch input device");
|
||||
static lv_indev_drv_t indev_drv;
|
||||
lv_indev_drv_init(&indev_drv);
|
||||
indev_drv.type = LV_INDEV_TYPE_POINTER;
|
||||
@@ -458,78 +548,72 @@ void app_main(void)
|
||||
lv_indev_drv_register(&indev_drv);
|
||||
#endif
|
||||
|
||||
/* Create LVGL mutex and task */
|
||||
lvgl_mux = xSemaphoreCreateMutex();
|
||||
assert(lvgl_mux);
|
||||
xTaskCreate(lvgl_port_task, "LVGL", LVGL_TASK_STACK_SIZE, NULL, LVGL_TASK_PRIORITY, NULL);
|
||||
lvgl_mux = xSemaphoreCreateRecursiveMutex();
|
||||
g_event_queue = xQueueCreate(10, sizeof(ui_event_t));
|
||||
|
||||
/* ui_task pinned to Core 0 for maximum responsiveness */
|
||||
xTaskCreatePinnedToCore(ui_task, "UI Task", LVGL_TASK_STACK_SIZE, NULL,
|
||||
LVGL_TASK_PRIORITY, NULL, 0);
|
||||
|
||||
|
||||
/* Create a splash screen: sample the image background color, fit image inside
|
||||
* the display (no cropping), disable interaction, and render pixel-perfect
|
||||
* by using LVGL's zoom. */
|
||||
/* --- Start Premium Splash Screen Sequence --- */
|
||||
if (lvgl_lock(-1)) {
|
||||
lv_obj_t *scr = lv_scr_act();
|
||||
|
||||
/* Sample first pixel from embedded RGB565 image to use as background.
|
||||
* Assume `logoIro_img.data` contains RGB565 (little-endian) bytes. */
|
||||
uint32_t bg_hex = 0x848a5d; /* fallback */
|
||||
if (logoIro_img.data && logoIro_img.data_size >= 2) {
|
||||
const uint8_t *d = (const uint8_t *)logoIro_img.data;
|
||||
uint16_t pix = (uint16_t)(d[0] | (d[1] << 8));
|
||||
uint8_t r5 = (pix >> 11) & 0x1F;
|
||||
uint8_t g6 = (pix >> 5) & 0x3F;
|
||||
uint8_t b5 = pix & 0x1F;
|
||||
uint8_t r8 = (r5 * 255) / 31;
|
||||
uint8_t g8 = (g6 * 255) / 63;
|
||||
uint8_t b8 = (b5 * 255) / 31;
|
||||
bg_hex = (r8 << 16) | (g8 << 8) | b8;
|
||||
/* New asset is ARGB8888 (4 bytes per pixel) */
|
||||
if (logoIro.data) {
|
||||
const uint8_t *d = (const uint8_t *)logoIro.data;
|
||||
/* ARGB: d[0]=B, d[1]=G, d[2]=R (Little Endian) */
|
||||
uint32_t bg_hex = (d[2] << 16) | (d[1] << 8) | d[0];
|
||||
g_splash_bg_color = lv_color_hex(bg_hex);
|
||||
} else {
|
||||
g_splash_bg_color = lv_color_hex(0x000000);
|
||||
}
|
||||
|
||||
lv_obj_set_style_bg_color(scr, lv_color_hex(bg_hex), LV_PART_MAIN);
|
||||
/* Set Background to Black Initially */
|
||||
lv_obj_set_style_bg_color(scr, lv_color_hex(0x000000), LV_PART_MAIN);
|
||||
lv_obj_set_style_bg_opa(scr, LV_OPA_COVER, LV_PART_MAIN);
|
||||
|
||||
/* Create and display the logo image (scaled to fit screen, centered) */
|
||||
/* Create Fullscreen Logo */
|
||||
lv_obj_t *logo_img = lv_img_create(scr);
|
||||
lv_img_set_src(logo_img, &logoIro_img);
|
||||
lv_img_set_src(logo_img, &logoIro);
|
||||
lv_obj_align(logo_img, LV_ALIGN_CENTER, 0, 0);
|
||||
lv_obj_set_style_img_opa(logo_img, 0, 0);
|
||||
|
||||
/* Fit the image inside the screen (no crop) using LVGL zoom (256 == 1.0×).
|
||||
* Temporarily disable input devices to prevent scrolling during the splash. */
|
||||
{
|
||||
const lv_img_dsc_t *dsc = &logoIro_img;
|
||||
int orig_w = dsc->header.w;
|
||||
int orig_h = dsc->header.h;
|
||||
int scr_w = lv_disp_get_hor_res(NULL);
|
||||
int scr_h = lv_disp_get_ver_res(NULL);
|
||||
|
||||
/* Compute separate scale factors for width and height (256 == 1.0×) */
|
||||
int scale_w = (scr_w * 256) / orig_w;
|
||||
int scale_h = (scr_h * 256) / orig_h;
|
||||
|
||||
/* Use the smaller scale so the image fits inside the screen (no crop) */
|
||||
uint16_t zoom = (uint16_t)((scale_w < scale_h) ? scale_w : scale_h);
|
||||
if (zoom == 0) zoom = 1;
|
||||
lv_img_set_zoom(logo_img, zoom);
|
||||
|
||||
/* Make the image and screen non-interactive / non-scrollable */
|
||||
/* Interaction lock */
|
||||
lv_obj_clear_flag(logo_img, LV_OBJ_FLAG_CLICKABLE | LV_OBJ_FLAG_SCROLLABLE);
|
||||
lv_obj_clear_flag(scr, LV_OBJ_FLAG_SCROLLABLE | LV_OBJ_FLAG_CLICKABLE);
|
||||
|
||||
/* Center the image */
|
||||
lv_obj_align(logo_img, LV_ALIGN_CENTER, 0, 0);
|
||||
|
||||
/* Disable all input devices temporarily to prevent user scroll/input */
|
||||
lv_indev_t *indev = lv_indev_get_next(NULL);
|
||||
while (indev) {
|
||||
lv_indev_enable(indev, false);
|
||||
indev = lv_indev_get_next(indev);
|
||||
}
|
||||
/* Re-enable inputs after 1500 ms */
|
||||
lv_timer_create(reenable_input_cb, 1500, NULL);
|
||||
}
|
||||
|
||||
/* 1. Coordinated Fade In (1.5s) */
|
||||
lv_anim_t a_logo_in;
|
||||
lv_anim_init(&a_logo_in);
|
||||
lv_anim_set_var(&a_logo_in, logo_img);
|
||||
lv_anim_set_exec_cb(&a_logo_in, img_opa_anim_cb);
|
||||
lv_anim_set_values(&a_logo_in, 0, 255);
|
||||
lv_anim_set_time(&a_logo_in, 1500);
|
||||
lv_anim_set_path_cb(&a_logo_in, lv_anim_path_ease_out);
|
||||
lv_anim_start(&a_logo_in);
|
||||
|
||||
lv_anim_t a_bg_in;
|
||||
lv_anim_init(&a_bg_in);
|
||||
lv_anim_set_var(&a_bg_in, scr);
|
||||
lv_anim_set_exec_cb(&a_bg_in, scr_bg_fade_in_cb);
|
||||
lv_anim_set_values(&a_bg_in, 0, 255);
|
||||
lv_anim_set_time(&a_bg_in, 1500);
|
||||
lv_anim_set_path_cb(&a_bg_in, lv_anim_path_ease_out);
|
||||
lv_anim_start(&a_bg_in);
|
||||
|
||||
/* 2. Hold and Fade Out after 3s (Must be one-shot) */
|
||||
lv_timer_t *hold_timer =
|
||||
lv_timer_create(start_fadeout_anim, 3000, logo_img);
|
||||
lv_timer_set_repeat_count(hold_timer, 1);
|
||||
|
||||
lvgl_unlock();
|
||||
}
|
||||
|
||||
ESP_LOGI(TAG, "LVGL AMOLED application running");
|
||||
ESP_LOGI(TAG, "Application Running");
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Name, Type, SubType, Offset, Size, Flags
|
||||
nvs, data, nvs, , 0x6000,
|
||||
phy_init, data, phy, , 0x1000,
|
||||
factory, app, factory, , 3M,
|
||||
factory, app, factory, , 8M,
|
||||
|
||||
|
38
sdkconfig
38
sdkconfig
@@ -560,13 +560,13 @@ CONFIG_ESPTOOLPY_FLASHFREQ_80M=y
|
||||
CONFIG_ESPTOOLPY_FLASHFREQ="80m"
|
||||
# CONFIG_ESPTOOLPY_FLASHSIZE_1MB is not set
|
||||
# CONFIG_ESPTOOLPY_FLASHSIZE_2MB is not set
|
||||
CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y
|
||||
# CONFIG_ESPTOOLPY_FLASHSIZE_4MB is not set
|
||||
# CONFIG_ESPTOOLPY_FLASHSIZE_8MB is not set
|
||||
# CONFIG_ESPTOOLPY_FLASHSIZE_16MB is not set
|
||||
CONFIG_ESPTOOLPY_FLASHSIZE_16MB=y
|
||||
# CONFIG_ESPTOOLPY_FLASHSIZE_32MB is not set
|
||||
# CONFIG_ESPTOOLPY_FLASHSIZE_64MB is not set
|
||||
# CONFIG_ESPTOOLPY_FLASHSIZE_128MB is not set
|
||||
CONFIG_ESPTOOLPY_FLASHSIZE="4MB"
|
||||
CONFIG_ESPTOOLPY_FLASHSIZE="16MB"
|
||||
# CONFIG_ESPTOOLPY_HEADER_FLASHSIZE_UPDATE is not set
|
||||
CONFIG_ESPTOOLPY_BEFORE_RESET=y
|
||||
# CONFIG_ESPTOOLPY_BEFORE_NORESET is not set
|
||||
@@ -828,7 +828,7 @@ CONFIG_I2C_MASTER_ISR_HANDLER_IN_IRAM=y
|
||||
#
|
||||
# ESP-Driver:LEDC Configurations
|
||||
#
|
||||
# CONFIG_LEDC_CTRL_FUNC_IN_IRAM is not set
|
||||
CONFIG_LEDC_CTRL_FUNC_IN_IRAM=y
|
||||
# end of ESP-Driver:LEDC Configurations
|
||||
|
||||
#
|
||||
@@ -2256,6 +2256,12 @@ CONFIG_WIFI_PROV_STA_ALL_CHANNEL_SCAN=y
|
||||
# CONFIG_WIFI_PROV_STA_FAST_SCAN is not set
|
||||
# end of Wi-Fi Provisioning Manager
|
||||
|
||||
#
|
||||
# ESP IO Expander
|
||||
#
|
||||
# CONFIG_IO_EXPANDER_ENABLE_GPIO_API_WRAPPER is not set
|
||||
# end of ESP IO Expander
|
||||
|
||||
#
|
||||
# ESP LCD TOUCH
|
||||
#
|
||||
@@ -2272,12 +2278,11 @@ CONFIG_LV_CONF_SKIP=y
|
||||
#
|
||||
# Color settings
|
||||
#
|
||||
# CONFIG_LV_COLOR_DEPTH_32 is not set
|
||||
CONFIG_LV_COLOR_DEPTH_16=y
|
||||
CONFIG_LV_COLOR_DEPTH_32=y
|
||||
# CONFIG_LV_COLOR_DEPTH_16 is not set
|
||||
# CONFIG_LV_COLOR_DEPTH_8 is not set
|
||||
# CONFIG_LV_COLOR_DEPTH_1 is not set
|
||||
CONFIG_LV_COLOR_DEPTH=16
|
||||
CONFIG_LV_COLOR_16_SWAP=y
|
||||
CONFIG_LV_COLOR_DEPTH=32
|
||||
CONFIG_LV_COLOR_SCREEN_TRANSP=y
|
||||
CONFIG_LV_COLOR_MIX_ROUND_OFS=128
|
||||
CONFIG_LV_COLOR_CHROMA_KEY_HEX=0x00FF00
|
||||
@@ -2295,8 +2300,8 @@ CONFIG_LV_MEMCPY_MEMSET_STD=y
|
||||
#
|
||||
# HAL Settings
|
||||
#
|
||||
CONFIG_LV_DISP_DEF_REFR_PERIOD=4
|
||||
CONFIG_LV_INDEV_DEF_READ_PERIOD=4
|
||||
CONFIG_LV_DISP_DEF_REFR_PERIOD=16
|
||||
CONFIG_LV_INDEV_DEF_READ_PERIOD=16
|
||||
# CONFIG_LV_TICK_CUSTOM is not set
|
||||
CONFIG_LV_DPI_DEF=130
|
||||
# end of HAL Settings
|
||||
@@ -2315,7 +2320,8 @@ CONFIG_LV_LAYER_SIMPLE_BUF_SIZE=24576
|
||||
CONFIG_LV_IMG_CACHE_DEF_SIZE=0
|
||||
CONFIG_LV_GRADIENT_MAX_STOPS=2
|
||||
CONFIG_LV_GRAD_CACHE_DEF_SIZE=0
|
||||
# CONFIG_LV_DITHER_GRADIENT is not set
|
||||
CONFIG_LV_DITHER_GRADIENT=y
|
||||
CONFIG_LV_DITHER_ERROR_DIFFUSION=y
|
||||
CONFIG_LV_DISP_ROT_MAX_BUF=10240
|
||||
# end of Drawing
|
||||
|
||||
@@ -2392,11 +2398,11 @@ CONFIG_LV_FONT_MONTSERRAT_16=y
|
||||
# CONFIG_LV_FONT_MONTSERRAT_34 is not set
|
||||
# CONFIG_LV_FONT_MONTSERRAT_36 is not set
|
||||
# CONFIG_LV_FONT_MONTSERRAT_38 is not set
|
||||
# CONFIG_LV_FONT_MONTSERRAT_40 is not set
|
||||
# CONFIG_LV_FONT_MONTSERRAT_42 is not set
|
||||
# CONFIG_LV_FONT_MONTSERRAT_44 is not set
|
||||
# CONFIG_LV_FONT_MONTSERRAT_46 is not set
|
||||
# CONFIG_LV_FONT_MONTSERRAT_48 is not set
|
||||
CONFIG_LV_FONT_MONTSERRAT_40=y
|
||||
CONFIG_LV_FONT_MONTSERRAT_42=y
|
||||
CONFIG_LV_FONT_MONTSERRAT_44=y
|
||||
CONFIG_LV_FONT_MONTSERRAT_46=y
|
||||
CONFIG_LV_FONT_MONTSERRAT_48=y
|
||||
# CONFIG_LV_FONT_MONTSERRAT_12_SUBPX is not set
|
||||
# CONFIG_LV_FONT_MONTSERRAT_28_COMPRESSED is not set
|
||||
# CONFIG_LV_FONT_DEJAVU_16_PERSIAN_HEBREW is not set
|
||||
|
||||
@@ -39,3 +39,6 @@ CONFIG_LV_FONT_MONTSERRAT_16=y
|
||||
CONFIG_LV_FONT_UNSCII_16=y
|
||||
CONFIG_LV_USE_GIF=y
|
||||
|
||||
CONFIG_FREERTOS_USE_TRACE_FACILITY=y
|
||||
CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS=y
|
||||
CONFIG_FREERTOS_VTASK_LIST_INCLUDE_COREID=y
|
||||
|
||||
215
sdkconfig.old
215
sdkconfig.old
@@ -2256,6 +2256,12 @@ CONFIG_WIFI_PROV_STA_ALL_CHANNEL_SCAN=y
|
||||
# CONFIG_WIFI_PROV_STA_FAST_SCAN is not set
|
||||
# end of Wi-Fi Provisioning Manager
|
||||
|
||||
#
|
||||
# ESP IO Expander
|
||||
#
|
||||
# CONFIG_IO_EXPANDER_ENABLE_GPIO_API_WRAPPER is not set
|
||||
# end of ESP IO Expander
|
||||
|
||||
#
|
||||
# ESP LCD TOUCH
|
||||
#
|
||||
@@ -2526,7 +2532,7 @@ CONFIG_LV_USE_GRID=y
|
||||
# CONFIG_LV_USE_FS_WIN32 is not set
|
||||
# CONFIG_LV_USE_FS_FATFS is not set
|
||||
# CONFIG_LV_USE_FS_LITTLEFS is not set
|
||||
CONFIG_LV_USE_PNG=y
|
||||
# CONFIG_LV_USE_PNG is not set
|
||||
# CONFIG_LV_USE_BMP is not set
|
||||
# CONFIG_LV_USE_SJPG is not set
|
||||
CONFIG_LV_USE_GIF=y
|
||||
@@ -2568,210 +2574,3 @@ CONFIG_LV_BUILD_EXAMPLES=y
|
||||
# end of Component config
|
||||
|
||||
# CONFIG_IDF_EXPERIMENTAL_FEATURES is not set
|
||||
|
||||
# Deprecated options for backward compatibility
|
||||
# CONFIG_APP_BUILD_TYPE_ELF_RAM is not set
|
||||
# CONFIG_NO_BLOBS is not set
|
||||
# CONFIG_APP_ROLLBACK_ENABLE is not set
|
||||
# CONFIG_LOG_BOOTLOADER_LEVEL_NONE is not set
|
||||
# CONFIG_LOG_BOOTLOADER_LEVEL_ERROR is not set
|
||||
# CONFIG_LOG_BOOTLOADER_LEVEL_WARN is not set
|
||||
CONFIG_LOG_BOOTLOADER_LEVEL_INFO=y
|
||||
# CONFIG_LOG_BOOTLOADER_LEVEL_DEBUG is not set
|
||||
# CONFIG_LOG_BOOTLOADER_LEVEL_VERBOSE is not set
|
||||
CONFIG_LOG_BOOTLOADER_LEVEL=3
|
||||
# CONFIG_FLASH_ENCRYPTION_ENABLED is not set
|
||||
CONFIG_FLASHMODE_QIO=y
|
||||
# CONFIG_FLASHMODE_QOUT is not set
|
||||
# CONFIG_FLASHMODE_DIO is not set
|
||||
# CONFIG_FLASHMODE_DOUT is not set
|
||||
CONFIG_MONITOR_BAUD=115200
|
||||
# CONFIG_OPTIMIZATION_LEVEL_DEBUG is not set
|
||||
# CONFIG_COMPILER_OPTIMIZATION_LEVEL_DEBUG is not set
|
||||
# CONFIG_COMPILER_OPTIMIZATION_DEFAULT is not set
|
||||
# CONFIG_OPTIMIZATION_LEVEL_RELEASE is not set
|
||||
# CONFIG_COMPILER_OPTIMIZATION_LEVEL_RELEASE is not set
|
||||
CONFIG_OPTIMIZATION_ASSERTIONS_ENABLED=y
|
||||
# CONFIG_OPTIMIZATION_ASSERTIONS_SILENT is not set
|
||||
# CONFIG_OPTIMIZATION_ASSERTIONS_DISABLED is not set
|
||||
CONFIG_OPTIMIZATION_ASSERTION_LEVEL=2
|
||||
# CONFIG_CXX_EXCEPTIONS is not set
|
||||
CONFIG_STACK_CHECK_NONE=y
|
||||
# CONFIG_STACK_CHECK_NORM is not set
|
||||
# CONFIG_STACK_CHECK_STRONG is not set
|
||||
# CONFIG_STACK_CHECK_ALL is not set
|
||||
# CONFIG_WARN_WRITE_STRINGS is not set
|
||||
# CONFIG_ESP32_APPTRACE_DEST_TRAX is not set
|
||||
CONFIG_ESP32_APPTRACE_DEST_NONE=y
|
||||
CONFIG_ESP32_APPTRACE_LOCK_ENABLE=y
|
||||
# CONFIG_EXTERNAL_COEX_ENABLE is not set
|
||||
# CONFIG_ESP_WIFI_EXTERNAL_COEXIST_ENABLE is not set
|
||||
# CONFIG_GPTIMER_ISR_IRAM_SAFE is not set
|
||||
# CONFIG_MCPWM_ISR_IRAM_SAFE is not set
|
||||
# CONFIG_EVENT_LOOP_PROFILING is not set
|
||||
CONFIG_POST_EVENTS_FROM_ISR=y
|
||||
CONFIG_POST_EVENTS_FROM_IRAM_ISR=y
|
||||
CONFIG_GDBSTUB_SUPPORT_TASKS=y
|
||||
CONFIG_GDBSTUB_MAX_TASKS=32
|
||||
# CONFIG_OTA_ALLOW_HTTP is not set
|
||||
CONFIG_ESP32S3_DEEP_SLEEP_WAKEUP_DELAY=2000
|
||||
CONFIG_ESP_SLEEP_DEEP_SLEEP_WAKEUP_DELAY=2000
|
||||
CONFIG_ESP32S3_RTC_CLK_SRC_INT_RC=y
|
||||
# CONFIG_ESP32S3_RTC_CLK_SRC_EXT_CRYS is not set
|
||||
# CONFIG_ESP32S3_RTC_CLK_SRC_EXT_OSC is not set
|
||||
# CONFIG_ESP32S3_RTC_CLK_SRC_INT_8MD256 is not set
|
||||
CONFIG_ESP32S3_RTC_CLK_CAL_CYCLES=1024
|
||||
CONFIG_PERIPH_CTRL_FUNC_IN_IRAM=y
|
||||
CONFIG_BROWNOUT_DET=y
|
||||
CONFIG_ESP32S3_BROWNOUT_DET=y
|
||||
CONFIG_BROWNOUT_DET_LVL_SEL_7=y
|
||||
CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_7=y
|
||||
# CONFIG_BROWNOUT_DET_LVL_SEL_6 is not set
|
||||
# CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_6 is not set
|
||||
# CONFIG_BROWNOUT_DET_LVL_SEL_5 is not set
|
||||
# CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_5 is not set
|
||||
# CONFIG_BROWNOUT_DET_LVL_SEL_4 is not set
|
||||
# CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_4 is not set
|
||||
# CONFIG_BROWNOUT_DET_LVL_SEL_3 is not set
|
||||
# CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_3 is not set
|
||||
# CONFIG_BROWNOUT_DET_LVL_SEL_2 is not set
|
||||
# CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_2 is not set
|
||||
# CONFIG_BROWNOUT_DET_LVL_SEL_1 is not set
|
||||
# CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_1 is not set
|
||||
CONFIG_BROWNOUT_DET_LVL=7
|
||||
CONFIG_ESP32S3_BROWNOUT_DET_LVL=7
|
||||
CONFIG_ESP_SYSTEM_BROWNOUT_INTR=y
|
||||
CONFIG_ESP32_PHY_CALIBRATION_AND_DATA_STORAGE=y
|
||||
# CONFIG_ESP32_PHY_INIT_DATA_IN_PARTITION is not set
|
||||
CONFIG_ESP32_PHY_MAX_WIFI_TX_POWER=20
|
||||
CONFIG_ESP32_PHY_MAX_TX_POWER=20
|
||||
# CONFIG_REDUCE_PHY_TX_POWER is not set
|
||||
# CONFIG_ESP32_REDUCE_PHY_TX_POWER is not set
|
||||
CONFIG_ESP_SYSTEM_PM_POWER_DOWN_CPU=y
|
||||
CONFIG_PM_POWER_DOWN_TAGMEM_IN_LIGHT_SLEEP=y
|
||||
CONFIG_ESP32S3_SPIRAM_SUPPORT=y
|
||||
CONFIG_DEFAULT_PSRAM_CLK_IO=30
|
||||
CONFIG_DEFAULT_PSRAM_CS_IO=26
|
||||
# CONFIG_ESP32S3_DEFAULT_CPU_FREQ_80 is not set
|
||||
# CONFIG_ESP32S3_DEFAULT_CPU_FREQ_160 is not set
|
||||
CONFIG_ESP32S3_DEFAULT_CPU_FREQ_240=y
|
||||
CONFIG_ESP32S3_DEFAULT_CPU_FREQ_MHZ=240
|
||||
CONFIG_SYSTEM_EVENT_QUEUE_SIZE=32
|
||||
CONFIG_SYSTEM_EVENT_TASK_STACK_SIZE=2304
|
||||
CONFIG_MAIN_TASK_STACK_SIZE=3584
|
||||
CONFIG_CONSOLE_UART_DEFAULT=y
|
||||
# CONFIG_CONSOLE_UART_CUSTOM is not set
|
||||
# CONFIG_CONSOLE_UART_NONE is not set
|
||||
# CONFIG_ESP_CONSOLE_UART_NONE is not set
|
||||
CONFIG_CONSOLE_UART=y
|
||||
CONFIG_CONSOLE_UART_NUM=0
|
||||
CONFIG_CONSOLE_UART_BAUDRATE=115200
|
||||
CONFIG_INT_WDT=y
|
||||
CONFIG_INT_WDT_TIMEOUT_MS=300
|
||||
CONFIG_INT_WDT_CHECK_CPU1=y
|
||||
CONFIG_TASK_WDT=y
|
||||
CONFIG_ESP_TASK_WDT=y
|
||||
# CONFIG_TASK_WDT_PANIC is not set
|
||||
CONFIG_TASK_WDT_TIMEOUT_S=5
|
||||
CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU0=y
|
||||
CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU1=y
|
||||
# CONFIG_ESP32_DEBUG_STUBS_ENABLE is not set
|
||||
CONFIG_ESP32S3_DEBUG_OCDAWARE=y
|
||||
CONFIG_IPC_TASK_STACK_SIZE=1280
|
||||
CONFIG_TIMER_TASK_STACK_SIZE=3584
|
||||
CONFIG_ESP32_WIFI_ENABLED=y
|
||||
CONFIG_ESP32_WIFI_STATIC_RX_BUFFER_NUM=10
|
||||
CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM=32
|
||||
# CONFIG_ESP32_WIFI_STATIC_TX_BUFFER is not set
|
||||
CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER=y
|
||||
CONFIG_ESP32_WIFI_TX_BUFFER_TYPE=1
|
||||
CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER_NUM=32
|
||||
# CONFIG_ESP32_WIFI_CSI_ENABLED is not set
|
||||
CONFIG_ESP32_WIFI_AMPDU_TX_ENABLED=y
|
||||
CONFIG_ESP32_WIFI_TX_BA_WIN=6
|
||||
CONFIG_ESP32_WIFI_AMPDU_RX_ENABLED=y
|
||||
CONFIG_ESP32_WIFI_RX_BA_WIN=6
|
||||
CONFIG_ESP32_WIFI_NVS_ENABLED=y
|
||||
CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_0=y
|
||||
# CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_1 is not set
|
||||
CONFIG_ESP32_WIFI_SOFTAP_BEACON_MAX_LEN=752
|
||||
CONFIG_ESP32_WIFI_MGMT_SBUF_NUM=32
|
||||
CONFIG_ESP32_WIFI_IRAM_OPT=y
|
||||
CONFIG_ESP32_WIFI_RX_IRAM_OPT=y
|
||||
CONFIG_ESP32_WIFI_ENABLE_WPA3_SAE=y
|
||||
CONFIG_ESP32_WIFI_ENABLE_WPA3_OWE_STA=y
|
||||
CONFIG_WPA_MBEDTLS_CRYPTO=y
|
||||
CONFIG_WPA_MBEDTLS_TLS_CLIENT=y
|
||||
# CONFIG_WPA_WAPI_PSK is not set
|
||||
# CONFIG_WPA_SUITE_B_192 is not set
|
||||
# CONFIG_WPA_11KV_SUPPORT is not set
|
||||
# CONFIG_WPA_MBO_SUPPORT is not set
|
||||
# CONFIG_WPA_DPP_SUPPORT is not set
|
||||
# CONFIG_WPA_11R_SUPPORT is not set
|
||||
# CONFIG_WPA_WPS_SOFTAP_REGISTRAR is not set
|
||||
# CONFIG_WPA_WPS_STRICT is not set
|
||||
# CONFIG_WPA_DEBUG_PRINT is not set
|
||||
# CONFIG_WPA_TESTING_OPTIONS is not set
|
||||
# CONFIG_ESP32_ENABLE_COREDUMP_TO_FLASH is not set
|
||||
# CONFIG_ESP32_ENABLE_COREDUMP_TO_UART is not set
|
||||
CONFIG_ESP32_ENABLE_COREDUMP_TO_NONE=y
|
||||
CONFIG_TIMER_TASK_PRIORITY=1
|
||||
CONFIG_TIMER_TASK_STACK_DEPTH=2048
|
||||
CONFIG_TIMER_QUEUE_LENGTH=10
|
||||
# CONFIG_ENABLE_STATIC_TASK_CLEAN_UP_HOOK is not set
|
||||
CONFIG_SPIRAM_ALLOW_STACK_EXTERNAL_MEMORY=y
|
||||
# CONFIG_HAL_ASSERTION_SILIENT is not set
|
||||
# CONFIG_L2_TO_L3_COPY is not set
|
||||
CONFIG_ESP_GRATUITOUS_ARP=y
|
||||
CONFIG_GARP_TMR_INTERVAL=60
|
||||
CONFIG_TCPIP_RECVMBOX_SIZE=32
|
||||
CONFIG_TCP_MAXRTX=12
|
||||
CONFIG_TCP_SYNMAXRTX=12
|
||||
CONFIG_TCP_MSS=1440
|
||||
CONFIG_TCP_MSL=60000
|
||||
CONFIG_TCP_SND_BUF_DEFAULT=5760
|
||||
CONFIG_TCP_WND_DEFAULT=5760
|
||||
CONFIG_TCP_RECVMBOX_SIZE=6
|
||||
CONFIG_TCP_QUEUE_OOSEQ=y
|
||||
CONFIG_TCP_OVERSIZE_MSS=y
|
||||
# CONFIG_TCP_OVERSIZE_QUARTER_MSS is not set
|
||||
# CONFIG_TCP_OVERSIZE_DISABLE is not set
|
||||
CONFIG_UDP_RECVMBOX_SIZE=6
|
||||
CONFIG_TCPIP_TASK_STACK_SIZE=3072
|
||||
CONFIG_TCPIP_TASK_AFFINITY_NO_AFFINITY=y
|
||||
# CONFIG_TCPIP_TASK_AFFINITY_CPU0 is not set
|
||||
# CONFIG_TCPIP_TASK_AFFINITY_CPU1 is not set
|
||||
CONFIG_TCPIP_TASK_AFFINITY=0x7FFFFFFF
|
||||
# CONFIG_PPP_SUPPORT is not set
|
||||
CONFIG_NEWLIB_STDOUT_LINE_ENDING_CRLF=y
|
||||
# CONFIG_NEWLIB_STDOUT_LINE_ENDING_LF is not set
|
||||
# CONFIG_NEWLIB_STDOUT_LINE_ENDING_CR is not set
|
||||
# CONFIG_NEWLIB_STDIN_LINE_ENDING_CRLF is not set
|
||||
# CONFIG_NEWLIB_STDIN_LINE_ENDING_LF is not set
|
||||
CONFIG_NEWLIB_STDIN_LINE_ENDING_CR=y
|
||||
# CONFIG_NEWLIB_NANO_FORMAT is not set
|
||||
CONFIG_NEWLIB_TIME_SYSCALL_USE_RTC_HRT=y
|
||||
CONFIG_ESP32S3_TIME_SYSCALL_USE_RTC_SYSTIMER=y
|
||||
CONFIG_ESP32S3_TIME_SYSCALL_USE_RTC_FRC1=y
|
||||
# CONFIG_NEWLIB_TIME_SYSCALL_USE_RTC is not set
|
||||
# CONFIG_ESP32S3_TIME_SYSCALL_USE_RTC is not set
|
||||
# CONFIG_NEWLIB_TIME_SYSCALL_USE_HRT is not set
|
||||
# CONFIG_ESP32S3_TIME_SYSCALL_USE_SYSTIMER is not set
|
||||
# CONFIG_ESP32S3_TIME_SYSCALL_USE_FRC1 is not set
|
||||
# CONFIG_NEWLIB_TIME_SYSCALL_USE_NONE is not set
|
||||
# CONFIG_ESP32S3_TIME_SYSCALL_USE_NONE is not set
|
||||
CONFIG_ESP32_PTHREAD_TASK_PRIO_DEFAULT=5
|
||||
CONFIG_ESP32_PTHREAD_TASK_STACK_SIZE_DEFAULT=3072
|
||||
CONFIG_ESP32_PTHREAD_STACK_MIN=768
|
||||
CONFIG_ESP32_DEFAULT_PTHREAD_CORE_NO_AFFINITY=y
|
||||
# CONFIG_ESP32_DEFAULT_PTHREAD_CORE_0 is not set
|
||||
# CONFIG_ESP32_DEFAULT_PTHREAD_CORE_1 is not set
|
||||
CONFIG_ESP32_PTHREAD_TASK_CORE_DEFAULT=-1
|
||||
CONFIG_ESP32_PTHREAD_TASK_NAME_DEFAULT="pthread"
|
||||
CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ABORTS=y
|
||||
# CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_FAILS is not set
|
||||
# CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ALLOWED is not set
|
||||
CONFIG_SUPPRESS_SELECT_DEBUG_OUTPUT=y
|
||||
CONFIG_SUPPORT_TERMIOS=y
|
||||
CONFIG_SEMIHOSTFS_MAX_MOUNT_POINTS=1
|
||||
# End of deprecated options
|
||||
|
||||
Reference in New Issue
Block a user