--revised distance measure process and format
This commit is contained in:
parent
de184d558f
commit
5202f4d8fb
|
@ -1422,6 +1422,8 @@ static void OnYunhornSTSHeartBeatTimerEvent(void *context)
|
|||
appHeartBeatDataPort = YUNHORN_STS_R5_LORA_APP_HTBT_PORT;
|
||||
#elif defined(STS_R4)
|
||||
appHeartBeatDataPort = YUNHORN_STS_R4_LORA_APP_HTBT_PORT;
|
||||
#elif defined(STS_T6)
|
||||
appHeartBeatDataPort = YUNHORN_STS_T6_LORA_APP_HTBT_PORT;
|
||||
#endif
|
||||
|
||||
appHeartBeatBufferSize = 2;
|
||||
|
|
|
@ -1025,7 +1025,7 @@ void USER_APP_AUTO_RESPONDER_Parse(uint8_t *parse_buffer, uint8_t parse_buffer_s
|
|||
case 'D': /* "YZD": Distance/Install height Measure */
|
||||
STS_SENSOR_Distance_Test_Process();
|
||||
sts_cfg_nvm.sensor_install_height_in_10cm = sts_sensor_install_height/100; //in 10 cm, say 4500mm=450cm=45 dm
|
||||
APP_LOG(TS_OFF, VLEVEL_M, "\n STS CFG NVM -> SENSOR INSTALL HEIGHT STORED = %d CM\n", sts_cfg_nvm.sensor_install_height_in_10cm);
|
||||
APP_LOG(TS_OFF, VLEVEL_M, "\n STS CFG NVM -> SENSOR INSTALL HEIGHT STORED = %d dm(10cm)\n", sts_cfg_nvm.sensor_install_height_in_10cm);
|
||||
OnStoreSTSCFGContextRequest();
|
||||
i = 0;
|
||||
outbuf[i++] = (uint8_t)'D';
|
||||
|
@ -1685,7 +1685,7 @@ void STS_SENSOR_Distance_Test_Process(void)
|
|||
//MX_TOF_Init();
|
||||
//MX_TOF_Process();
|
||||
sts_sensor_install_height = (uint16_t)MX_TOF_Ranging_Process();
|
||||
APP_LOG(TS_OFF, VLEVEL_M, "\n STS SENSOR INSTALLATION HEIGHT =%d \n\r", (uint16_t)sts_sensor_install_height);
|
||||
APP_LOG(TS_OFF, VLEVEL_M, "\n STS SENSOR INSTALLATION HEIGHT =%d mm\n\r", (uint16_t)sts_sensor_install_height);
|
||||
#endif
|
||||
#if defined(VL53L0)
|
||||
STS_TOF_VL53L0X_Range_Process();
|
||||
|
|
|
@ -31,7 +31,7 @@ extern "C" {
|
|||
//#include "VL53L1X_ULP_api.h"
|
||||
//#include "53l1a2_ranging_sensor.h"
|
||||
#include "stm32wlxx_nucleo.h"
|
||||
#ifdef STS_P2
|
||||
#if defined(STS_P2)||defined(STS_T6)
|
||||
#include "VL53L1X_api.h"
|
||||
#endif
|
||||
/* Private typedef -----------------------------------------------------------*/
|
||||
|
@ -49,12 +49,12 @@ volatile uint8_t ToF_EventDetected = 0;
|
|||
uint16_t sensor_id=0;
|
||||
|
||||
/* Private function prototypes -----------------------------------------------*/
|
||||
#ifdef STS_P2
|
||||
#if defined(STS_P2)||defined(STS_T6)
|
||||
uint8_t sts_vl53lx_ranging(uint16_t *ranged_distance, uint8_t range_mode, uint16_t distance_threshold_mm,
|
||||
uint16_t inter_measurement_ms, uint16_t macro_timing,uint16_t roi_width, uint16_t sigma_mm, uint16_t signal_kcps);
|
||||
#endif
|
||||
uint8_t IsInterruptDetected(uint16_t dev);
|
||||
#ifdef STS_P2
|
||||
#if defined(STS_P2)||defined(STS_T6)
|
||||
void STS_TOF_VL53LX_Range_Process(uint8_t range_mode, uint16_t *range_distance);
|
||||
#endif
|
||||
void MX_TOF_Init(void)
|
||||
|
@ -84,7 +84,7 @@ void MX_TOF_Init(void)
|
|||
uint16_t MX_TOF_Ranging_Process(void)
|
||||
{
|
||||
|
||||
#ifdef STS_P2
|
||||
#if defined(STS_P2)||defined(STS_T6)
|
||||
uint16_t range_distance=0;
|
||||
uint8_t range_mode = 2; //STS_TOF_LONG_RANGE;
|
||||
STS_TOF_VL53LX_Range_Process(range_mode, &range_distance);
|
||||
|
@ -125,7 +125,7 @@ uint8_t IsInterruptDetected(uint16_t dev)
|
|||
return 0;
|
||||
}
|
||||
}
|
||||
#ifdef STS_P2
|
||||
#if defined(STS_P2)||defined(STS_T6)
|
||||
void STS_TOF_VL53LX_Range_Process(uint8_t range_mode, uint16_t *range_distance)
|
||||
{
|
||||
//uint8_t vl53lx_model = STS_TOF_VL53L1X;
|
||||
|
|
Loading…
Reference in New Issue