From 07f9bcc33d0ea097a399f9fcdaa197b98b66460e Mon Sep 17 00:00:00 2001 From: CaoWangrenbo Date: Tue, 9 Jan 2024 17:20:08 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E4=B9=8B=E5=89=8D?= =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=B8=AD=E7=9A=84=E4=B8=80=E4=BA=9B=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/isr.c | 5 +++-- app/jj_blueteeth.c | 2 ++ app/jj_blueteeth.h | 2 ++ app/jj_param.h | 6 ++---- app/main.c | 2 +- app/page/page_param.c | 3 ++- 6 files changed, 12 insertions(+), 8 deletions(-) diff --git a/app/isr.c b/app/isr.c index 9c47092..f9ff1a4 100644 --- a/app/isr.c +++ b/app/isr.c @@ -38,6 +38,7 @@ #include "by_imu.h" #include "jj_blueteeth.h" #include "by_buzzer.h" +#include "jj_blueteeth.h" void NMI_Handler(void) __attribute__((interrupt())); void HardFault_Handler(void) __attribute__((interrupt())); @@ -92,8 +93,8 @@ void USART1_IRQHandler(void) void USART2_IRQHandler(void) { if (USART_GetITStatus(USART2, USART_IT_RXNE) != RESET) { - uart_query_byte(UART_2,&bt_buffer); - bt_rx_flag=true; + uart_query_byte(UART_2, &bt_buffer); + bt_rx_flag = true; USART_ClearITPendingBit(USART2, USART_IT_RXNE); } } diff --git a/app/jj_blueteeth.c b/app/jj_blueteeth.c index dcacd40..f2c9e51 100644 --- a/app/jj_blueteeth.c +++ b/app/jj_blueteeth.c @@ -1,6 +1,8 @@ #include "jj_blueteeth.h" + bool bt_rx_flag = false; uint8 bt_buffer;//接收字符存入 + enum bt_order { Start_work = 0x01, Turn_Left = 0x02, diff --git a/app/jj_blueteeth.h b/app/jj_blueteeth.h index f648434..e5ace9d 100644 --- a/app/jj_blueteeth.h +++ b/app/jj_blueteeth.h @@ -1,7 +1,9 @@ #ifndef _JJ_BLUETEETH_H_ #define _JJ_BLUETEETH_H_ + #include "zf_common_headfile.h" #include "zf_driver_uart.h" + extern bool bt_rx_flag; extern uint8 bt_buffer; void jj_bt_init(); diff --git a/app/jj_param.h b/app/jj_param.h index 4eb36ba..16de4ef 100644 --- a/app/jj_param.h +++ b/app/jj_param.h @@ -11,6 +11,7 @@ Param_Data[_data_tag_].type = _type_; \ Param_Data[_data_tag_].cmd = _cmd_; \ Param_Data[_data_tag_].text = _text_; + typedef enum { DATA_HEAD = -1, DATA0, @@ -25,10 +26,7 @@ typedef enum { DATA_IN_FLASH_NUM, DATA_NUM, } data_tag_t; -/** - * @brief - * - */ + typedef enum { EUINT32, EINT32, diff --git a/app/main.c b/app/main.c index 80dc0d3..52b091f 100644 --- a/app/main.c +++ b/app/main.c @@ -36,7 +36,7 @@ int main(void) clock_init(SYSTEM_CLOCK_120M); system_delay_init(); debug_init(); - // mt9v03x_init(); + mt9v03x_init(); ips200_init(IPS200_TYPE_SPI); by_gpio_init(); by_exit_init(); diff --git a/app/page/page_param.c b/app/page/page_param.c index 814b6a8..06a7294 100644 --- a/app/page/page_param.c +++ b/app/page/page_param.c @@ -1,6 +1,7 @@ #include "jj_param.h" #include "page_ui_widget.h" #include "page.h" + #define LINE_HEAD 0 #define LINE_END DATA_NUM - 2 static char Text[] = "RealTime Param"; @@ -78,7 +79,7 @@ static void Event(page_event event) } else if (Curser > LINE_END) { Curser = LINE_HEAD; } - Print_Curser(Curser, Curser_Last, RGB565_PURPLE); + Print_Curser(Curser, Curser_Last, RGB565_PURPLE); } else if (1 == event_flag) { if (page_event_forward == event) { if (Param_Data[Curser].type == EFLOAT) {