Compare commits
No commits in common. "9ecfa78e6b826737f872ca808643f320aef395d0" and "242917ff15a2232d035e4460ea5fedc21c9240c6" have entirely different histories.
9ecfa78e6b
...
242917ff15
|
@ -73,7 +73,7 @@ void MX_LoRaWAN_Init(void)
|
||||||
/* USER CODE END MX_LoRaWAN_Init_2 */
|
/* USER CODE END MX_LoRaWAN_Init_2 */
|
||||||
LoRaWAN_Init();
|
LoRaWAN_Init();
|
||||||
/* USER CODE BEGIN MX_LoRaWAN_Init_3 */
|
/* USER CODE BEGIN MX_LoRaWAN_Init_3 */
|
||||||
//STS_SENSOR_Function_Test_Process();
|
STS_SENSOR_Function_Test_Process();
|
||||||
//STS_ClockSync_process();
|
//STS_ClockSync_process();
|
||||||
//STS_SENSOR_Warm_Up();
|
//STS_SENSOR_Warm_Up();
|
||||||
/* USER CODE END MX_LoRaWAN_Init_3 */
|
/* USER CODE END MX_LoRaWAN_Init_3 */
|
||||||
|
|
|
@ -83,7 +83,7 @@ uint32_t check_time=0;
|
||||||
volatile bool motionDetected =false;
|
volatile bool motionDetected =false;
|
||||||
uint32_t lastMotionTime =0;
|
uint32_t lastMotionTime =0;
|
||||||
const uint32_t ledOnDuration = 10000;
|
const uint32_t ledOnDuration = 10000;
|
||||||
static uint8_t sts_warm_up_message_counter=0;
|
|
||||||
|
|
||||||
/* USER CODE END EV */
|
/* USER CODE END EV */
|
||||||
|
|
||||||
|
@ -114,7 +114,7 @@ typedef enum TxEventType_e
|
||||||
/**
|
/**
|
||||||
* LEDs period value of the timer in ms
|
* LEDs period value of the timer in ms
|
||||||
*/
|
*/
|
||||||
#define LED_PERIOD_TIME 500
|
#define LED_PERIOD_TIME 800
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Join switch period value of the timer in ms
|
* Join switch period value of the timer in ms
|
||||||
|
@ -281,7 +281,7 @@ static void OnJoinTimerLedEvent(void *context);
|
||||||
* @brief STS Wake Up Scan timer callback function
|
* @brief STS Wake Up Scan timer callback function
|
||||||
* @param context ptr of VL53LX TOF People Counting Process context
|
* @param context ptr of VL53LX TOF People Counting Process context
|
||||||
*/
|
*/
|
||||||
//static void OnYunhornSTSWakeUpScanTimerEvent(void *context);
|
static void OnYunhornSTSWakeUpScanTimerEvent(void *context);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -301,7 +301,7 @@ static void OnYunhornSTSDurationCheckTimerEvent(void *context);
|
||||||
* @param context ptr of STS RSS WakeUp context
|
* @param context ptr of STS RSS WakeUp context
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// static void OnYunhornSTSOORSSWakeUpTimerEvent(void *context);
|
static void OnYunhornSTSOORSSWakeUpTimerEvent(void *context);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Yunhorn STS Heart beat timer callback function
|
* @brief Yunhorn STS Heart beat timer callback function
|
||||||
|
@ -1245,7 +1245,7 @@ static void SendTxData(void)
|
||||||
|
|
||||||
if (fhmos_data.state_fall_released == 1)
|
if (fhmos_data.state_fall_released == 1)
|
||||||
{
|
{
|
||||||
fhmos_data.state_fall_released = 0;
|
fhmos_data.state_fall_released == 0;
|
||||||
|
|
||||||
AppData.Buffer[i++] = (uint8_t) 0xff&(fhmos_data.time_stamp_fall_confirmed>>24);
|
AppData.Buffer[i++] = (uint8_t) 0xff&(fhmos_data.time_stamp_fall_confirmed>>24);
|
||||||
AppData.Buffer[i++] = (uint8_t) 0xff&(fhmos_data.time_stamp_fall_confirmed>>16);
|
AppData.Buffer[i++] = (uint8_t) 0xff&(fhmos_data.time_stamp_fall_confirmed>>16);
|
||||||
|
@ -1360,16 +1360,11 @@ static void OnTxTimerEvent(void *context)
|
||||||
APP_LOG(TS_OFF, VLEVEL_M, "\nSET TASK P4\r\n");
|
APP_LOG(TS_OFF, VLEVEL_M, "\nSET TASK P4\r\n");
|
||||||
UTIL_SEQ_SetTask((1 << CFG_SEQ_Task_YunhornSTSEventP4), CFG_SEQ_Prio_0);
|
UTIL_SEQ_SetTask((1 << CFG_SEQ_Task_YunhornSTSEventP4), CFG_SEQ_Prio_0);
|
||||||
#endif
|
#endif
|
||||||
if (sts_warm_up_message_counter ++ < 10)
|
|
||||||
{
|
|
||||||
UTIL_TIMER_Stop(&TxTimer);
|
|
||||||
|
|
||||||
UTIL_SEQ_SetTask((1 << CFG_SEQ_Task_LoRaSendOnTxTimerOrButtonEvent), CFG_SEQ_Prio_0);
|
UTIL_SEQ_SetTask((1 << CFG_SEQ_Task_LoRaSendOnTxTimerOrButtonEvent), CFG_SEQ_Prio_0);
|
||||||
|
|
||||||
UTIL_TIMER_Start(&TxTimer);
|
|
||||||
}
|
|
||||||
/*Wait for next tx slot*/
|
/*Wait for next tx slot*/
|
||||||
|
UTIL_TIMER_Start(&TxTimer);
|
||||||
/* USER CODE BEGIN OnTxTimerEvent_2 */
|
/* USER CODE BEGIN OnTxTimerEvent_2 */
|
||||||
|
|
||||||
/* USER CODE END OnTxTimerEvent_2 */
|
/* USER CODE END OnTxTimerEvent_2 */
|
||||||
|
@ -1443,12 +1438,15 @@ static void OnJoinRequest(LmHandlerJoinParams_t *joinParams)
|
||||||
}
|
}
|
||||||
AppData.Port = 1;
|
AppData.Port = 1;
|
||||||
AppData.BufferSize = 16;
|
AppData.BufferSize = 16;
|
||||||
|
// UTIL_MEM_cpy_8(AppData.Buffer, (uint8_t*)"YUNHORN168", 10);
|
||||||
UTIL_MEM_cpy_8((uint8_t*)AppData.Buffer, (uint8_t *)YUNHORN_STS_PRD_STRING, sizeof(YUNHORN_STS_PRD_STRING));
|
UTIL_MEM_cpy_8((uint8_t*)AppData.Buffer, (uint8_t *)YUNHORN_STS_PRD_STRING, sizeof(YUNHORN_STS_PRD_STRING));
|
||||||
AppData.BufferSize = sizeof(YUNHORN_STS_PRD_STRING)-1;
|
AppData.BufferSize = sizeof(YUNHORN_STS_PRD_STRING);
|
||||||
LmHandlerParams.IsTxConfirmed = true;
|
LmHandlerParams.IsTxConfirmed = true;
|
||||||
LmHandlerErrorStatus_t status = LmHandlerSend(&AppData, LmHandlerParams.IsTxConfirmed, false);
|
LmHandlerErrorStatus_t status = LmHandlerSend(&AppData, LmHandlerParams.IsTxConfirmed, false);
|
||||||
if (status ==LORAMAC_HANDLER_SUCCESS ) LmHandlerParams.IsTxConfirmed = false;
|
if (status ==LORAMAC_HANDLER_SUCCESS ) LmHandlerParams.IsTxConfirmed = false;
|
||||||
|
|
||||||
|
// STS_SENSOR_Function_Test_Process();
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -1459,7 +1457,6 @@ static void OnJoinRequest(LmHandlerJoinParams_t *joinParams)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
UTIL_TIMER_Start(&TxTimer);
|
|
||||||
// UTIL_TIMER_Start(&YunhornSTSWakeUpScanTimer);
|
// UTIL_TIMER_Start(&YunhornSTSWakeUpScanTimer);
|
||||||
/* USER CODE END OnJoinRequest_1 */
|
/* USER CODE END OnJoinRequest_1 */
|
||||||
}
|
}
|
||||||
|
@ -1749,7 +1746,7 @@ static void OnYunhornSTSDurationCheckTimerEvent(void *context)
|
||||||
* @brief Yunhorn STS Occupancy RSS WakeUP timer callback function
|
* @brief Yunhorn STS Occupancy RSS WakeUP timer callback function
|
||||||
* @param context ptr of STS RSS WakeUp context
|
* @param context ptr of STS RSS WakeUp context
|
||||||
*/
|
*/
|
||||||
#if 0
|
|
||||||
static void OnYunhornSTSOORSSWakeUpTimerEvent(void *context)
|
static void OnYunhornSTSOORSSWakeUpTimerEvent(void *context)
|
||||||
{
|
{
|
||||||
#ifdef STS_O6
|
#ifdef STS_O6
|
||||||
|
@ -1757,7 +1754,7 @@ static void OnYunhornSTSOORSSWakeUpTimerEvent(void *context)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
/**
|
/**
|
||||||
* @brief Yunhorn STS Heart beat timer callback function
|
* @brief Yunhorn STS Heart beat timer callback function
|
||||||
* @param context ptr of context
|
* @param context ptr of context
|
||||||
|
@ -1845,7 +1842,6 @@ void OnYunhornSTSHeartBeatPeriodicityChanged(uint32_t periodicity)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* USER CODE BEGIN PrFD_YunhornSTSWakeUpScanTimerEvents */
|
/* USER CODE BEGIN PrFD_YunhornSTSWakeUpScanTimerEvents */
|
||||||
#if 0
|
|
||||||
static void OnYunhornSTSWakeUpScanTimerEvent(void *context)
|
static void OnYunhornSTSWakeUpScanTimerEvent(void *context)
|
||||||
{
|
{
|
||||||
#if defined(STS_P2)||defined(STS_T6)||defined(L8)
|
#if defined(STS_P2)||defined(STS_T6)||defined(L8)
|
||||||
|
@ -1857,7 +1853,6 @@ static void OnYunhornSTSWakeUpScanTimerEvent(void *context)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
void STSWakeupScanTimerStop(void)
|
void STSWakeupScanTimerStop(void)
|
||||||
{
|
{
|
||||||
|
@ -1873,16 +1868,10 @@ void STS_SENSOR_Warm_Up(void)
|
||||||
//UTIL_MEM_cpy_8((uint8_t*)AppData.Buffer, (uint8_t *)YUNHORN_STS_PRD_STRING, sizeof(YUNHORN_STS_PRD_STRING));
|
//UTIL_MEM_cpy_8((uint8_t*)AppData.Buffer, (uint8_t *)YUNHORN_STS_PRD_STRING, sizeof(YUNHORN_STS_PRD_STRING));
|
||||||
AppData.BufferSize = sizeof(AppData.Buffer);
|
AppData.BufferSize = sizeof(AppData.Buffer);
|
||||||
LmHandlerErrorStatus_t status = LmHandlerSend(&AppData, LmHandlerParams.IsTxConfirmed, false);
|
LmHandlerErrorStatus_t status = LmHandlerSend(&AppData, LmHandlerParams.IsTxConfirmed, false);
|
||||||
if (LORAMAC_HANDLER_SUCCESS ==status )
|
|
||||||
{
|
|
||||||
HAL_Delay(3000);
|
HAL_Delay(3000);
|
||||||
status = LmHandlerSend(&AppData, LmHandlerParams.IsTxConfirmed, false);
|
status = LmHandlerSend(&AppData, LmHandlerParams.IsTxConfirmed, false);
|
||||||
}
|
|
||||||
if (LORAMAC_HANDLER_SUCCESS ==status )
|
|
||||||
{
|
|
||||||
HAL_Delay(3000);
|
HAL_Delay(3000);
|
||||||
status = LmHandlerSend(&AppData, LmHandlerParams.IsTxConfirmed, false);
|
status = LmHandlerSend(&AppData, LmHandlerParams.IsTxConfirmed, false);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
void STS_ClockSync_process(void)
|
void STS_ClockSync_process(void)
|
||||||
{
|
{
|
||||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -85,13 +85,8 @@ volatile sts_cfg_nvm_t sts_cfg_nvm = {
|
||||||
sts_mtmcode2,
|
sts_mtmcode2,
|
||||||
sts_version,
|
sts_version,
|
||||||
sts_hardware_ver,
|
sts_hardware_ver,
|
||||||
#if defined(STS_L8)
|
|
||||||
0x0A, //Regular TxPeriodicity interval
|
|
||||||
'S', //Uplink data interval unit, for heart-beat uplink
|
|
||||||
#else
|
|
||||||
0x05, //Regular TxPeriodicity interval
|
0x05, //Regular TxPeriodicity interval
|
||||||
'M', //Uplink data interval unit, for heart-beat uplink
|
'M', //Uplink data interval unit, for heart-beat uplink
|
||||||
#endif
|
|
||||||
#if defined(STS_P2)||defined(L8)||defined(STS_O6T)||defined(STS_T6)
|
#if defined(STS_P2)||defined(L8)||defined(STS_O6T)||defined(STS_T6)
|
||||||
0x01, //Heart-beat interval or Sampling interval
|
0x01, //Heart-beat interval or Sampling interval
|
||||||
'S', //Sampling sensor interval unit, for real-time sensing of MEMS
|
'S', //Sampling sensor interval unit, for real-time sensing of MEMS
|
||||||
|
|
|
@ -159,11 +159,11 @@ void MX_TOF_Init(void)
|
||||||
//STS_TOF_VL53LX_PeopleCounting_Process();
|
//STS_TOF_VL53LX_PeopleCounting_Process();
|
||||||
#ifdef L8
|
#ifdef L8
|
||||||
MX_53L8A1_ThresholdDetection_Init();
|
MX_53L8A1_ThresholdDetection_Init();
|
||||||
//MX_53L8A1_ThresholdDetection_Process();
|
MX_53L8A1_ThresholdDetection_Process();
|
||||||
//STS_FHMOS_sensor_config_init();
|
STS_FHMOS_sensor_config_init();
|
||||||
//sts_high_threshold = sts_cfg_nvm.sensor_install_height_in_10cm ;
|
//sts_high_threshold = sts_cfg_nvm.sensor_install_height_in_10cm ;
|
||||||
//sts_low_threshold = sts_cfg_nvm.sensor_install_height_in_10cm -1400;
|
//sts_low_threshold = sts_cfg_nvm.sensor_install_height_in_10cm -1400;
|
||||||
//STS_TOF_L8_Reconfig();
|
STS_TOF_L8_Reconfig();
|
||||||
|
|
||||||
#elif defined(STS_R1D)
|
#elif defined(STS_R1D)
|
||||||
XWL55_WLE5_53L0X_Init();
|
XWL55_WLE5_53L0X_Init();
|
||||||
|
|
Loading…
Reference in New Issue