mirror of
https://github.com/No-Chicken/Power-Pico.git
synced 2026-04-03 13:02:36 +08:00
39 lines
925 B
C
39 lines
925 B
C
/* Private includes -----------------------------------------------------------*/
|
|
//includes
|
|
#include "user_TasksInit.h"
|
|
#include "user_MessageTask.h"
|
|
#include "usbd_cdc_if.h"
|
|
#include "BL24C02.h"
|
|
|
|
/* Private typedef -----------------------------------------------------------*/
|
|
|
|
/* Private define ------------------------------------------------------------*/
|
|
|
|
/* Private variables ---------------------------------------------------------*/
|
|
|
|
/* Private function prototypes -----------------------------------------------*/
|
|
|
|
|
|
/**
|
|
* @brief task for check the usart message
|
|
* @param argument: Not used
|
|
* @retval None
|
|
*/
|
|
void MessageTask(void *argument)
|
|
{
|
|
while(1)
|
|
{
|
|
if(get_update_request()) {
|
|
|
|
// clear the flag
|
|
set_update_request(false);
|
|
// set the EEPROM flag
|
|
EEPROM_UpdateCommand_Write(true);
|
|
HAL_Delay(100);
|
|
// reset
|
|
NVIC_SystemReset();
|
|
}
|
|
osDelay(500);
|
|
}
|
|
}
|