void user_uart1_callback (uart_callback_args_t * p_args)
{
if(p_args->event == UART_EVENT_TX_COMPLETE)
{
uart1_send_complete_flag = true;
}
if(p_args->event == UART_EVENT_RX_CHAR)
{
RxBuff[0] = p_args->data;
RxLine++; //每接收到一个数据,进入回调数据长度加1
DataBuff[RxLine-1]=RxBuff[0]; //把每次接收到的数据保存到缓存数组
Rx_flag=1;
Rx_len++;
if (Rx_len == 0x09) { //开始读取长度
Rx_clen = RxBuff[9] + 13;
}
if(Rx_len == Rx_clen)
{
Rx_flag_finish=1;
Rx_len--;
}
RxBuff[0]=0;
}
}
err = R_FLASH_LP_Erase(&g_flash0_ctrl, FLASH_DF_BLOCK_0, 1);
assert(FSP_SUCCESS == err);
printf("R_FLASH_LP_Erase
");
while (!interrupt_called)
{
;
}
assert(FLASH_EVENT_ERASE_COMPLETE == flash_event);
interrupt_called = false;
flash_status_t status;
err = R_FLASH_LP_Write(&g_flash0_ctrl, (uint32_t) cardId, FLASH_DF_BLOCK_0, cardId_length);
if (0 == memcmp(cardId, (uint8_t *) FLASH_DF_BLOCK_0, 4))
{
open_box();
}else
{
err_beep();
}
All reference designs on this site are sourced from major semiconductor manufacturers or collected online for learning and research. The copyright belongs to the semiconductor manufacturer or the original author. If you believe that the reference design of this site infringes upon your relevant rights and interests, please send us a rights notice. As a neutral platform service provider, we will take measures to delete the relevant content in accordance with relevant laws after receiving the relevant notice from the rights holder. Please send relevant notifications to email: bbs_service@eeworld.com.cn.
It is your responsibility to test the circuit yourself and determine its suitability for you. EEWorld will not be liable for direct, indirect, special, incidental, consequential or punitive damages arising from any cause or anything connected to any reference design used.
Supported by EEWorld Datasheet