Multiboot: per-slot config profiles + restorable Main backup

This commit is contained in:
Armel FAUVEAU committed 2026-08-18 03:57:29 +02:00
1 parent 295d4a2c05
commit 78f5b76a71
8 files changed
+763 -26

No files matched your search

+23
View File
@@ -981,6 +981,29 @@ void UART_HandleCommand(uint32_t Port)
SendReply(Port, &Reply, sizeof(Reply));
break;
}
case 0x0728: // profile config reset: wipe the 64 KiB config bank of a slot
{
gSerialConfigCountDown_500ms = 12; // keep serial mode alive (6 s)
uint8_t slot = pUART_Command->Data[0];
uint32_t ts = (uint32_t)pUART_Command->Data[2]
| ((uint32_t)pUART_Command->Data[3] << 8)
| ((uint32_t)pUART_Command->Data[4] << 16)
| ((uint32_t)pUART_Command->Data[5] << 24);
uint8_t status = (ts != mb_port_timestamp(Port))
? MB_ERR_AUTH : MB_ProfileErase(slot);
struct __attribute__((packed)) {
Header_t Header;
uint8_t Slot;
uint8_t Status;
} Reply;
Reply.Header.ID = 0x0729;
Reply.Header.Size = 2;
Reply.Slot = slot;
Reply.Status = status;
SendReply(Port, &Reply, sizeof(Reply));
break;
}
#endif
#ifdef ENABLE_UART_RW_BK_REGS