初始提交卡包 USB 工程
纳入固件源码、屏幕组件、nand_xfer 工具和文档。忽略本机构建产物、sdkconfig,以及含本机路径的依赖锁。 Co-authored-by: Cursor <[email protected]>
This commit is contained in:
@@ -0,0 +1,85 @@
|
||||
/*
|
||||
* Copyright 2024 NXP
|
||||
* NXP Proprietary. This software is owned or controlled by NXP and may only be used strictly in
|
||||
* accordance with the applicable license terms. By expressly accepting such terms or by downloading, installing,
|
||||
* activating and/or otherwise using the software, you are agreeing that you have read, and that you agree to
|
||||
* comply with and are bound by, such license terms. If you do not agree to be bound by the applicable license
|
||||
* terms, then you may not retain, install, activate or otherwise use the software.
|
||||
*/
|
||||
|
||||
|
||||
/*********************
|
||||
* INCLUDES
|
||||
*********************/
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdbool.h>
|
||||
#include <time.h>
|
||||
#include "lvgl.h"
|
||||
#include "custom.h"
|
||||
#include "ui.h"
|
||||
#include "ui_nav.h"
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
*********************/
|
||||
|
||||
/**********************
|
||||
* TYPEDEFS
|
||||
**********************/
|
||||
|
||||
/**********************
|
||||
* STATIC PROTOTYPES
|
||||
**********************/
|
||||
|
||||
/**********************
|
||||
* STATIC VARIABLES
|
||||
**********************/
|
||||
|
||||
/**
|
||||
* Create a demo application
|
||||
*/
|
||||
|
||||
void custom_init(lv_ui *ui)
|
||||
{
|
||||
/* Add your codes here */
|
||||
}
|
||||
|
||||
static const char * const sortitions[] = {
|
||||
"桃花满屏", "脱单成功", "良缘天降", "喜结连理", "搭子速配", "知音相伴",
|
||||
"颜值开挂", "桃花爆仓", "真爱降临", "甜度超标", "脱单快进", "缘分拉满",
|
||||
"告白必成", "双向奔赴", "桃花朵朵", "缘分爆棚",
|
||||
"摆烂无罪", "快乐加倍", "烦恼清零", "快乐加载", "懒觉自由", "元气满满",
|
||||
"美食秒到", "干饭无忧", "脱发退散", "发量暴增", "失眠拜拜", "一夜好眠",
|
||||
"奶茶自由", "快乐拉满", "追剧无广", "爽感拉满",
|
||||
"锦鲤附体", "好运炸屏", "欧气护体", "万事开挂", "水逆退散", "好运加载",
|
||||
"幸运值满", "心想事成", "惊喜盲盒", "好运爆棚", "快乐续费", "好运无限",
|
||||
"好运拉满", "万事顺遂", "躺赢剧本", "万事开挂",
|
||||
};
|
||||
|
||||
#define SORTITION_COUNT (sizeof(sortitions) / sizeof(sortitions[0]))
|
||||
|
||||
void perform_draw(void)
|
||||
{
|
||||
static bool seeded = false;
|
||||
if (!seeded) {
|
||||
srand((unsigned int)time(NULL));
|
||||
seeded = true;
|
||||
}
|
||||
|
||||
const char *sortition1 = sortitions[rand() % SORTITION_COUNT];
|
||||
const char *sortition2 = sortitions[rand() % SORTITION_COUNT];
|
||||
|
||||
ui_nav_load_sortition_text_fade();
|
||||
|
||||
if (guider_ui.screen_sortition_text_label_sortition1 != NULL &&
|
||||
lv_obj_is_valid(guider_ui.screen_sortition_text_label_sortition1)) {
|
||||
lv_label_set_text(guider_ui.screen_sortition_text_label_sortition1, sortition1);
|
||||
}
|
||||
|
||||
if (guider_ui.screen_sortition_text_label_sortition2 != NULL &&
|
||||
lv_obj_is_valid(guider_ui.screen_sortition_text_label_sortition2)) {
|
||||
lv_label_set_text(guider_ui.screen_sortition_text_label_sortition2, sortition2);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user