Files
Power-Pico/Power_Pico/User/Tasks/Src/user_MessageTask.c

39 lines
925 B
C
Raw Normal View History

2025-10-19 11:59:32 +08:00
/* Private includes -----------------------------------------------------------*/
//includes
#include "user_TasksInit.h"
#include "user_MessageTask.h"
2026-02-07 13:29:07 +08:00
#include "usbd_cdc_if.h"
2025-10-20 20:17:00 +08:00
#include "BL24C02.h"
2025-10-19 11:59:32 +08:00
/* Private typedef -----------------------------------------------------------*/
/* Private define ------------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/
2025-10-19 12:13:49 +08:00
2025-10-19 11:59:32 +08:00
/* Private function prototypes -----------------------------------------------*/
/**
* @brief task for check the usart message
* @param argument: Not used
* @retval None
*/
void MessageTask(void *argument)
{
while(1)
{
2026-02-07 13:29:07 +08:00
if(get_update_request()) {
2025-10-19 11:59:32 +08:00
// clear the flag
2026-02-07 13:29:07 +08:00
set_update_request(false);
// set the EEPROM flag
EEPROM_UpdateCommand_Write(true);
HAL_Delay(100);
// reset
NVIC_SystemReset();
2025-10-19 11:59:32 +08:00
}
osDelay(500);
}
}