Add task confirmation, numeric debug status and communication handoff

This commit is contained in:
2026-09-30 17:56:34 +08:00
parent 790eddd900
commit 2544a8f2b8
6 changed files with 250 additions and 1 deletions
+19
View File
@@ -0,0 +1,19 @@
#include <stdint.h>
#include <stddef.h>
#include <stdio.h>
extern void UART_SendBytes(const uint8_t *data, size_t len);
int ami_set_debug(unsigned id, unsigned state)
{
uint8_t buf[24];
if (id > 15 || state > 2) return -1;
int n = snprintf((char *)buf, sizeof buf,
"d%u=%u", id, state);
if (n < 0 || (size_t)n > sizeof buf - 4) return -1;
buf[n++] = 0xFF;
buf[n++] = 0xFF;
buf[n++] = 0xFF;
UART_SendBytes(buf, (size_t)n);
return 0;
}