新增 apptest 全字符显示自检 (0-9/A-F) (APP V1.00.39)
- display_set_raw(digits[5], type) + 裸码模式: 绕过温度解码直接渲染段位字符 - apptest: 循环 0-15, 四数字位同显一字符, DIG4 固定 C - 仅 APP 改动, Boot 不动 (仍 V1.00.07) - docs/开发日志.md: 新增 §67
This commit is contained in:
parent
dec34cfe0e
commit
ed2cf2a29d
15
docs/开发日志.md
15
docs/开发日志.md
@ -1624,3 +1624,18 @@ APP2 链接的镜像发向 APP1 区。设备端 END 校验(向量表 Reset PC
|
||||
- `app_display.h` 头部注释同步为 "DIG4 = unit letter (F/C)"。
|
||||
- 版本:APP `V1.00.37` → `V1.00.38`(`APP_FW_VERSION_NUM` 0x00010025 →
|
||||
0x00010026)。Boot 不动(仍 V1.00.07)。
|
||||
|
||||
## 67. 新增 `apptest`:全字符(0-9 / A-F)显示自检(2026-09-06,APP V1.00.39,仅 APP)
|
||||
|
||||
- 需求:`apptest` 把数码管所有可显示字符(0-9、A-F)都呈现一遍,肉眼核对
|
||||
每个段位字符。
|
||||
- 实现:
|
||||
- `app_display.c/h` 新增 `display_set_raw(digits[5], type)` + 裸码模式
|
||||
(`g_disp_raw`/`g_disp_raw_digits[]`):直接把 5 个段位字符码交给扫描,
|
||||
绕过温度解码;`display_set()` 会清掉裸码模式回到数值解码;`display_task`
|
||||
按 `g_disp_raw` 分流(裸码直接拷入 `digits[]`,`dp_flag` 恒 1);
|
||||
- `cli_core.c` 新增 `CmdAppTest`:循环 c=0..15,四个数字位(百/十/个/小数)
|
||||
全部显示同一字符(DIG4 固定写 `C`),0-9 打印数字、10-15 打印 A-F,每项
|
||||
500ms;结束后恢复 auto 状态并回 0.0;命令表注册 `apptest`。
|
||||
- 版本:APP `V1.00.38` → `V1.00.39`(`APP_FW_VERSION_NUM` 0x00010026 →
|
||||
0x00010027)。Boot 不动(仍 V1.00.07)。
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
@ -38,6 +38,15 @@ extern "C" {
|
||||
*/
|
||||
void display_set(float value, uint8_t type, uint8_t base);
|
||||
|
||||
/**
|
||||
* @brief Show raw digit codes directly (bypasses the temperature decode).
|
||||
* Used by the display self-test to render every segment character.
|
||||
* @param digits 5 codes: 0..9, 0xA..0xF (A..F), CHAR_BLANK(0xFF),
|
||||
* CHAR_MINUS(0x10); index 3 is the DIG4 unit letter
|
||||
* @param type DISP_TYPE_CELSIUS / DISP_TYPE_FAHRENHEIT (DIG6-A indicator)
|
||||
*/
|
||||
void display_set_raw(const uint8_t digits[5], uint8_t type);
|
||||
|
||||
/**
|
||||
* @brief Display driver FreeRTOS task: Charlieplexing scan loop, never returns.
|
||||
*/
|
||||
|
||||
@ -9,12 +9,12 @@
|
||||
#define __APP_VERSION_H__
|
||||
|
||||
#ifndef APP_FW_VERSION
|
||||
#define APP_FW_VERSION "V1.00.38"
|
||||
#define APP_FW_VERSION "V1.00.39"
|
||||
#endif
|
||||
|
||||
/* Numeric form used by the BLE info query / OTA records: 0x00MMmmpp */
|
||||
#ifndef APP_FW_VERSION_NUM
|
||||
#define APP_FW_VERSION_NUM 0x00010026u
|
||||
#define APP_FW_VERSION_NUM 0x00010027u
|
||||
#endif
|
||||
|
||||
#endif /* __APP_VERSION_H__ */
|
||||
|
||||
@ -108,6 +108,10 @@ static volatile uint8_t g_disp_type = DISP_TYPE_CELSIUS;
|
||||
static volatile uint8_t g_disp_base = DISP_BASE_DECIMAL;
|
||||
/** Automatic scan enable: 1 = auto scan, 0 = manual pin control. */
|
||||
static volatile uint8_t g_disp_auto = 1u;
|
||||
/** Raw-mode: 1 = show g_disp_raw_digits[] instead of decoding g_disp_value. */
|
||||
static volatile uint8_t g_disp_raw = 0u;
|
||||
/** Raw digit codes written by display_set_raw(). */
|
||||
static volatile uint8_t g_disp_raw_digits[DISP_DIGITS];
|
||||
|
||||
/* Private function prototypes -----------------------------------------------*/
|
||||
/* Private functions ----------------------------------------------------------*/
|
||||
@ -308,6 +312,22 @@ void display_set(float value, uint8_t type, uint8_t base)
|
||||
g_disp_value = value;
|
||||
g_disp_type = type;
|
||||
g_disp_base = base;
|
||||
g_disp_raw = 0u; /* back to decoded-value mode */
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Show raw digit codes directly (bypasses the temperature decode).
|
||||
*/
|
||||
void display_set_raw(const uint8_t digits[5], uint8_t type)
|
||||
{
|
||||
uint8_t i;
|
||||
|
||||
for (i = 0; i < DISP_DIGITS; i++)
|
||||
{
|
||||
g_disp_raw_digits[i] = digits[i];
|
||||
}
|
||||
g_disp_type = type;
|
||||
g_disp_raw = 1u;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -384,11 +404,24 @@ void display_task(void *pvParameters)
|
||||
}
|
||||
last_auto = 1u;
|
||||
|
||||
value = g_disp_value;
|
||||
type = g_disp_type;
|
||||
base = g_disp_base;
|
||||
type = g_disp_type;
|
||||
|
||||
display_decode(value, type, base, digits, &dp_flag);
|
||||
if (g_disp_raw)
|
||||
{
|
||||
/* raw mode: copy the digit codes straight through */
|
||||
uint8_t i;
|
||||
for (i = 0; i < DISP_DIGITS; i++)
|
||||
{
|
||||
digits[i] = g_disp_raw_digits[i];
|
||||
}
|
||||
dp_flag = 1u;
|
||||
}
|
||||
else
|
||||
{
|
||||
value = g_disp_value;
|
||||
base = g_disp_base;
|
||||
display_decode(value, type, base, digits, &dp_flag);
|
||||
}
|
||||
|
||||
/* DIG1..DIG5 */
|
||||
for (d = 1u; d <= DISP_DIGITS; d++)
|
||||
|
||||
@ -847,6 +847,49 @@ static void CmdDispTest(int argc, char* argv[])
|
||||
cli_write("display self-test done\r\n");
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief "apptest": render every displayable character (0-9, A-F) in all
|
||||
* four numeric positions so the full segment set can be verified
|
||||
* visually. DIG4 stays "C". Restores auto-scan + 0.0 when done.
|
||||
*/
|
||||
static void CmdAppTest(int argc, char* argv[])
|
||||
{
|
||||
uint8_t prev_auto = display_auto_get();
|
||||
uint8_t digits[5]; /* DIG1..DIG5 raw codes */
|
||||
uint8_t c;
|
||||
|
||||
(void)argc;
|
||||
(void)argv;
|
||||
|
||||
display_auto_set(1u);
|
||||
|
||||
cli_write("apptest: 0-9, A-F (each repeated in every numeric position)\r\n");
|
||||
|
||||
for (c = 0u; c < 16u; c++)
|
||||
{
|
||||
digits[0] = c; /* DIG1 = hundreds */
|
||||
digits[1] = c; /* DIG2 = tens */
|
||||
digits[2] = c; /* DIG3 = ones */
|
||||
digits[3] = 0x0Cu; /* DIG4 = "C" (unit letter, keep fixed) */
|
||||
digits[4] = c; /* DIG5 = tenths */
|
||||
display_set_raw(digits, DISP_TYPE_CELSIUS);
|
||||
|
||||
if (c < 10u)
|
||||
{
|
||||
cli_printf(" %u\r\n", (unsigned)c);
|
||||
}
|
||||
else
|
||||
{
|
||||
cli_printf(" %c\r\n", (char)('A' + (c - 10u)));
|
||||
}
|
||||
vTaskDelay(pdMS_TO_TICKS(500));
|
||||
}
|
||||
|
||||
display_set(0.0f, DISP_TYPE_CELSIUS, DISP_BASE_DECIMAL);
|
||||
display_auto_set(prev_auto);
|
||||
cli_write("apptest done\r\n");
|
||||
}
|
||||
|
||||
/* Command table; add new commands here */
|
||||
static const CliCmd_t s_cmds[] = {
|
||||
{"help", "help [cmd]: list commands / show one command's help", CmdHelp},
|
||||
@ -867,6 +910,7 @@ static const CliCmd_t s_cmds[] = {
|
||||
{"dispauto", "dispauto [on|off]: enable/disable auto display scan", CmdDispAuto},
|
||||
{"dispset", "dispset <pin1-7|all> [0|1|z]: drive display pin(s)", CmdDispSet},
|
||||
{"disptest", "disptest: run display self-test (digits/multi/max/degF)", CmdDispTest},
|
||||
{"apptest", "apptest: show every displayable char (0-9, A-F)", CmdAppTest},
|
||||
{"factory", "factory: restore params to defaults and reboot", CmdFactory},
|
||||
{"uartrst", "uartrst: re-init USART1 (460800 8N1), flush rx queue", CmdUartRst},
|
||||
{"uartinfo", "uartinfo: show USART1 pins/baud/format", CmdUartInfo},
|
||||
|
||||
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
@ -1,7 +1,7 @@
|
||||
{
|
||||
"file": "mothercup_ble_prod_ota.bin",
|
||||
"target_bank": 1,
|
||||
"size": 59676,
|
||||
"crc32": "0xFB89F8D4",
|
||||
"version": 65574
|
||||
"size": 60032,
|
||||
"crc32": "0x5393B90B",
|
||||
"version": 65575
|
||||
}
|
||||
Binary file not shown.
@ -1,7 +1,7 @@
|
||||
{
|
||||
"file": "mothercup_ble_prod_ota_app2.bin",
|
||||
"target_bank": 2,
|
||||
"size": 59976,
|
||||
"crc32": "0x5B5BD6F2",
|
||||
"version": 65574
|
||||
"size": 60332,
|
||||
"crc32": "0x4CDEA62B",
|
||||
"version": 65575
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user