-
智能门锁读写过程失效 sos
[font=宋体][font=宋体][size=10.5pt]物料[/size][/font][/font][font=Calibri][size=10.5pt]CAT24C64WI[/size][/font][font=宋体][font=宋体][size=10.5pt]用于智能门锁产品,使用中发现不良,产品工作电源[/size][/font][/font][font=Calibri][size=10.5pt]4.5~6V [/size][/font][font=宋体][font=宋体][size=10.5pt]电流[/size][/font][/font][font=Calibri][size=10.5pt]50~70mA [/size][/font][font=宋体][font=宋体][size=10.5pt]。[/size][/font][/font][align=left] [font=宋体]上机后的测试情况:[/font][font=Calibri]24C64[/font][font=宋体]在[/font][font=Calibri]PCB[/font][font=宋体]板上作为临时存储资料,在产品正常的运作下是需要以下步骤:[/font][font=Calibri]1[/font][font=宋体]刷授权卡,[/font][font=Calibri]2[/font][font=宋体]时间卡,[/font][font=Calibri]3[/font][font=宋体]设置卡,[/font][font=Calibri]4[/font][font=宋体]开门卡。目前情况是前面两个步骤正常操作,到了第三个步骤设置卡一使用就被清空没有资料 导致无法开门。(第三步设置卡既是作为房号储存)但操作时没有任何信息储存被自动清空[/font][/align][align=left][font=宋体] 有没有大神可以帮帮忙 看看是什么原因呀 ON品牌的原装物料[/font][/align]
1011浏览量 0回复量 关注量 -
AC78406 多个串口中断失效 sos
各位前辈好。第一次用AC78406芯片。使用uart0 uart1中断接受不定长数据。单个串口可以接收了。两个串口同时使用只有先初始化的那个串口可以进入中断。请问哪里配置有问题吗?代码是用AutoGen Studio生成的。[color=#dadada][backcolor=rgb(30, 30, 30)][font=Consolas, "][color=#b4b4b4]#[/color][color=#9a9a9a]include[/color][color=#c8c8c8] [/color][color=#e8c9bb]"[/color][color=#ce9178]string.h[/color][color=#e8c9bb]"[/color] [color=#b4b4b4]#[/color][color=#9a9a9a]include[/color][color=#c8c8c8] [/color][color=#e8c9bb]"[/color][color=#ce9178]ckgen_drv.h[/color][color=#e8c9bb]"[/color] [color=#b4b4b4]#[/color][color=#9a9a9a]include[/color][color=#c8c8c8] [/color][color=#e8c9bb]"[/color][color=#ce9178]gpio_drv.h[/color][color=#e8c9bb]"[/color] [color=#b4b4b4]#[/color][color=#9a9a9a]include[/color][color=#c8c8c8] [/color][color=#e8c9bb]"[/color][color=#ce9178]gpio_hw.h[/color][color=#e8c9bb]"[/color] [color=#b4b4b4]#[/color][color=#9a9a9a]include[/color][color=#c8c8c8] [/color][color=#e8c9bb]"[/color][color=#ce9178]uart_drv.h[/color][color=#e8c9bb]"[/color] [color=#b4b4b4]#[/color][color=#9a9a9a]include[/color][color=#c8c8c8] [/color][color=#e8c9bb]"[/color][color=#ce9178]uart_hw.h[/color][color=#e8c9bb]"[/color] [color=#b4b4b4]#[/color][color=#9a9a9a]include[/color][color=#c8c8c8] [/color][color=#e8c9bb]"[/color][color=#ce9178]uart_irq.h[/color][color=#e8c9bb]"[/color] [color=#b4b4b4]#[/color][color=#9a9a9a]include[/color][color=#c8c8c8] [/color][color=#e8c9bb]"[/color][color=#ce9178]dma_drv.h[/color][color=#e8c9bb]"[/color] [color=#b4b4b4]#[/color][color=#9a9a9a]include[/color][color=#c8c8c8] [/color][color=#e8c9bb]"[/color][color=#ce9178]gpio.h[/color][color=#e8c9bb]"[/color] [color=#b4b4b4]#[/color][color=#9a9a9a]include[/color][color=#c8c8c8] [/color][color=#e8c9bb]"[/color][color=#ce9178]drv_comm.h[/color][color=#e8c9bb]"[/color] [color=#b4b4b4]#[/color][color=#9a9a9a]include[/color][color=#c8c8c8] [/color][color=#e8c9bb]"[/color][color=#ce9178]FreeRTOS.h[/color][color=#e8c9bb]"[/color] [color=#b4b4b4]#[/color][color=#9a9a9a]include[/color][color=#c8c8c8] [/color][color=#e8c9bb]"[/color][color=#ce9178]event_groups.h[/color][color=#e8c9bb]"[/color] [color=#b4b4b4]#[/color][color=#9a9a9a]include[/color][color=#c8c8c8] [/color][color=#e8c9bb]"[/color][color=#ce9178]ac7840x_irq_cb.h[/color][color=#e8c9bb]"[/color] [color=#b4b4b4]#[/color][color=#9a9a9a]define[/color][color=#c8c8c8] [/color][color=#beb7ff]RECELENGTHMAX[/color][color=#c8c8c8] [/color][color=#b5cea8]1024[/color] [color=#569cd6]static[/color] [color=#4ec9b0]uart_state_t[/color] [color=#c8c8c8]s_uart0State[/color] [color=#b4b4b4]=[/color] [color=#b4b4b4]{[/color][color=#569cd6]NULL[/color][color=#b4b4b4]};[/color][color=#57a64a] /*UART运行变量状态*/[/color] [color=#569cd6]static[/color] [color=#4ec9b0]uart_state_t[/color] [color=#c8c8c8]s_uart1State[/color] [color=#b4b4b4]=[/color] [color=#b4b4b4]{[/color][color=#569cd6]NULL[/color][color=#b4b4b4]};[/color][color=#57a64a] /*UART运行变量状态*/[/color] [color=#569cd6]static[/color] [color=#4ec9b0]uart_user_config_t[/color] [color=#c8c8c8]uart0Config[/color][color=#b4b4b4];[/color] [color=#569cd6]static[/color] [color=#4ec9b0]uart_user_config_t[/color] [color=#c8c8c8]uart1Config[/color][color=#b4b4b4];[/color] [color=#569cd6]static[/color] [color=#569cd6]unsigned[/color] [color=#569cd6]char[/color] [color=#c8c8c8]g_receive0Data[/color] [color=#b4b4b4]=[/color] [color=#b5cea8]0[/color][color=#b4b4b4];[/color] [color=#569cd6]static[/color] [color=#569cd6]unsigned[/color] [color=#569cd6]short[/color] [color=#569cd6]int[/color] [color=#c8c8c8]g_receive0Data_count[/color] [color=#b4b4b4]=[/color] [color=#b5cea8]0[/color][color=#b4b4b4];[/color] [color=#569cd6]static[/color] [color=#569cd6]unsigned[/color] [color=#569cd6]char[/color] [color=#c8c8c8]receive0Data_group[/color][color=#b4b4b4][[/color][color=#beb7ff]RECELENGTHMAX[/color] [color=#b4b4b4]=[/color] [color=#b4b4b4]{[/color][color=#b5cea8]0[/color][color=#b4b4b4]};[/color] [color=#569cd6]static[/color] [color=#569cd6]unsigned[/color] [color=#569cd6]char[/color] [color=#c8c8c8]g_receive1Data[/color] [color=#b4b4b4]=[/color] [color=#b5cea8]0[/color][color=#b4b4b4];[/color] [color=#569cd6]static[/color] [color=#569cd6]unsigned[/color] [color=#569cd6]short[/color] [color=#569cd6]int[/color] [color=#c8c8c8]g_receive1Data_count[/color] [color=#b4b4b4]=[/color] [color=#b5cea8]0[/color][color=#b4b4b4];[/color] [color=#569cd6]static[/color] [color=#569cd6]unsigned[/color] [color=#569cd6]char[/color] [color=#c8c8c8]receive1Data_group[/color][color=#b4b4b4][[/color][color=#beb7ff]RECELENGTHMAX[/color] [color=#b4b4b4]=[/color] [color=#b4b4b4]{[/color][color=#b5cea8]0[/color][color=#b4b4b4]};[/color] [color=#4ec9b0]EventGroupHandle_t[/color] [color=#c8c8c8]EventGroupHandle_uart[/color] [color=#b4b4b4]=[/color] [color=#569cd6]NULL[/color][color=#b4b4b4];[/color] [color=#57a64a]/**[/color] [color=#57a64a] * [/color][color=#569cd6]@brief[/color][color=#57a64a] This function handle UART0 rx interrupt.[/color] [color=#57a64a] * [/color][color=#569cd6]@param[/color][color=#57a64a][[/color][color=#569cd6]in[/color][color=#57a64a]] [/color][color=#9a9a9a]driverState[/color][color=#57a64a]: callback parameter[/color] [color=#57a64a] * [/color][color=#569cd6]@param[/color][color=#57a64a][[/color][color=#569cd6]in[/color][color=#57a64a]] [/color][color=#9a9a9a]event[/color][color=#57a64a]: callback parameter[/color] [color=#57a64a] * [/color][color=#569cd6]@param[/color][color=#57a64a][[/color][color=#569cd6]in[/color][color=#57a64a]] [/color][color=#9a9a9a]userData[/color][color=#57a64a]: callback parameter[/color] [color=#57a64a] * [/color][color=#569cd6]@return[/color][color=#57a64a] none[/color] [color=#57a64a] */[/color] [color=#569cd6]void[/color] [color=#dcdcaa]UART0_RX_IRQHandler_Callback[/color][color=#b4b4b4]([/color][color=#569cd6]void[/color] [color=#b4b4b4]*[/color][color=#9a9a9a]driverState[/color][color=#b4b4b4],[/color] [color=#4ec9b0]uint32_t[/color] [color=#9a9a9a]event[/color][color=#b4b4b4],[/color] [color=#569cd6]void[/color] [color=#b4b4b4]*[/color][color=#9a9a9a]userData[/color][color=#b4b4b4])[/color] [color=#b4b4b4]{[/color] [color=#57a64a] /* USER CODE BEGIN UART0_RX_IRQHandler_Callback */[/color] [color=#d8a0df]if[/color] [color=#b4b4b4]([/color][color=#9a9a9a]event[/color] [color=#b4b4b4]==[/color] [color=#b5cea8]UART_EVENT_RX_FULL[/color][color=#b4b4b4])[/color] [color=#b4b4b4]{[/color] [color=#b4b4b4] [/color][color=#57a64a]// xEventGroupSetBits(EventGroupHandle_uart1, EVENT_UART1_RX);[/color] [color=#c8c8c8]receive0Data_group[/color][color=#b4b4b4][[/color][color=#c8c8c8]g_receive0Data_count[/color] [color=#b4b4b4]=[/color] [color=#c8c8c8]g_receive0Data[/color][color=#b4b4b4];[/color] [color=#c8c8c8]g_receive0Data_count[/color][color=#b4b4b4]++;[/color] [color=#d8a0df]if[/color] [color=#b4b4b4]([/color][color=#c8c8c8]g_receive0Data_count[/color] [color=#b4b4b4]>=[/color] [color=#beb7ff]RECELENGTHMAX[/color][color=#b4b4b4])[/color] [color=#b4b4b4]{[/color] [color=#c8c8c8]g_receive0Data_count[/color] [color=#b4b4b4]=[/color] [color=#b5cea8]0[/color][color=#b4b4b4];[/color] [color=#b4b4b4]}[/color] [color=#b4b4b4]}[/color] [color=#dcdcaa]UART_DRV_ReceiveData[/color][color=#b4b4b4]([/color][color=#b5cea8]0[/color][color=#b4b4b4],[/color] [color=#b4b4b4]&[/color][color=#c8c8c8]g_receive0Data[/color][color=#b4b4b4],[/color] [color=#b5cea8]1[/color][color=#b4b4b4]);[/color] [color=#57a64a] /* USER CODE END UART0_RX_IRQHandler_Callback */[/color] [color=#b4b4b4]}[/color] [color=#57a64a]/**[/color] [color=#57a64a] * [/color][color=#569cd6]@brief[/color][color=#57a64a] This function handle UART1 rx interrupt.[/color] [color=#57a64a] * [/color][color=#569cd6]@param[/color][color=#57a64a][[/color][color=#569cd6]in[/color][color=#57a64a]] [/color][color=#9a9a9a]driverState[/color][color=#57a64a]: callback parameter[/color] [color=#57a64a] * [/color][color=#569cd6]@param[/color][color=#57a64a][[/color][color=#569cd6]in[/color][color=#57a64a]] [/color][color=#9a9a9a]event[/color][color=#57a64a]: callback parameter[/color] [color=#57a64a] * [/color][color=#569cd6]@param[/color][color=#57a64a][[/color][color=#569cd6]in[/color][color=#57a64a]] [/color][color=#9a9a9a]userData[/color][color=#57a64a]: callback parameter[/color] [color=#57a64a] * [/color][color=#569cd6]@return[/color][color=#57a64a] none[/color] [color=#57a64a] */[/color] [color=#569cd6]void[/color] [color=#dcdcaa]UART1_RX_IRQHandler_Callback[/color][color=#b4b4b4]([/color][color=#569cd6]void[/color] [color=#b4b4b4]*[/color][color=#9a9a9a]driverState[/color][color=#b4b4b4],[/color] [color=#4ec9b0]uint32_t[/color] [color=#9a9a9a]event[/color][color=#b4b4b4],[/color] [color=#569cd6]void[/color] [color=#b4b4b4]*[/color][color=#9a9a9a]userData[/color][color=#b4b4b4])[/color] [color=#b4b4b4]{[/color] [color=#57a64a] /* USER CODE BEGIN UART1_RX_IRQHandler_Callback */[/color] [color=#d8a0df]if[/color] [color=#b4b4b4]([/color][color=#9a9a9a]event[/color] [color=#b4b4b4]==[/color] [color=#b5cea8]UART_EVENT_RX_FULL[/color][color=#b4b4b4])[/color] [color=#b4b4b4]{[/color] [color=#b4b4b4] [/color][color=#57a64a]// xEventGroupSetBits(EventGroupHandle_uart1, EVENT_UART1_RX);[/color] [color=#c8c8c8]receive1Data_group[/color][color=#b4b4b4][[/color][color=#c8c8c8]g_receive1Data_count[/color] [color=#b4b4b4]=[/color] [color=#c8c8c8]g_receive1Data[/color][color=#b4b4b4];[/color] [color=#c8c8c8]g_receive1Data_count[/color][color=#b4b4b4]++;[/color] [color=#d8a0df]if[/color] [color=#b4b4b4]([/color][color=#c8c8c8]g_receive1Data_count[/color] [color=#b4b4b4]>=[/color] [color=#beb7ff]RECELENGTHMAX[/color][color=#b4b4b4])[/color] [color=#b4b4b4]{[/color] [color=#c8c8c8]g_receive1Data_count[/color] [color=#b4b4b4]=[/color] [color=#b5cea8]0[/color][color=#b4b4b4];[/color] [color=#b4b4b4]}[/color] [color=#b4b4b4]}[/color] [color=#dcdcaa]UART_DRV_ReceiveData[/color][color=#b4b4b4]([/color][color=#b5cea8]1[/color][color=#b4b4b4],[/color] [color=#b4b4b4]&[/color][color=#c8c8c8]g_receive1Data[/color][color=#b4b4b4],[/color] [color=#b5cea8]1[/color][color=#b4b4b4]);[/color] [color=#57a64a] /* USER CODE END UART1_RX_IRQHandler_Callback */[/color] [color=#b4b4b4]}[/color] [color=#57a64a]/* UART0 init function */[/color] [color=#569cd6]static[/color] [color=#569cd6]void[/color] [color=#dcdcaa]ATC_UART0_Init[/color][color=#b4b4b4]([/color][color=#569cd6]void[/color][color=#b4b4b4])[/color] [color=#b4b4b4]{[/color] [color=#dcdcaa]memset[/color][color=#b4b4b4](&[/color][color=#c8c8c8]uart0Config[/color][color=#b4b4b4],[/color] [color=#b5cea8]0[/color][color=#b4b4b4],[/color] [color=#569cd6]sizeof[/color][color=#b4b4b4]([/color][color=#c8c8c8]uart0Config[/color][color=#b4b4b4]));[/color] [color=#57a64a] /**[/color] [color=#57a64a] GPIO Configuration for UART0[/color] [color=#57a64a] PB1 --> UART0_TX[/color] [color=#57a64a] PB0 --> UART0_RX[/color] [color=#57a64a] */[/color] [color=#dcdcaa]GPIO_DRV_SetMuxModeSel[/color][color=#b4b4b4]([/color][color=#beb7ff]PORTB[/color][color=#b4b4b4],[/color] [color=#b5cea8]1[/color][color=#b4b4b4],[/color] [color=#b5cea8]PORT_MUX_ALT2[/color][color=#b4b4b4]);[/color] [color=#dcdcaa]GPIO_DRV_SetMuxModeSel[/color][color=#b4b4b4]([/color][color=#beb7ff]PORTB[/color][color=#b4b4b4],[/color] [color=#b5cea8]0[/color][color=#b4b4b4],[/color] [color=#b5cea8]PORT_MUX_ALT2[/color][color=#b4b4b4]);[/color] [color=#57a64a] /* UART0 interrupt1 Init */[/color] [color=#dcdcaa]NVIC_SetPriority[/color][color=#b4b4b4]([/color][color=#b5cea8]UART0_IRQn[/color][color=#b4b4b4],[/color] [color=#b5cea8]0[/color][color=#b4b4b4]);[/color] [color=#dcdcaa]NVIC_EnableIRQ[/color][color=#b4b4b4]([/color][color=#b5cea8]UART0_IRQn[/color][color=#b4b4b4]);[/color] [color=#c8c8c8]uart0Config[/color][color=#b4b4b4].[/color]baudRate [color=#b4b4b4]=[/color] [color=#b5cea8]38400[/color][color=#b4b4b4];[/color] [color=#c8c8c8]uart0Config[/color][color=#b4b4b4].[/color]parityMode [color=#b4b4b4]=[/color] [color=#b5cea8]UART_PARITY_DISABLED[/color][color=#b4b4b4];[/color] [color=#c8c8c8]uart0Config[/color][color=#b4b4b4].[/color]stopBitCount [color=#b4b4b4]=[/color] [color=#b5cea8]UART_ONE_STOP_BIT[/color][color=#b4b4b4];[/color] [color=#c8c8c8]uart0Config[/color][color=#b4b4b4].[/color]bitCountPerChar [color=#b4b4b4]=[/color] [color=#b5cea8]UART_8_BITS_PER_CHAR[/color][color=#b4b4b4];[/color] [color=#c8c8c8]uart0Config[/color][color=#b4b4b4].[/color]transferType [color=#b4b4b4]=[/color] [color=#b5cea8]UART_USING_INTERRUPTS[/color][color=#b4b4b4];[/color] [color=#c8c8c8]uart0Config[/color][color=#b4b4b4].[/color]rxCallback [color=#b4b4b4]=[/color] [color=#dcdcaa]UART0_RX_IRQHandler_Callback[/color][color=#b4b4b4];[/color] [color=#dcdcaa]UART_DRV_Init[/color][color=#b4b4b4]([/color][color=#b5cea8]0[/color][color=#b4b4b4],[/color] [color=#b4b4b4]&[/color][color=#c8c8c8]s_uart0State[/color][color=#b4b4b4],[/color] [color=#b4b4b4]&[/color][color=#c8c8c8]uart0Config[/color][color=#b4b4b4]);[/color] [color=#57a64a] /* USER CODE BEGIN UART0_Init 2 */[/color] [color=#dcdcaa]UART_DRV_ReceiveData[/color][color=#b4b4b4]([/color][color=#b5cea8]0[/color][color=#b4b4b4],[/color] [color=#b4b4b4]&[/color][color=#c8c8c8]g_receive0Data[/color][color=#b4b4b4],[/color] [color=#b5cea8]1[/color][color=#b4b4b4]);[/color] [color=#57a64a] /* USER CODE END UART0_Init 2 */[/color] [color=#b4b4b4]}[/color] [color=#57a64a]/* UART1 init function */[/color] [color=#569cd6]static[/color] [color=#569cd6]void[/color] [color=#dcdcaa]ATC_UART1_Init[/color][color=#b4b4b4]([/color][color=#569cd6]void[/color][color=#b4b4b4])[/color] [color=#b4b4b4]{[/color] [color=#dcdcaa]memset[/color][color=#b4b4b4](&[/color][color=#c8c8c8]uart1Config[/color][color=#b4b4b4],[/color] [color=#b5cea8]0[/color][color=#b4b4b4],[/color] [color=#569cd6]sizeof[/color][color=#b4b4b4]([/color][color=#c8c8c8]uart1Config[/color][color=#b4b4b4]));[/color] [color=#57a64a] /**[/color] [color=#57a64a] GPIO Configuration for UART1[/color] [color=#57a64a] PC9 --> UART1_TX[/color] [color=#57a64a] PC8 --> UART1_RX[/color] [color=#57a64a] */[/color] [color=#dcdcaa]GPIO_DRV_SetMuxModeSel[/color][color=#b4b4b4]([/color][color=#beb7ff]PORTC[/color][color=#b4b4b4],[/color] [color=#b5cea8]9[/color][color=#b4b4b4],[/color] [color=#b5cea8]PORT_MUX_ALT2[/color][color=#b4b4b4]);[/color] [color=#dcdcaa]GPIO_DRV_SetMuxModeSel[/color][color=#b4b4b4]([/color][color=#beb7ff]PORTC[/color][color=#b4b4b4],[/color] [color=#b5cea8]8[/color][color=#b4b4b4],[/color] [color=#b5cea8]PORT_MUX_ALT2[/color][color=#b4b4b4]);[/color] [color=#57a64a] /* UART1 interrupt1 Init */[/color] [color=#dcdcaa]NVIC_SetPriority[/color][color=#b4b4b4]([/color][color=#b5cea8]UART1_IRQn[/color][color=#b4b4b4],[/color] [color=#b5cea8]1[/color][color=#b4b4b4]);[/color] [color=#dcdcaa]NVIC_EnableIRQ[/color][color=#b4b4b4]([/color][color=#b5cea8]UART1_IRQn[/color][color=#b4b4b4]);[/color] [color=#c8c8c8]uart1Config[/color][color=#b4b4b4].[/color]baudRate [color=#b4b4b4]=[/color] [color=#b5cea8]38400[/color][color=#b4b4b4];[/color] [color=#c8c8c8]uart1Config[/color][color=#b4b4b4].[/color]parityMode [color=#b4b4b4]=[/color] [color=#b5cea8]UART_PARITY_DISABLED[/color][color=#b4b4b4];[/color] [color=#c8c8c8]uart1Config[/color][color=#b4b4b4].[/color]stopBitCount [color=#b4b4b4]=[/color] [color=#b5cea8]UART_ONE_STOP_BIT[/color][color=#b4b4b4];[/color] [color=#c8c8c8]uart1Config[/color][color=#b4b4b4].[/color]bitCountPerChar [color=#b4b4b4]=[/color] [color=#b5cea8]UART_8_BITS_PER_CHAR[/color][color=#b4b4b4];[/color] [color=#c8c8c8]uart1Config[/color][color=#b4b4b4].[/color]transferType [color=#b4b4b4]=[/color] [color=#b5cea8]UART_USING_INTERRUPTS[/color][color=#b4b4b4];[/color] [color=#c8c8c8]uart1Config[/color][color=#b4b4b4].[/color]rxCallback [color=#b4b4b4]=[/color] [color=#dcdcaa]UART1_RX_IRQHandler_Callback[/color][color=#b4b4b4];[/color] [color=#dcdcaa]UART_DRV_Init[/color][color=#b4b4b4]([/color][color=#b5cea8]1[/color][color=#b4b4b4],[/color] [color=#b4b4b4]&[/color][color=#c8c8c8]s_uart1State[/color][color=#b4b4b4],[/color] [color=#b4b4b4]&[/color][color=#c8c8c8]uart1Config[/color][color=#b4b4b4]);[/color] [color=#57a64a] /* USER CODE BEGIN UART1_Init 2 */[/color] [color=#dcdcaa]UART_DRV_ReceiveData[/color][color=#b4b4b4]([/color][color=#b5cea8]1[/color][color=#b4b4b4],[/color] [color=#b4b4b4]&[/color][color=#c8c8c8]g_receive1Data[/color][color=#b4b4b4],[/color] [color=#b5cea8]1[/color][color=#b4b4b4]);[/color] [color=#57a64a] /* USER CODE END UART1_Init 2 */[/color] [color=#b4b4b4]}[/color] [color=#569cd6]void[/color] [color=#dcdcaa]drv_comm_init[/color][color=#b4b4b4]([/color][color=#569cd6]void[/color][color=#b4b4b4])[/color] [color=#b4b4b4]{[/color] [color=#dcdcaa]memset[/color][color=#b4b4b4]([/color][color=#c8c8c8]receive0Data_group[/color][color=#b4b4b4],[/color] [color=#b5cea8]0[/color][color=#b4b4b4],[/color] [color=#569cd6]sizeof[/color][color=#b4b4b4]([/color][color=#c8c8c8]receive0Data_group[/color][color=#b4b4b4]));[/color] [color=#dcdcaa]memset[/color][color=#b4b4b4]([/color][color=#c8c8c8]receive1Data_group[/color][color=#b4b4b4],[/color] [color=#b5cea8]0[/color][color=#b4b4b4],[/color] [color=#569cd6]sizeof[/color][color=#b4b4b4]([/color][color=#c8c8c8]receive1Data_group[/color][color=#b4b4b4]));[/color] [color=#c8c8c8]EventGroupHandle_uart[/color] [color=#b4b4b4]=[/color] [color=#dcdcaa]xEventGroupCreate[/color][color=#b4b4b4]();[/color] [color=#dcdcaa]ATC_UART0_Init[/color][color=#b4b4b4]();[/color] [color=#dcdcaa]ATC_UART1_Init[/color][color=#b4b4b4]();[/color] [color=#b4b4b4]}[/color] [color=#569cd6]void[/color] [color=#dcdcaa]drv_comm_write[/color][color=#b4b4b4]([/color][color=#569cd6]unsigned[/color] [color=#569cd6]char[/color] [color=#b4b4b4]*[/color][color=#9a9a9a]p_data[/color][color=#b4b4b4],[/color] [color=#569cd6]unsigned[/color] [color=#569cd6]char[/color] [color=#9a9a9a]length[/color][color=#b4b4b4])[/color] [color=#b4b4b4]{[/color] [color=#b4b4b4]}[/color] [color=#569cd6]void[/color] [color=#dcdcaa]drv_comm_read[/color][color=#b4b4b4]([/color][color=#569cd6]void[/color][color=#b4b4b4])[/color] [color=#b4b4b4]{[/color] [color=#b4b4b4]}[/color] [/font][/backcolor][/color]
1841浏览量 0回复量 关注量 -
StandBY待机模式,WakeUp失效,只能通过NRTST复位 sos
不知道怎么添加本地图片#include "stm32f10x.h" #include "stdint.h" #include "LED.h" #include "KEY.h" #include "stdio.h" #include "OLED.h" #include "PRINTF.h"//虽然名字是是打印,但是重定向到OLED失败了,这里是待机初始化有关的函数 static void Delay(__IO uint32_t nCount); //进入休眠:熄灯,并显示“StandBy” //退出休眠:亮灯,并显示“welcome to use” int main(void) { //初始化复位按键,这是特殊的,尽管在待机模式下不识别外部中断?擦擦擦啊 WakeUp_Init(); //屏幕初始化 OLED_Init(); //灯泡引脚初始化 LED_GPIO_Config(); //初始化进入待机按键,这里长按进入待机,引脚是PA6 Key_GPIO_Config(); OLED_ShowString(1,1,"WelCome to use"); //延时,让屏幕显示久一点让你看到 Delay(0x3fffff); //从待机唤醒后,除了电源控制/状态寄存器(PWR_CSR),所有寄存器被复位 //检查WakeUp标志位,如果是1,就代表是从待机模式下唤醒 if(PWR_GetFlagStatus(PWR_FLAG_WU) == SET) { OLED_ShowString(1,1,"From StandBy"); Delay(0x3fffff); } else { OLED_ShowString(1,1,"Not From StandBy"); Delay(0x3fffff); } while(1) { OLED_ShowString(1,1,"Working"); LED_H(LED_GPIO_PORT,LED_GPIO_PIN); //长按进入待机状态 if(KEY2_LongPress()) { OLED_ShowString(1,1,"StandBy"); Delay(0x5fffff); /*进入待机模式,清除WakeUp标志位也是在这里*/ Enter_StandBy(); } } } static void Delay(__IO uint32_t nCount) { for (; nCount!=0;nCount--); } ###NextPage[title=EnterStandBy()函数,WakeUp_Init()函数]### #include "PRINTF.h" void WakeUp_Init(void) { RCC_APB1PeriphClockCmd(RCC_APB1Periph_PWR ,ENABLE); /*打开WakeUp唤醒功能*/ PWR_WakeUpPinCmd(ENABLE); } void Enter_StandBy(void) { /*清除唤醒标志位*/ PWR_ClearFlag (PWR_FLAG_WU); //清除待机标志位 PWR_ClearFlag(PWR_FLAG_SB); /*进入待机模式*/ PWR_EnterSTANDBYMode(); }
1140浏览量 0回复量 关注量