From 36f82d08c22036ab9ea15c5f8b34f49fd2647b11 Mon Sep 17 00:00:00 2001 From: YunHorn Technology Date: Thu, 19 Sep 2024 10:37:33 +0800 Subject: [PATCH] wip good so far before reboot config --- LoRaWAN/App/lora_app.c | 6 +++--- STS/Core/Src/yunhorn_sts_process.c | 10 +++++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/LoRaWAN/App/lora_app.c b/LoRaWAN/App/lora_app.c index 5cfa7fd..439e1b5 100644 --- a/LoRaWAN/App/lora_app.c +++ b/LoRaWAN/App/lora_app.c @@ -47,7 +47,7 @@ uint8_t outbuf[128]={0x0}; extern volatile uint8_t *sts_ac_code; extern volatile uint32_t rfac_timer; -extern volatile uint32_t STS_HeartBeatTimerPeriod_sec; +extern volatile uint32_t STS_TOFScanPeriod_msec, STS_TxPeriod_sec, STS_HeartBeatTimerPeriod_sec; /* USER CODE END EV */ /* Private typedef -----------------------------------------------------------*/ @@ -501,7 +501,7 @@ void LoRaWAN_Init(void) /* USER CODE BEGIN LoRaWAN_Init_Last */ APP_LOG(TS_OFF, VLEVEL_M, "\n reboot config start \n"); - STS_REBOOT_CONFIG_Init(); + //STS_REBOOT_CONFIG_Init(); UTIL_SEQ_RegTask((1 << CFG_SEQ_Task_YunhornSTSEventRFAC), UTIL_SEQ_RFU, STS_YunhornSTSEventRFAC_Process); @@ -513,7 +513,7 @@ void LoRaWAN_Init(void) - UTIL_TIMER_Create(&YunhornSTSWakeUpScanTimer, 50, UTIL_TIMER_PERIODIC, OnYunhornSTSWakeUpScanTimerEvent, NULL); + UTIL_TIMER_Create(&YunhornSTSWakeUpScanTimer, STS_TOFScanPeriod_msec, UTIL_TIMER_PERIODIC, (void*)OnYunhornSTSWakeUpScanTimerEvent, NULL); UTIL_TIMER_Start(&YunhornSTSWakeUpScanTimer); UTIL_TIMER_Create(&YunhornSTSHeartBeatTimer, STS_HeartBeatTimerPeriod_sec, UTIL_TIMER_PERIODIC, OnYunhornSTSHeartBeatTimerEvent, NULL); diff --git a/STS/Core/Src/yunhorn_sts_process.c b/STS/Core/Src/yunhorn_sts_process.c index 655d649..8c37e44 100644 --- a/STS/Core/Src/yunhorn_sts_process.c +++ b/STS/Core/Src/yunhorn_sts_process.c @@ -37,6 +37,10 @@ #include "flash_if.h" #include "lora_app.h" /* USER CODE BEGIN Includes */ +#include "stm32_seq.h" +#include "stm32_timer.h" +#include "utilities_def.h" + #ifdef STS_P2 #include "app_tof.h" #include "app_tof_peoplecount.h" @@ -101,7 +105,7 @@ volatile uint8_t sts_work_mode=4; volatile uint32_t rfac_timer=0; volatile uint16_t sts_sensor_install_height=3000; volatile uint8_t sensor_data_ready=0; -volatile uint32_t STS_TOFScanPeriod_sec, STS_TxPeriod_sec, STS_HeartBeatTimerPeriod_sec; +volatile uint32_t STS_TOFScanPeriod_msec=50, STS_TxPeriod_sec=10, STS_HeartBeatTimerPeriod_sec=120; static uint8_t outbuf[128]={0x0}; extern volatile hmac_result_t hmac_result; extern uint16_t sensor_id; @@ -1716,8 +1720,8 @@ void OnYunhornSTSHeartBeatTimerEvent(void *context) if (rfac_timer < (STS_BURN_IN_RFAC+3)) { rfac_timer ++; } - STS_YunhornSTSEventRFAC_Process(); - //UTIL_SEQ_SetTask((1 << CFG_SEQ_Task_YunhornSTSEventRFAC), CFG_SEQ_Prio_0); + //STS_YunhornSTSEventRFAC_Process(); + UTIL_SEQ_SetTask((1 << CFG_SEQ_Task_YunhornSTSEventRFAC), CFG_SEQ_Prio_0); } UTIL_TIMER_Start(&YunhornSTSHeartBeatTimer); }