Build epoch in info, flash-status command, cmake version embedding

This commit is contained in:
Ian Gulliver
2026-04-12 09:02:31 +09:00
parent 21c7900444
commit a41ee70a3c
9 changed files with 85 additions and 5 deletions

View File

@@ -45,6 +45,7 @@ std::optional<ResponseInfo> handle_info(const responder&, const RequestInfo&) {
resp.ip = ns.ip;
resp.firmware_name = firmware_name;
resp.boot = detected_boot_reason;
resp.build_epoch = BUILD_EPOCH;
return resp;
}
@@ -87,6 +88,19 @@ std::optional<ResponseFlashWrite> handle_flash_write(const responder&, const Req
return ResponseFlashWrite{};
}
std::optional<ResponseFlashStatus> handle_flash_status(const responder&, const RequestFlashStatus&) {
ResponseFlashStatus resp;
boot_info_t bi;
if (rom_get_boot_info(&bi)) {
resp.boot_partition = bi.partition;
resp.boot_type = bi.boot_type;
} else {
resp.boot_partition = -1;
resp.boot_type = 0;
}
return resp;
}
std::optional<ResponseReboot> handle_reboot(const responder&, const RequestReboot&) {
dispatch_schedule_ms(100, []{
watchdog_hw->scratch[0] = static_cast<uint32_t>(boot_reason::request_reboot);