增加了双击SW2显示五行

Flash资源已用完
This commit is contained in:
CSBOOK\44744
2026-06-28 18:32:50 +08:00
parent 984787d736
commit 104c3a10e0
9 changed files with 307 additions and 10 deletions
@@ -86,6 +86,21 @@ static const char *const s_chouqian_result_asset_dirs[] = {
"chouqian_zhongshang",
};
typedef struct {
const char *asset_dir;
uint16_t icon_id;
uint16_t icon_x;
uint16_t icon_y;
} domain_wuxing_result_t;
static const domain_wuxing_result_t s_wuxing_results[] = {
{.asset_dir = "shui", .icon_id = 0, .icon_x = 124, .icon_y = 8},
{.asset_dir = "mu", .icon_id = 1, .icon_x = 217, .icon_y = 92},
{.asset_dir = "huo", .icon_id = 2, .icon_x = 198, .icon_y = 171},
{.asset_dir = "tu", .icon_id = 3, .icon_x = 46, .icon_y = 178},
{.asset_dir = "jin", .icon_id = 4, .icon_x = 18, .icon_y = 102},
};
/*
* Wealth-direction reveal asset directories, indexed parallel to the direction
* catalog order in components/domain/src/direction/domain_direction_catalog.c
@@ -104,6 +119,9 @@ static const char *const s_wealth_direction_asset_dirs[] = {
#define DOMAIN_WEALTH_DIRECTION_FRAME_MS 100U
#define DOMAIN_CHOUQIAN_FRAME_MS 500U
#define DOMAIN_WUXING_QIANZHI_FRAME_MS 100U
#define DOMAIN_WUXING_REVEAL_FRAME_MS 100U
#define DOMAIN_WUXING_HOLD_FRAME_MS 500U
#define DOMAIN_AUTH_KEY_STORE_NAMESPACE "auth_key"
#define DOMAIN_AUTH_STATE_STORE_NAMESPACE "auth"
@@ -1262,31 +1280,37 @@ static esp_err_t domain_resolve_expression_platform_request(
s_chouqian_steps[0] = (platform_lcd_presentation_step_t) {
.asset_dir = "chouqian_qianzhi",
.frame_index = 0,
.icon_id = PLATFORM_LCD_PRESENTATION_NO_ICON,
.delay_ms = DOMAIN_CHOUQIAN_FRAME_MS,
};
s_chouqian_steps[1] = (platform_lcd_presentation_step_t) {
.asset_dir = "chouqian_qianzhi",
.frame_index = 1,
.icon_id = PLATFORM_LCD_PRESENTATION_NO_ICON,
.delay_ms = DOMAIN_CHOUQIAN_FRAME_MS,
};
s_chouqian_steps[2] = (platform_lcd_presentation_step_t) {
.asset_dir = "chouqian_qianzhi",
.frame_index = 2,
.icon_id = PLATFORM_LCD_PRESENTATION_NO_ICON,
.delay_ms = DOMAIN_CHOUQIAN_FRAME_MS,
};
s_chouqian_steps[3] = (platform_lcd_presentation_step_t) {
.asset_dir = result_asset,
.frame_index = 0,
.icon_id = PLATFORM_LCD_PRESENTATION_NO_ICON,
.delay_ms = DOMAIN_CHOUQIAN_FRAME_MS,
};
s_chouqian_steps[4] = (platform_lcd_presentation_step_t) {
.asset_dir = result_asset,
.frame_index = 1,
.icon_id = PLATFORM_LCD_PRESENTATION_NO_ICON,
.delay_ms = DOMAIN_CHOUQIAN_FRAME_MS,
};
s_chouqian_steps[5] = (platform_lcd_presentation_step_t) {
.asset_dir = result_asset,
.frame_index = 2,
.icon_id = PLATFORM_LCD_PRESENTATION_NO_ICON,
.delay_ms = DOMAIN_CHOUQIAN_FRAME_MS,
};
@@ -1302,6 +1326,44 @@ static esp_err_t domain_resolve_expression_platform_request(
return ESP_OK;
}
if (request->id == DOMAIN_EXPRESSION_WUXING) {
static platform_lcd_presentation_step_t s_wuxing_steps[3];
const size_t result_count = sizeof(s_wuxing_results) / sizeof(s_wuxing_results[0]);
const domain_wuxing_result_t *result = &s_wuxing_results[esp_random() % result_count];
s_wuxing_steps[0] = (platform_lcd_presentation_step_t) {
.asset_dir = "qianzhiwuxing",
.frame_index = 0,
.icon_id = result->icon_id,
.icon_x = result->icon_x,
.icon_y = result->icon_y,
.delay_ms = DOMAIN_WUXING_QIANZHI_FRAME_MS,
};
s_wuxing_steps[1] = (platform_lcd_presentation_step_t) {
.asset_dir = result->asset_dir,
.frame_index = 0,
.icon_id = PLATFORM_LCD_PRESENTATION_NO_ICON,
.delay_ms = DOMAIN_WUXING_REVEAL_FRAME_MS,
};
s_wuxing_steps[2] = (platform_lcd_presentation_step_t) {
.asset_dir = result->asset_dir,
.frame_index = 1,
.icon_id = PLATFORM_LCD_PRESENTATION_NO_ICON,
.delay_ms = DOMAIN_WUXING_HOLD_FRAME_MS,
};
*out_platform_request = (platform_lcd_presentation_request_t) {
.kind = PLATFORM_LCD_PRESENTATION_STEP_SEQUENCE,
.priority = 125,
.interrupt_current = true,
.return_to_idle = true,
.steps = s_wuxing_steps,
.step_count = sizeof(s_wuxing_steps) / sizeof(s_wuxing_steps[0]),
};
ESP_LOGI(TAG, "Wuxing result asset=%s", result->asset_dir);
return ESP_OK;
}
const domain_expression_catalog_entry_t *entry = domain_find_expression_entry(request->id);
if (entry == NULL) {
ESP_LOGW(TAG, "Unknown expression request id=%d trigger=%d",