--- overall workable L8 process locked

This commit is contained in:
Yunhorn 2024-11-19 13:27:07 +08:00
parent b50d6558e4
commit d0e4841fd8
5 changed files with 24 additions and 16 deletions

View File

@ -114,9 +114,11 @@ int main(void)
MX_DMA_Init();
MX_LoRaWAN_Init();
}
MX_TOF_Process();
/* USER CODE BEGIN 2 */
//MX_USART2_UART_Init();
/* USER CODE END 2 */
/* Infinite loop */
@ -124,10 +126,8 @@ int main(void)
while (1)
{
/* USER CODE END WHILE */
//MX_TOF_Process();
MX_LoRaWAN_Process();
// MX_TOF_Ranging_Process();
MX_LoRaWAN_Process();
/* USER CODE BEGIN 3 */
}

View File

@ -121,7 +121,7 @@ volatile uint8_t sensor_data_ready=0;
#if defined(STS_R1)||defined(STS_R5)||defined(STS_R4)||defined(STS_R1D)
volatile uint32_t STS_TOFScanPeriod_msec=50, STS_TxPeriod_sec=30, STS_HeartBeatTimerPeriod_sec=3600;
#elif defined(STS_L8)||defined(STS_P2)||defined(STS_O6T)||defined(STS_T6)
volatile uint32_t STS_TOFScanPeriod_msec=500, STS_TxPeriod_sec=300, STS_HeartBeatTimerPeriod_sec=3600;
volatile uint32_t STS_TOFScanPeriod_msec=200, STS_TxPeriod_sec=300, STS_HeartBeatTimerPeriod_sec=3600;
#endif
static uint8_t outbuf[128]={0x0};
@ -445,9 +445,9 @@ void STS_YunhornSTSEventP5_Process(void)
}
#elif defined(L8)
//STS_TOF_VL53L8X_Process();
//STS_TOF_L8_Process();
printf("\r\n P5 process \r\n");
MX_TOF_Process();
//printf("\r\n P5 process \r\n");
STS_TOF_L8_Process();
//MX_TOF_Process();
//MX_TOF_Ranging_Process();
#endif

View File

@ -211,9 +211,9 @@ void MX_TOF_Process(void)
//sts_tof_vl53lx_peoplecount_subprocess();
#ifdef L8
//MX_53L8A1_ThresholdDetection_Process();
printf("\r\n Tof Process\r\n");
STS_TOF_L8_Process();
MX_53L8A1_ThresholdDetection_Process();
//printf("\r\n Tof Process\r\n");
//STS_TOF_L8_Process();
#endif
/* USER CODE BEGIN TOF_Process_PostTreatment */
@ -221,10 +221,15 @@ void MX_TOF_Process(void)
/* USER CODE END TOF_Process_PostTreatment */
}
#ifdef L8
void STS_TOF_L8_Init(void)
{
MX_53L8A1_ThresholdDetection_Init();
MX_53L8A1_ThresholdDetection_Process();
}
void STS_TOF_L8_Process(void)
{
printf("\r\n Tof L8 Process\r\n");
MX_53L8A1_ThresholdDetection_Process();
//printf("\r\n Tof L8 Process\r\n");
//while (1)
{
/* interrupt mode */
@ -341,13 +346,16 @@ static void print_result(RANGING_SENSOR_Result_t *Result)
(Profile.RangingProfile == RS_PROFILE_8x8_CONTINUOUS)) ? 8 : 4;
printf("%c[2H", 27); /* clear screen */
#if 0
printf("53L8A1 Threshold Detection demo application\n\r");
printf("-------------------------------------------");
printf("-------- Low= %4d High= %4d ------------", LOW_THRESHOLD, HIGH_THRESHOLD);
printf("-------------------------------------------\n\r");
printf("-------- Low= %4d High= %4d ------------\n\r", LOW_THRESHOLD, HIGH_THRESHOLD);
printf("Cell Format :");
#endif
//printf(" \033[38;5;10m%20s\033[0m : %20s\n", "Distance [mm]", "Status\r");
for (l = 0; l < RANGING_SENSOR_NB_TARGET_PER_ZONE; l++)
{
printf(" \033[38;5;10m%20s\033[0m : %20s\n", "Distance [mm]", "Status\r");
if ((Profile.EnableAmbient != 0) || (Profile.EnableSignal != 0))
{
printf(" %20s : %20s\n", "Signal [kcps/spad]", "Ambient [kcps/spad]\r");