新增 disptest 数码管自动化显示自检 (APP V1.00.36)
- disptest: 自动循环 0.0~9.0 -> 88888(全段) -> ABCDE(hex) -> 72.0F -> -123.4 - 测试期间强制开自动扫描, 结束恢复原 auto 状态并回 0.0 - 复核段位公式/管脚表/DIG6 指示段/解码逻辑, 无其它缺陷(除已修 GPIOA 时钟) - 仅 APP 改动, Boot 不动 (仍 V1.00.07) - docs/开发日志.md: 新增 §64
This commit is contained in:
parent
a4442c14a5
commit
d697885694
18
docs/开发日志.md
18
docs/开发日志.md
@ -1577,3 +1577,21 @@ APP2 链接的镜像发向 APP1 区。设备端 END 校验(向量表 Reset PC
|
||||
display_task 也能用)。
|
||||
- 版本:APP `V1.00.34` → `V1.00.35`(`APP_FW_VERSION_NUM` 0x00010022 →
|
||||
0x00010023)。Boot 不动(仍 V1.00.07)。
|
||||
|
||||
## 64. 数码管代码复核 + 新增 `disptest` 自动化显示自检(2026-09-06,APP V1.00.36,仅 APP)
|
||||
|
||||
- 代码复核(结合用户已确认的硬件/管脚对应):
|
||||
- 管脚表 `s_disp_pin[7]`(pin1=PB0 … pin7=PA6)与段位公式 `seg_on()` 的
|
||||
`h=(s+d)%7` / `l=(d-1)+(s+d)/7` 一致,且恒有 h≠l(无自配对),符合
|
||||
YF30137 Charlieplexing 映射;
|
||||
- DIG6 指示段 `degF(pin7高/pin6低)`、`dot(pin1高/pin7低)` 与表一致;
|
||||
- `display_decode` 十进制(×10 一位小数 + 前导零消隐 + 负号)与十六进制
|
||||
(5 位 hex + 前导零消隐)逻辑正确;小数点/°F 为 DIG6 单指示段(硬件
|
||||
特性,非逐位小数点);
|
||||
- 结论:除 §63 的 GPIOA 时钟外,无其它缺陷。
|
||||
- 新增 `disptest` 命令(`cli_core.c`):自动化显示自检,逐项显示
|
||||
`0.0~9.0` → `88888`(全段)→ `ABCDE`(hex)→ `72.0F`(°F 指示)→
|
||||
`-123.4`(负号),每项 0.5~1.2s;测试期间强制开自动扫描、结束后恢复
|
||||
原 auto 状态并回到 0.0。
|
||||
- 版本:APP `V1.00.35` → `V1.00.36`(`APP_FW_VERSION_NUM` 0x00010023 →
|
||||
0x00010024)。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.
@ -9,12 +9,12 @@
|
||||
#define __APP_VERSION_H__
|
||||
|
||||
#ifndef APP_FW_VERSION
|
||||
#define APP_FW_VERSION "V1.00.35"
|
||||
#define APP_FW_VERSION "V1.00.36"
|
||||
#endif
|
||||
|
||||
/* Numeric form used by the BLE info query / OTA records: 0x00MMmmpp */
|
||||
#ifndef APP_FW_VERSION_NUM
|
||||
#define APP_FW_VERSION_NUM 0x00010023u
|
||||
#define APP_FW_VERSION_NUM 0x00010024u
|
||||
#endif
|
||||
|
||||
#endif /* __APP_VERSION_H__ */
|
||||
|
||||
@ -838,6 +838,55 @@ static void CmdDispSet(int argc, char* argv[])
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief "disptest": automated display self-test. Cycles the display through
|
||||
* digits 0..9, "88888" (all segments), hex "ABCDE", a degF value and
|
||||
* "-123.4" so every digit/segment can be verified visually. Restores
|
||||
* the previous auto-scan state when finished.
|
||||
*/
|
||||
static void CmdDispTest(int argc, char* argv[])
|
||||
{
|
||||
static const float s_digits[10] = { 0.0f, 1.0f, 2.0f, 3.0f, 4.0f,
|
||||
5.0f, 6.0f, 7.0f, 8.0f, 9.0f };
|
||||
uint8_t prev_auto = display_auto_get();
|
||||
uint32_t i;
|
||||
|
||||
(void)argc;
|
||||
(void)argv;
|
||||
|
||||
/* the test drives values through display_set(), so auto must be on */
|
||||
display_auto_set(1u);
|
||||
|
||||
cli_write("display self-test: 0..9 -> 88888 -> ABCDE -> 72.0F -> -123.4\r\n");
|
||||
|
||||
for (i = 0; i < 10u; i++)
|
||||
{
|
||||
display_set(s_digits[i], DISP_TYPE_CELSIUS, DISP_BASE_DECIMAL);
|
||||
cli_printf(" %lu.0\r\n", (unsigned long)i);
|
||||
vTaskDelay(pdMS_TO_TICKS(500));
|
||||
}
|
||||
|
||||
display_set(8888.8f, DISP_TYPE_CELSIUS, DISP_BASE_DECIMAL);
|
||||
cli_write(" 88888 (all segments)\r\n");
|
||||
vTaskDelay(pdMS_TO_TICKS(1200));
|
||||
|
||||
display_set((float)0xABCDEu, DISP_TYPE_CELSIUS, DISP_BASE_HEX);
|
||||
cli_write(" ABCDE (hex)\r\n");
|
||||
vTaskDelay(pdMS_TO_TICKS(1200));
|
||||
|
||||
display_set(72.0f, DISP_TYPE_FAHRENHEIT, DISP_BASE_DECIMAL);
|
||||
cli_write(" 72.0 F (degF indicator on)\r\n");
|
||||
vTaskDelay(pdMS_TO_TICKS(1200));
|
||||
|
||||
display_set(-123.4f, DISP_TYPE_CELSIUS, DISP_BASE_DECIMAL);
|
||||
cli_write(" -123.4 (minus sign)\r\n");
|
||||
vTaskDelay(pdMS_TO_TICKS(1200));
|
||||
|
||||
display_set(0.0f, DISP_TYPE_CELSIUS, DISP_BASE_DECIMAL);
|
||||
display_auto_set(prev_auto);
|
||||
cli_write("display self-test 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},
|
||||
@ -857,6 +906,7 @@ static const CliCmd_t s_cmds[] = {
|
||||
{"disp", "disp <value> [f] [hex]: set 7-seg display value", CmdDisp},
|
||||
{"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 (0-9/all-seg/hex/degF/minus)", CmdDispTest},
|
||||
{"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": 59452,
|
||||
"crc32": "0xA1AA2FDD",
|
||||
"version": 65571
|
||||
"size": 59988,
|
||||
"crc32": "0x856F26BD",
|
||||
"version": 65572
|
||||
}
|
||||
Binary file not shown.
@ -1,7 +1,7 @@
|
||||
{
|
||||
"file": "mothercup_ble_prod_ota_app2.bin",
|
||||
"target_bank": 2,
|
||||
"size": 59756,
|
||||
"crc32": "0xB12312FE",
|
||||
"version": 65571
|
||||
"size": 60288,
|
||||
"crc32": "0x5500BC3A",
|
||||
"version": 65572
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user