60 lines
1.5 KiB
C
60 lines
1.5 KiB
C
/*******************************************************************************
|
|
* the includes
|
|
******************************************************************************/
|
|
#include "ud_10.h"
|
|
#include "projcfg.h"
|
|
#include "stm32l4xx_hal_cortex.h"
|
|
|
|
/*******************************************************************************
|
|
* the defines
|
|
******************************************************************************/
|
|
|
|
|
|
|
|
/*******************************************************************************
|
|
* the typedefs
|
|
******************************************************************************/
|
|
typedef enum
|
|
{
|
|
CMD10_NONE = 0,
|
|
CMD10_Default,
|
|
CMD10_BootReq,
|
|
CMD10_Expand,
|
|
|
|
CMD10_NUM,
|
|
} CMD10_type;
|
|
|
|
/*******************************************************************************
|
|
* the globals
|
|
******************************************************************************/
|
|
|
|
|
|
|
|
/*******************************************************************************
|
|
* the const
|
|
******************************************************************************/
|
|
|
|
|
|
|
|
/*******************************************************************************
|
|
* the functions
|
|
******************************************************************************/
|
|
void uartapp_cmd10(uint8_t* data, uint16_t len)
|
|
{
|
|
if (len < 1)
|
|
{
|
|
return;
|
|
}
|
|
CMD10_type subid = data[0];
|
|
switch (subid)
|
|
{
|
|
case CMD10_BootReq:
|
|
setBootFlag();
|
|
HAL_NVIC_SystemReset();
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
}
|
|
|