DIG4 单位字母改 F/C (华氏F/摄氏C) (APP V1.00.38)

- display_decode 增加 type 入参, DIG4 按类型写 F(0x0F)/C(0x0C)
- 仅 APP 改动, Boot 不动 (仍 V1.00.07)
- docs/开发日志.md: 新增 §66
This commit is contained in:
evan.liu 2026-09-13 09:50:02 +08:00
parent 39e55e867d
commit dec34cfe0e
15 changed files with 3546 additions and 3532 deletions

View File

@ -1613,3 +1613,14 @@ APP2 链接的镜像发向 APP1 区。设备端 END 校验(向量表 Reset PC
- `app_display.h` 头部注释与 `display_set` 说明更新为温度位序。
- 版本:APP `V1.00.36` → `V1.00.37`(`APP_FW_VERSION_NUM` 0x00010024 →
0x00010025)。Boot 不动(仍 V1.00.07)。
## 66. DIG4 单位字母改 F/C(华氏 F、摄氏 C)(2026-09-06,APP V1.00.38,仅 APP)
- 用户确认:DIG4 不是固定 F,而是**华氏显示 F、摄氏显示 C**。
- 修改:
- `app_display.c` `display_decode()` 增加 `type` 入参,DIG4 按类型写
`0x0F`(F,FAHRENHEIT)或 `0x0C`(C,CELSIUS);`display_task` 调用处
传入 `type`;
- `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)。

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -3,8 +3,8 @@
* @brief YF30137 7-segment display driver.
*
* The YF30137 is a 7-pin Charlieplexed temperature display:
* - DIG1 = hundreds, DIG2 = tens, DIG3 = ones, DIG4 = fixed "F",
* DIG5 = tenths (one decimal place)
* - DIG1 = hundreds, DIG2 = tens, DIG3 = ones,
* DIG4 = unit letter ("F" Fahrenheit / "C" Celsius), DIG5 = tenths
* - DIG6 holds two single indicators: A6 = "deg F", B6 = decimal point
*
* A dedicated FreeRTOS task (display_task) scans the module continuously.

View File

@ -9,12 +9,12 @@
#define __APP_VERSION_H__
#ifndef APP_FW_VERSION
#define APP_FW_VERSION "V1.00.37"
#define APP_FW_VERSION "V1.00.38"
#endif
/* Numeric form used by the BLE info query / OTA records: 0x00MMmmpp */
#ifndef APP_FW_VERSION_NUM
#define APP_FW_VERSION_NUM 0x00010025u
#define APP_FW_VERSION_NUM 0x00010026u
#endif
#endif /* __APP_VERSION_H__ */

View File

@ -234,17 +234,19 @@ static uint8_t seg_of_char(uint8_t c)
* DIG1 = hundreds (百位)
* DIG2 = tens (十位)
* DIG3 = ones (个位)
* DIG4 = fixed "F" (华氏/摄氏度的固定标志)
* DIG4 = unit letter: "F" (Fahrenheit) / "C" (Celsius)
* DIG5 = tenths (小数位)
* DIG6-A (degF indicator) and DIG6-B (decimal point) are handled by
* the scan loop, not here.
*
* @param value temperature to display, clamped to 0.0..999.9
* @param type DISP_TYPE_CELSIUS / DISP_TYPE_FAHRENHEIT (DIG4 letter)
* @param base unused (kept for API compatibility)
* @param digits out: 5 codes (0..9, 0xF for the fixed "F", CHAR_BLANK)
* @param digits out: 5 codes (0..9, 0xF="F"/0xC="C", CHAR_BLANK)
* @param dp_flag out: 1 = light the DIG6 decimal point (always 1)
*/
static void display_decode(float value, uint8_t base, uint8_t *digits, uint8_t *dp_flag)
static void display_decode(float value, uint8_t type, uint8_t base,
uint8_t *digits, uint8_t *dp_flag)
{
int32_t scaled;
uint8_t i;
@ -287,8 +289,8 @@ static void display_decode(float value, uint8_t base, uint8_t *digits, uint8_t *
digits[1] = CHAR_BLANK;
}
/* DIG4 = fixed "F" */
digits[3] = 0x0Fu; /* seg_of_char(0xF) -> F */
/* DIG4 = unit letter: F for Fahrenheit, C for Celsius */
digits[3] = (type == DISP_TYPE_FAHRENHEIT) ? 0x0Fu : 0x0Cu;
}
/* Public functions -----------------------------------------------------------*/
@ -386,7 +388,7 @@ void display_task(void *pvParameters)
type = g_disp_type;
base = g_disp_base;
display_decode(value, base, digits, &dp_flag);
display_decode(value, type, base, digits, &dp_flag);
/* DIG1..DIG5 */
for (d = 1u; d <= DISP_DIGITS; d++)

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@ -1,7 +1,7 @@
{
"file": "mothercup_ble_prod_ota.bin",
"target_bank": 1,
"size": 59660,
"crc32": "0xF3E3A0A8",
"version": 65573
"size": 59676,
"crc32": "0xFB89F8D4",
"version": 65574
}

View File

@ -1,7 +1,7 @@
{
"file": "mothercup_ble_prod_ota_app2.bin",
"target_bank": 2,
"size": 59960,
"crc32": "0x14643A48",
"version": 65573
"size": 59976,
"crc32": "0x5B5BD6F2",
"version": 65574
}