mirror of
https://github.com/No-Chicken/Power-Pico.git
synced 2026-04-03 13:02:36 +08:00
加入更新操作
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
#include "user_TasksInit.h"
|
||||
#include "user_MessageTask.h"
|
||||
#include "usart.h"
|
||||
#include "BL24C02.h"
|
||||
|
||||
/* Private typedef -----------------------------------------------------------*/
|
||||
|
||||
@@ -30,11 +31,13 @@ void MessageTask(void *argument)
|
||||
if(strcmp((const char *)uart_receive_buf, "update\r\n") == 0) {
|
||||
// send response
|
||||
printf("start update\r\n");
|
||||
// jump to bootloader
|
||||
EEPROM_UpdateCommand_Write(true);
|
||||
HAL_Delay(100);
|
||||
// reset
|
||||
NVIC_SystemReset();
|
||||
} else {
|
||||
// do nothing
|
||||
}
|
||||
|
||||
}
|
||||
osDelay(500);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user