Build epoch in info, flash-status command, cmake version embedding
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user