Compare commits
13 Commits
Author | SHA1 | Date |
---|---|---|
|
3088ecbee3 | |
|
49daa9bbf7 | |
|
12202479de | |
|
ddd4f3ed02 | |
|
660176b7e3 | |
|
7a29a1f62f | |
|
4db95d2c1d | |
|
a1d434f759 | |
|
9331937dd0 | |
|
3982be3636 | |
|
69de27499f | |
|
6aa58aae81 | |
|
96965f36e0 |
|
@ -58,10 +58,11 @@
|
|||
/*#define YUNHORN_STS_O8_ENABLED */
|
||||
/*#define YUNHORN_STS_O9_ENABLED */
|
||||
/*#define YUNHORN_STS_O10_ENABLED */
|
||||
|
||||
// #define YUNHORN_STS_O6_ENABLED
|
||||
#ifdef STS_O6
|
||||
#define YUNHORN_STS_O6_ENABLED 1U
|
||||
#endif
|
||||
#ifdef STS_O7
|
||||
#define YUNHORN_STS_O7_ENABLED
|
||||
#define YUNHORN_STS_O7_ENABLED 1U
|
||||
#endif
|
||||
/** YUNHORN SMARTOILETS ENVIRONMENT PRODUCTS **/
|
||||
/*#define YUNHORN_STS_E1_ENABLED */
|
||||
|
@ -210,7 +211,7 @@
|
|||
#ifdef YUNHORN_STS_O7_ENABLED
|
||||
#define MajorVer 24U
|
||||
#define MinorVer 05U
|
||||
#define SubMinorVer 12U
|
||||
#define SubMinorVer 30U
|
||||
#define FirmwareVersion 3U
|
||||
|
||||
#define YUNHORN_STS_MAX_NVM_CFG_SIZE 64U
|
||||
|
|
|
@ -91,7 +91,7 @@ void MX_GPIO_Init(void)
|
|||
GPIO_InitStruct.Pin = HALL1_Pin|HALL2_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING_FALLING;
|
||||
GPIO_InitStruct.Pull = GPIO_PULLUP;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
|
||||
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
|
||||
#else
|
||||
/*Configure GPIO pins : PAPin PAPin */
|
||||
|
|
|
@ -67,12 +67,14 @@ extern volatile uint8_t sts_reed_hall_1_result, sts_reed_hall_2_result;
|
|||
extern volatile uint8_t sts_tof_result_changed_flag;
|
||||
|
||||
|
||||
|
||||
extern volatile uint8_t sts_rss_result_changed_flag, sts_hall1_changed_flag, sts_hall2_changed_flag, sts_reed_hall_changed_flag;
|
||||
extern volatile uint8_t sts_reed_hall_1_changed_flag, sts_reed_hall_2_changed_flag;
|
||||
extern volatile uint8_t sts_rss_result_changed_flag, sts_hall_1_changed_flag, sts_hall_2_changed_flag, sts_reed_hall_changed_flag;
|
||||
extern volatile uint8_t sts_rss_result;
|
||||
extern volatile uint8_t sts_rss_2nd_result; //2nd RSS sensor status
|
||||
extern volatile uint8_t sts_tof_result;
|
||||
|
||||
#ifdef STS_M1
|
||||
extern volatile uint8_t sts_water_leakage_changed_flag;
|
||||
#endif
|
||||
//extern volatile uint8_t last_sts_reed_hall_result = 2; //Initial state, not 0, not 1
|
||||
volatile uint8_t last_lamp_bar_color=STS_GREEN;
|
||||
extern volatile uint8_t sts_presence_fall_detection;
|
||||
|
@ -410,11 +412,16 @@ void STS_Combined_Status_Processing(void)
|
|||
|
||||
STS_Lamp_Bar_Refresh();
|
||||
#if 1
|
||||
//if ((sts_rss_result_changed_flag)|| (sts_reed_hall_changed_flag) || (sts_tof_result_changed_flag) || (sts_water_leakage_changed_flag))
|
||||
{
|
||||
|
||||
|
||||
if ((sts_rss_result_changed_flag)|| (sts_reed_hall_1_changed_flag)|| (sts_reed_hall_2_changed_flag) || (sts_tof_result_changed_flag) )
|
||||
//|| (sts_water_leakage_changed_flag))
|
||||
{
|
||||
APP_LOG(TS_OFF, VLEVEL_L, "\r\nRSS result Changed = %d Hall 1 changed = %d Hall 2 changed = %d Sensor Data Ready=%d \r\n", sts_rss_result_changed_flag, sts_reed_hall_1_changed_flag, sts_reed_hall_2_changed_flag, sensor_data_ready);
|
||||
//sts_rss_result_changed_flag =0;
|
||||
sts_reed_hall_changed_flag =0;
|
||||
sts_rss_result_changed_flag =0;
|
||||
sts_reed_hall_1_changed_flag =0;
|
||||
sts_reed_hall_2_changed_flag =0;
|
||||
sts_tof_result_changed_flag =0;
|
||||
#ifdef STS_M1
|
||||
sts_water_leakage_changed_flag=0;
|
||||
|
@ -423,6 +430,7 @@ void STS_Combined_Status_Processing(void)
|
|||
//STS_PRESENCE_SENSOR_Prepare_Send_Data();
|
||||
}
|
||||
#endif
|
||||
APP_LOG(TS_OFF, VLEVEL_L, "\r\nRSS result Changed = %d Hall 1 changed = %d Hall 2 changed = %d Sensor Data Ready=%d \r\n", sts_rss_result_changed_flag, sts_reed_hall_1_changed_flag, sts_reed_hall_2_changed_flag, sensor_data_ready);
|
||||
}
|
||||
|
||||
void HAL_TIM_PWM_PulseFinishedCallback(TIM_HandleTypeDef *htim)
|
||||
|
|
|
@ -409,7 +409,7 @@ int sts_presence_rss_fall_rise_detection(void)
|
|||
APP_LOG(TS_OFF, VLEVEL_H,"First Half Presence Detection, Motion Count = %u \r\n", (int)motion_count);
|
||||
#endif
|
||||
// ******** Second Half detection of fall down and rise up
|
||||
|
||||
if (sts_presence_fall_detection == 1) {
|
||||
set_default_fall_rise_configuration(presence_configuration);
|
||||
|
||||
if (!acc_detector_presence_reconfigure(&handle, presence_configuration))
|
||||
|
@ -428,6 +428,7 @@ int sts_presence_rss_fall_rise_detection(void)
|
|||
return false;
|
||||
}
|
||||
acc_detector_presence_configuration_destroy(&presence_configuration);
|
||||
}
|
||||
// set to full lenght of iteration
|
||||
for (int i = 0; i < (iterations/2); i++)
|
||||
{
|
||||
|
@ -469,14 +470,14 @@ int sts_presence_rss_fall_rise_detection(void)
|
|||
//APP_LOG(TS_OFF, VLEVEL_L,"Second Half, Fall Rise Detection, Motion Count = %u \r\n", (int)motion_count);
|
||||
APP_LOG(TS_OFF, VLEVEL_H,"Fall Rise Detection, Motion Count = %u \r\n", (int)motion_count);
|
||||
|
||||
sts_rss_result = (average_result > 1)? 1: 0;
|
||||
|
||||
sts_rss_result = (average_result > 0)? 1: 0;
|
||||
#if 0
|
||||
APP_LOG(TS_OFF, VLEVEL_H,"Average Motion Result = %u OUTPUT RSS RESULT=%u \r\n", (int)average_result, sts_rss_result);
|
||||
for (k=0; k<10; k++) {
|
||||
if (motion_in_zone[k]>0)
|
||||
APP_LOG(TS_OFF, VLEVEL_L,"\nMotion in Zone %u, Count=%u \r\n", k, motion_in_zone[k]);
|
||||
APP_LOG(TS_OFF, VLEVEL_H,"\nMotion in Zone %u, Count=%u \r\n", k, motion_in_zone[k]);
|
||||
}
|
||||
|
||||
#endif
|
||||
average_distance = (1000.0f*average_distance)/average_result; // in meters
|
||||
average_score = (1000.0f*average_score)/average_result;
|
||||
sts_presence_rss_distance = average_distance;
|
||||
|
@ -593,10 +594,10 @@ void STS_YunhornCheckStandardDeviation(void)
|
|||
#ifdef LOG_RSS
|
||||
APP_LOG(TS_OFF, VLEVEL_L, "\r\n-------------Distance Average =%6u; Variance = %6u ; Standard =%6u \r\n",
|
||||
(int)(average_presence_distance*1000.0f), (int)(variance_presence_distance*1000.0f), (int)(standard_variance_presence_distance*1000.0f));
|
||||
#endif
|
||||
|
||||
APP_LOG(TS_OFF, VLEVEL_M, "-------------Motion Average =%6u; Variance = %6u ; Standard =%6u \r\n",
|
||||
(int)(average_presence_score*1000.0f), (int)(variance_presence_score*1000.0f), (int)(standard_variance_presence_score*1000.0f));
|
||||
#ifdef LOG_RSS
|
||||
|
||||
APP_LOG(TS_OFF, VLEVEL_L, "-------------ROC Dist Average =%6u; Variance = %6u ; Standard =%6u \r\n",
|
||||
(int)(average_roc_distance), (int)(variance_roc_distance), (int)(standard_variance_roc_distance));
|
||||
|
||||
|
@ -614,10 +615,11 @@ void STS_YunhornCheckStandardDeviation(void)
|
|||
(int)(sts_fall_detection_depth_threshold), (int)(sts_fall_rising_pattern_factor2));
|
||||
#endif
|
||||
|
||||
#if 0 //TODO YUNHORN XXX
|
||||
if (standard_variance_presence_score <= DEFAULT_UNCONCIOUS_THRESHOLD) {
|
||||
sts_fall_rising_detected_result = STS_PRESENCE_STAYSTILL;
|
||||
sts_fall_rising_detected_result = STS_PRESENCE_UNCONCIOUS;
|
||||
}
|
||||
|
||||
#endif
|
||||
if ( sts_fall_rising_pattern_factor1 > (uint16_t)sts_fall_detection_acc_threshold)
|
||||
{
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
/* USER CODE BEGIN Includes */
|
||||
extern volatile sts_cfg_nvm_t sts_cfg_nvm;
|
||||
extern volatile uint8_t sts_ac_code[20];
|
||||
volatile uint8_t sts_service_mask;
|
||||
volatile uint8_t sts_service_mask=0;
|
||||
volatile uint32_t rfac_timer;
|
||||
volatile uint8_t sensor_data_ready;
|
||||
|
||||
|
@ -75,6 +75,7 @@ SysTime_t mems_event_time;
|
|||
|
||||
extern volatile uint8_t sts_reed_hall_ext_int;
|
||||
volatile uint8_t sts_occupancy_status;
|
||||
volatile uint8_t sts_reed_hall_1_changed_flag=0, sts_reed_hall_2_changed_flag=0;
|
||||
volatile uint8_t sts_hall1_changed_flag=0, sts_hall2_changed_flag=0, last_sts_hall1_result=0, last_sts_hall2_result=0;
|
||||
volatile uint8_t sts_reed_hall_changed_flag = 0;
|
||||
extern volatile uint8_t sts_reed_hall_result;
|
||||
|
@ -218,11 +219,11 @@ void STS_YunhornSTSEventP1_Process(void)
|
|||
{
|
||||
|
||||
sts_reed_hall_1_result = HALL1_STATE; //sts_hall1_read;
|
||||
sts_reed_hall_1_changed =0;
|
||||
sts_reed_hall_1_changed_flag =(sts_reed_hall_1_result == last_sts_reed_hall_1_result)? 0:1;
|
||||
last_sts_reed_hall_1_result = sts_reed_hall_1_result;
|
||||
|
||||
sts_reed_hall_2_result = HALL2_STATE;// sts_hall2_read;
|
||||
sts_reed_hall_2_changed =0;
|
||||
sts_reed_hall_2_changed_flag =(sts_reed_hall_2_result == last_sts_reed_hall_2_result)? 0:1;
|
||||
last_sts_reed_hall_2_result = sts_reed_hall_2_result;
|
||||
|
||||
STS_Combined_Status_Processing();
|
||||
|
@ -532,27 +533,27 @@ void STS_PRESENCE_SENSOR_Prepare_Send_Data(void)
|
|||
sts_o7_sensorData.state_sensor2_on_off = sts_rss_result;
|
||||
sts_o7_sensorData.state_sensor3_on_off = HALL2_STATE;//sts_hall2_read; //sts_emergency_button_pushed; //sts_hall2_read
|
||||
sts_o7_sensorData.state_sensor4_on_off = sts_rss_2nd_result;
|
||||
APP_LOG(TS_OFF, VLEVEL_M, "\r\nPrepare Upload Message............\r\n");
|
||||
|
||||
if (sts_rss_result == STS_RESULT_MOTION)
|
||||
{
|
||||
APP_LOG(TS_OFF, VLEVEL_M, "\r\n......STS_RESULT MOTION............\r\n");
|
||||
|
||||
sts_o7_sensorData.rss_presence_distance = (uint16_t)(sts_presence_rss_distance)&0xFFFF;
|
||||
sts_o7_sensorData.rss_presence_score = (uint16_t)(sts_presence_rss_score)&0xFFFF;
|
||||
// uint8_t sts_unconcious_state;
|
||||
// uint16_t sts_unconcious_threshold, sts_unconcious_threshold_duration;
|
||||
} else {
|
||||
APP_LOG(TS_OFF, VLEVEL_M, "\r\n......STS_NO MOTION............\r\n");
|
||||
|
||||
sts_o7_sensorData.rss_presence_distance = 0x0;
|
||||
sts_o7_sensorData.rss_presence_score = 0x0;
|
||||
}
|
||||
sts_o7_sensorData.unconcious_state=(sts_fall_rising_detected_result == STS_PRESENCE_UNCONCIOUS)? 1:0;
|
||||
|
||||
sts_o7_sensorData.fall_state = sts_fall_rising_detected_result;
|
||||
|
||||
if (sts_fall_rising_detected_result != STS_PRESENCE_NONE)
|
||||
{
|
||||
#if (defined(STS_O7)&&!defined(STS_O6))
|
||||
APP_LOG(TS_OFF, VLEVEL_M, "\r\n......FALL RISING DETECTION RESULT: %25s............\r\n",sts_presence_fall_detection_message[sts_fall_rising_detected_result] );
|
||||
#endif
|
||||
sts_o7_sensorData.fall_speed = (uint8_t)sts_fall_rising_pattern_factor1;
|
||||
sts_o7_sensorData.fall_gravity = (uint8_t)sts_roc_acc_standard_variance;
|
||||
}
|
||||
|
@ -567,7 +568,7 @@ void STS_PRESENCE_SENSOR_Prepare_Send_Data(void)
|
|||
|
||||
if (check_time_tmp > sts_occupancy_overtime_threshold*60)
|
||||
{
|
||||
APP_LOG(TS_OFF, VLEVEL_M, "\r\n......OVER STAY............\r\n");
|
||||
|
||||
sts_occupancy_overtime_state = 1U;
|
||||
sts_o7_sensorData.overtime = sts_occupancy_overtime_state;
|
||||
sts_o7_sensorData.over_stay_duration = check_time_tmp;
|
||||
|
|
|
@ -597,8 +597,8 @@ void LoRaWAN_Init(void)
|
|||
UTIL_SEQ_RegTask((1 << CFG_SEQ_Task_YunhornSTSEventRFAC), UTIL_SEQ_RFU, STS_YunhornSTSEventRFAC_Process);
|
||||
UTIL_SEQ_RegTask((1 << CFG_SEQ_Task_YunhornSTSEventP1), UTIL_SEQ_RFU, STS_YunhornSTSEventP1_Process);
|
||||
UTIL_SEQ_RegTask((1 << CFG_SEQ_Task_YunhornSTSEventP2), UTIL_SEQ_RFU, STS_YunhornSTSEventP2_Process);
|
||||
#if 1
|
||||
UTIL_SEQ_RegTask((1 << CFG_SEQ_Task_YunhornSTSEventP3), UTIL_SEQ_RFU, STS_YunhornSTSEventP3_Process);
|
||||
#if 0
|
||||
UTIL_SEQ_RegTask((1 << CFG_SEQ_Task_YunhornSTSEventP4), UTIL_SEQ_RFU, STS_YunhornSTSEventP4_Process);
|
||||
UTIL_SEQ_RegTask((1 << CFG_SEQ_Task_YunhornSTSEventP5), UTIL_SEQ_RFU, STS_YunhornSTSEventP5_Process);
|
||||
UTIL_SEQ_RegTask((1 << CFG_SEQ_Task_YunhornSTSEventP6), UTIL_SEQ_RFU, STS_YunhornSTSEventP6_Process);
|
||||
|
@ -637,8 +637,9 @@ void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin)
|
|||
case HALL1_Pin:
|
||||
if (sts_reed_hall_1_changed)
|
||||
{
|
||||
HAL_Delay(250); //de-bouncing
|
||||
sts_hall1_read = HALL1_STATE;
|
||||
sts_reed_hall_1_changed =0;
|
||||
HAL_Delay(50); //de-bouncing
|
||||
//sts_hall1_read = HALL1_STATE;
|
||||
APP_LOG(TS_OFF, VLEVEL_M, "\n\n Door Contact Read = %02x --%20s\r\n", HALL1_STATE, (HALL1_STATE==STS_Status_Door_Close)?"Door Closed":"Door Opened");
|
||||
|
||||
/* Note: when "EventType == TX_ON_TIMER" this GPIO is not initialized */
|
||||
|
@ -648,21 +649,22 @@ void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin)
|
|||
UTIL_SEQ_SetTask((1 << CFG_SEQ_Task_YunhornSTSEventP1), CFG_SEQ_Prio_0);
|
||||
UTIL_SEQ_SetTask((1 << CFG_SEQ_Task_LoRaSendOnTxTimerOrButtonEvent), CFG_SEQ_Prio_0);
|
||||
}
|
||||
//sts_reed_hall_1_changed =0;
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
case HALL2_Pin:
|
||||
if (sts_reed_hall_2_changed)
|
||||
{
|
||||
HAL_Delay(250); //de-bouncing
|
||||
sts_hall2_read = HALL2_STATE;
|
||||
sts_reed_hall_2_changed =0;
|
||||
HAL_Delay(50); //de-bouncing
|
||||
//sts_hall2_read = HALL2_STATE;
|
||||
APP_LOG(TS_OFF, VLEVEL_M, "\n\n SOS Button Read = %02x --%20s\r\n", HALL2_STATE, (HALL2_STATE==STS_Status_SOS_Pushdown)?"SOS Pushdown":"SOS Released");
|
||||
|
||||
//sensor_data_ready =1;
|
||||
UTIL_SEQ_SetTask((1 << CFG_SEQ_Task_YunhornSTSEventP1), CFG_SEQ_Prio_0);
|
||||
UTIL_SEQ_SetTask((1 << CFG_SEQ_Task_LoRaSendOnTxTimerOrButtonEvent), CFG_SEQ_Prio_0);
|
||||
//sts_reed_hall_2_changed =0;
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -807,12 +809,10 @@ static void SendTxData(void)
|
|||
UTIL_TIMER_Time_t nextTxIn = 0;
|
||||
uint8_t i = 0;
|
||||
|
||||
APP_LOG(TS_OFF, VLEVEL_M, "\r\n\n\n SendTxData Enter \r\n\n");
|
||||
|
||||
//if (LmHandlerIsBusy() == false)
|
||||
if (LmHandlerIsBusy() == false)
|
||||
{
|
||||
AppData.Port = LORAWAN_USER_APP_PORT;
|
||||
//AppData.Buffer[i++] = AppLedStateOn; //#01
|
||||
//AppData.Buffer[i++] = AppLedStateOn; //#01
|
||||
STS_PRESENCE_SENSOR_Prepare_Send_Data();
|
||||
|
||||
if ((heart_beat_timer != 0L)) // sensor data OVERWRITE heart-beat message, 2024-05-12
|
||||
|
@ -820,18 +820,12 @@ static void SendTxData(void)
|
|||
heart_beat_timer=0;
|
||||
AppData.Port = sts_sendhtbtport; //LORAWAN_USER_APP_PORT+1;
|
||||
AppData.Buffer[i++]= AppLedStateOn|0x80;
|
||||
AppData.Buffer[i++] = (uint8_t)(99*batteryLevel/254)&0xff; //#05
|
||||
APP_LOG(TS_OFF, VLEVEL_M, "\r\n\n\n SendTxData Enter Heart-Beat \r\n\n");
|
||||
AppData.Buffer[i++] = (uint8_t)(99*batteryLevel/254)&0xff; //#05
|
||||
|
||||
} else if ((upload_message_timer != 0U)||(sensor_data_ready!= 0U)) //sensor_data_ready for manual push button-1 trigger)
|
||||
} else if ((upload_message_timer != 0U)||(sensor_data_ready!= 0U)) //sensor_data_ready for manual push button-1 trigger)
|
||||
{
|
||||
|
||||
APP_LOG(TS_OFF, VLEVEL_M, "\r\n\n\n SendTxData Enter Sensor Data Ready \r\n\n");
|
||||
sensor_data_ready =0;
|
||||
|
||||
|
||||
//AppData.Buffer[i++] = AppLedStateOn;
|
||||
|
||||
//STS_PRESENCE_SENSOR_Prepare_Send_Data();
|
||||
|
||||
AppData.Buffer[i++] = (uint8_t)(sts_o7_sensorData.lamp_bar_color)&0xff; //01
|
||||
|
@ -857,21 +851,23 @@ static void SendTxData(void)
|
|||
#endif
|
||||
#if 1
|
||||
APP_LOG(TS_OFF, VLEVEL_L,
|
||||
"\r\n######| Color | Mode |\r\n######| %4s | %5s |\r\n",(char *)sts_lamp_color_code[(uint8_t)(AppData.Buffer[0])], (char*)sts_work_mode_code[AppData.Buffer[1]]);
|
||||
APP_LOG(TS_OFF, VLEVEL_L,
|
||||
"\r\n######| S1-DoorOpen | S2-Motion | S3-No_Emergency | S4 |Distance(mm) | MotionScore| Unconcious | Over_Stay| Fall Detected|"
|
||||
"\r\n######| %1d | %1d | %1d | %1d | %04d | %04d | %1d | %1d | %1d |\r\n",
|
||||
AppData.Buffer[2], AppData.Buffer[3],AppData.Buffer[4], AppData.Buffer[5],
|
||||
(uint16_t)sts_o7_sensorData.rss_presence_distance,(uint16_t)sts_o7_sensorData.rss_presence_score,
|
||||
sts_o7_sensorData.unconcious_state, sts_o7_sensorData.unconcious_duration, sts_o7_sensorData.fall_state );
|
||||
"\r\n######| Color | Mode |\r\n######| %6s | %5s|\r\n",(char *)sts_lamp_color_code[(uint8_t)(AppData.Buffer[0])], (char*)sts_work_mode_code[AppData.Buffer[1]]);
|
||||
#endif
|
||||
#if 1
|
||||
APP_LOG(TS_OFF, VLEVEL_L,"\r\n######| S1-DoorOpen | S2-Motion | S3-No_Emergency| S4 | Distance(mm) | MotionScore|\r\n######| %6u | %6u | %6u | %6u | %4u | %4u |\r\n",
|
||||
AppData.Buffer[2], AppData.Buffer[3],AppData.Buffer[4],AppData.Buffer[5],AppData.Buffer[6]<<8|AppData.Buffer[7],AppData.Buffer[8]<<8|AppData.Buffer[9]);
|
||||
#endif
|
||||
#if 1
|
||||
APP_LOG(TS_OFF, VLEVEL_L,"\r\n######| Unconcious | Fall state| Over_Stay state| OverStayduration|\r\n######| %1d | %1d | %1d | %4d |\r\n",
|
||||
sts_o7_sensorData.unconcious_state, sts_o7_sensorData.fall_state, sts_o7_sensorData.over_stay_duration, sts_o7_sensorData.unconcious_duration );
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
AppData.BufferSize = (sts_service_mask > STS_SERVICE_MASK_L1? 0:i);
|
||||
|
||||
APP_LOG(TS_OFF, VLEVEL_L, "\r\n\n\n** ** AppData.PORT =%3d ** ** AppData.BufferSize=%3d ** Count Size=%3d\r\n", AppData.Port, AppData.BufferSize, i);
|
||||
//AppData.BufferSize = (sts_service_mask > STS_SERVICE_MASK_L1? 0:i);
|
||||
//AppData.BufferSize = (sts_service_mask > STS_SERVICE_MASK_L1? 0:i);
|
||||
APP_LOG(TS_OFF, VLEVEL_L, "\r\n **************** BufferSize = %d *** Port=%d \r\n", AppData.BufferSize, AppData.Port);
|
||||
|
||||
if ((JoinLedTimer.IsRunning) && (LmHandlerJoinStatus() == LORAMAC_HANDLER_SET))
|
||||
{
|
||||
|
@ -913,14 +909,13 @@ static void OnTxTimerEvent(void *context)
|
|||
|
||||
UTIL_SEQ_SetTask((1 << CFG_SEQ_Task_LoRaSendOnTxTimerOrButtonEvent), CFG_SEQ_Prio_0);
|
||||
|
||||
if (sts_ac_code[0]==0x0) {
|
||||
if ((sts_ac_code[0]==0x0)&&(sts_ac_code[19]==0x0)) {
|
||||
/* RFAC Challenge */
|
||||
if (rfac_timer < (STS_BURN_IN_RFAC+3)) {
|
||||
rfac_timer ++;
|
||||
|
||||
UTIL_SEQ_SetTask((1 << CFG_SEQ_Task_YunhornSTSEventRFAC), CFG_SEQ_Prio_0);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*Wait for next tx slot*/
|
||||
|
@ -1016,6 +1011,7 @@ static void OnJoinRequest(LmHandlerJoinParams_t *joinParams)
|
|||
|
||||
APP_LOG(TS_OFF, VLEVEL_H, "###### U/L FRAME:JOIN | DR:%d | PWR:%d\r\n", joinParams->Datarate, joinParams->TxPower);
|
||||
}
|
||||
heart_beat_timer = 1;
|
||||
UTIL_SEQ_SetTask((1 << CFG_SEQ_Task_LoRaSendOnTxTimerOrButtonEvent), CFG_SEQ_Prio_0);
|
||||
/* USER CODE END OnJoinRequest_1 */
|
||||
}
|
||||
|
@ -1672,7 +1668,7 @@ void USER_APP_AUTO_RESPONDER_Parse(char *tlv_buf, size_t tlv_buf_size)
|
|||
periodicity_length *= 3600;
|
||||
}
|
||||
TxPeriodicity = periodicity_length*1000; //translate to 1000ms=1s
|
||||
HeartBeatPeriodicity = TxPeriodicity;
|
||||
//HeartBeatPeriodicity = TxPeriodicity;
|
||||
|
||||
OnTxPeriodicityChanged(TxPeriodicity);
|
||||
i = 0;
|
||||
|
@ -1829,8 +1825,6 @@ void USER_APP_AUTO_RESPONDER_Parse(char *tlv_buf, size_t tlv_buf_size)
|
|||
STS_Combined_Status_Processing();
|
||||
}
|
||||
|
||||
|
||||
|
||||
} else if (tlv_buf_size == 4 ) // P WORK mode switch
|
||||
{
|
||||
invalid_flag = 0;
|
||||
|
@ -2208,8 +2202,6 @@ void STS_REBOOT_CONFIG_Init(void)
|
|||
|
||||
OnRestoreSTSCFGContextProcess();
|
||||
|
||||
|
||||
|
||||
/* USER CODE END OnRestoreContextRequest_Last */
|
||||
}
|
||||
|
||||
|
@ -2273,7 +2265,6 @@ void OnRestoreSTSCFGContextProcess(void)
|
|||
sts_ac_code[j] = sts_cfg_nvm.ac[j];
|
||||
}
|
||||
|
||||
|
||||
#ifdef YUNHORN_STS_O7_ENABLED
|
||||
if ((sts_version == sts_cfg_nvm.version)&& (NVM_CFG_PARAMETER_SIZE == sts_cfg_nvm.length))
|
||||
{
|
||||
|
|
|
@ -153,6 +153,8 @@
|
|||
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level.1119592399" name="Optimization level" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level" useByScannerDiscovery="false" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level.value.os" valueType="enumerated"/>
|
||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.definedsymbols.2024044405" name="Define symbols (-D)" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.definedsymbols" useByScannerDiscovery="false" valueType="definedSymbols">
|
||||
<listOptionValue builtIn="false" value="CORE_CM4"/>
|
||||
<listOptionValue builtIn="false" value="STS_O7"/>
|
||||
<listOptionValue builtIn="false" value="STS_O6"/>
|
||||
<listOptionValue builtIn="false" value="RM2_1"/>
|
||||
<listOptionValue builtIn="false" value="STS_O7"/>
|
||||
<listOptionValue builtIn="false" value="YUNHORN_STS_RANDOM"/>
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -39,9 +39,11 @@ STS_O7 For Occupancy sensors
|
|||
2024-04-28 restart
|
||||
2024-05-12 good for STS-O2 with 2 reed switches (hall-read-1 for door-contact, hall-read-2 for SOS-emergency button) and rss motion sensor
|
||||
|
||||
2024-05-14 STS_O6
|
||||
|
||||
2024-05-17 STS_O6 For Occupancy sensors without FALL DETECTION
|
||||
|
||||
******************************************************************************
|
||||
|
||||
|
||||
*/
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue