WXK
2023-07-07 6c87b494401e48edc87fc0ada04858f424501656
Src/main.c
@@ -28,7 +28,7 @@
#include "global_param.h"
#include "TrackingDiff.h"
#include "dw_app.h"
#include "BMP390.h"
#define NSH1 0x0001
#define GP   0x0002
#define DEBUG_MODE
@@ -234,7 +234,7 @@
   hardware_pici= STMFLASH_ReadHalfWord(FLASH_HARDWARE_VERSION_MAP+2);
   hardware_type= STMFLASH_ReadHalfWord(FLASH_HARDWARE_VERSION_MAP+4);
   //deca_sleep(1000);
   g_com_map[VERSION] = (2<<8)|4;
   g_com_map[VERSION] = (2<<8)|5;
    
//   g_com_map[DEV_ID]=0x7;
#ifdef DEBUG_MODE
@@ -354,6 +354,8 @@
{
      //SCB->AIRCR = 0X05FA0000|(unsigned int)0x04; //软复位回到bootloader   
}
int Pressure_Para[11],Temperature_Para[3];
extern float Altitude;
/* USER CODE END 0 */
/**
@@ -406,6 +408,24 @@
    dwt_setrxtimeout(0);//设定接收超时时间,0位没有
    dwt_rxenable(0);
   DW_DISABLE;
    /*气压计*/
    IIC_Init();
    u8 BMP390_ID;
    u8 Config;
    BMP390_ID = BMP390_Init();
    Parameter_Reading(Pressure_Para,Temperature_Para);
   //Judge the relevant state of the sensor
   Config = BMP390_Read_Byte(ERR_REG_Addr);
   if(Config&0x01)
    printf("Fatal Error");
   else
    printf("No errors.");
   if((Config>>1)&0x01)
    printf("Failed.");
   else
    printf("Successful.");
    /*气压计*/
    if(HAL_UART_Receive_DMA(&huart1,m_EUART_DMA_RXBuf,EUART_RX_BUF_SIZE))
   {
    Error_Handler();