优化
This commit is contained in:
@@ -2,6 +2,9 @@
|
||||
#include "cmsis_os.h"
|
||||
#include "osu.h"
|
||||
|
||||
uint16_t gusOsuLevel = 0;
|
||||
uint16_t gusOsuTemp = 0;
|
||||
|
||||
extern UART_HandleTypeDef huart3;
|
||||
static uint8_t gausRcvBuf[100];
|
||||
static int rx_packet_ready = 0;
|
||||
@@ -39,6 +42,8 @@ static void osuDataProcess(void) {
|
||||
int level = gausRcvBuf[4];
|
||||
int temp = gausRcvBuf[5] * 256 + gausRcvBuf[6];
|
||||
printf("osu packet level, %d, temp, %.1f\r\n", level, temp / 10.0);
|
||||
gusOsuLevel = level;
|
||||
gusOsuTemp = temp;
|
||||
}
|
||||
|
||||
void HAL_UARTEx_RxEventCallback_UART3(UART_HandleTypeDef *huart, uint16_t Size)
|
||||
|
||||
@@ -6,6 +6,9 @@
|
||||
#include "main.h"
|
||||
/* Exported types ------------------------------------------------------------*/
|
||||
|
||||
extern uint16_t gusOsuLevel;
|
||||
extern uint16_t gusOsuTemp;
|
||||
|
||||
void osuInit(void);
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user