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