This commit is contained in:
yelvlab 2024-12-28 16:29:45 +08:00
parent 4d98e4dc30
commit 67ea11a45e
2 changed files with 2 additions and 2 deletions

View File

@ -35,7 +35,7 @@ void reset_mcu(void) {
FWDGT_CTL = FWDGT_WRITEACCESS_ENABLE;
/* Configure FWDGT to trigger a system reset */
fwdgt_config(5, FWDGT_PSC_DIV4);
fwdgt_config(50, FWDGT_PSC_DIV4);
/* Reload the counter to trigger the reset */
fwdgt_counter_reload();
@ -65,7 +65,6 @@ int main(void) {
/* Initialize watchdog */
watchdog_init();
printf("Hello, world!\n");
while (1) {
delay_ms(99);

View File

@ -58,6 +58,7 @@ void process_command(uint8_t *cmd, size_t length) {
tempture_value_report();
} else if (strcmp(combined_str, "M3") == 0)
{
printf("%c%c%c%c%c%c", 0xB5, 0xF1, 0x02, 0x6F, 0x6B, 0xCC);
reset_mcu();
} else {
printf("%c%c%c%c%c%c%c", 0xB5, 0xF0, 0x03, 0x65, 0x72, 0x72, 0x3C);