web: show the chip temperature in the System page

The row sits between Hardware and Flash. The firmware sends the formatted string
rather than the raw register, since the System table prints its values as they
arrive.

Costs 186 bytes in BANK1.
This commit is contained in:
d00f committed 2026-09-18 18:28:13 +02:00
1 parent 48f28ae7ff
commit 52b1d1a4ea
2 files changed
+23 -4

No files matched your search

+19
View File
@@ -117,6 +117,23 @@ void string_to_html(__code char *s)
while (*s) char_to_html(*s++);
}
static void temp_to_html(void)
{
int16_t v;
reg_read(RTL837X_TM_RESULT);
v = SFR_DATA_U16;
if (v < 0) {
char_to_html('-');
v = -v;
}
itoa_html(v >> 7);
char_to_html('.');
itoa_html(((v & 0x7f) * 10) >> 7);
char_to_html(' ');
char_to_html('C');
}
uint16_t stat_content(void)
{
dbg_string("stat_content called\n");
@@ -262,6 +279,8 @@ void send_basic_info(void)
slen += strtox(outbuf + slen, BUILD_DATE);
slen += strtox(outbuf + slen, "\",\"hw_ver\":\"");
slen += strtox(outbuf + slen, machine.machine_name);
slen += strtox(outbuf + slen, "\",\"chip_temp\":\"");
temp_to_html();
slen += strtox(outbuf + slen, "\",\"flash_size\":\"");
string_to_html(get_flash_size_str());