fix heart-beat issue
This commit is contained in:
parent
0eee23bc0e
commit
897ba73996
|
@ -32,11 +32,11 @@
|
|||
/*
|
||||
* MCU CORE SELECTION
|
||||
*/
|
||||
//#define USE_STM32WLE5 1U //STM32WLE5CCUX
|
||||
#define USE_STM32WL55 1U //STM32WL55JC1X
|
||||
#ifndef STM32WL55xx
|
||||
#define STM32WL55xx
|
||||
#endif
|
||||
#define USE_STM32WLE5 1U //STM32WLE5CCUX
|
||||
//#define USE_STM32WL55 1U //STM32WL55JC1X
|
||||
//#ifndef STM32WL55xx
|
||||
//#define STM32WL55xx
|
||||
//#endif
|
||||
/*
|
||||
* MODULE SELECTION
|
||||
*/
|
||||
|
@ -174,20 +174,20 @@
|
|||
//#define YUNHORN_STS_E4_LORA_APP_DATA_PORT 70U
|
||||
//#define YUNHORN_STS_E4_LORA_APP_HTBT_PORT 71U
|
||||
|
||||
#define YUNHORN_STS_R0_LORA_APP_DATA_PORT 11U
|
||||
#define YUNHORN_STS_R0_LORA_APP_DATA_PORT 10U
|
||||
#define YUNHORN_STS_R0_LORA_APP_HTBT_PORT 11U
|
||||
#define YUNHORN_STS_R0_USER_APP_CTRL_PORT 2U
|
||||
#define YUNHORN_STS_R0_USER_APP_CTRL_REPLY_PORT 1U
|
||||
|
||||
#define YUNHORN_STS_R1_LORA_APP_DATA_PORT 57U
|
||||
#define YUNHORN_STS_R1_LORA_APP_HTBT_PORT 57U
|
||||
#define YUNHORN_STS_R2_LORA_APP_DATA_PORT 58U
|
||||
#define YUNHORN_STS_R1_LORA_APP_HTBT_PORT 58U
|
||||
#define YUNHORN_STS_R2_LORA_APP_DATA_PORT 57U
|
||||
#define YUNHORN_STS_R2_LORA_APP_HTBT_PORT 58U
|
||||
//#define YUNHORN_STS_R3_LORA_APP_DATA_PORT 7U
|
||||
//#define YUNHORN_STS_R3_LORA_APP_HTBT_PORT 8U
|
||||
//#define YUNHORN_STS_R4_LORA_APP_DATA_PORT 8U
|
||||
//#define YUNHORN_STS_R4_LORA_APP_HTBT_PORT 8U
|
||||
#define YUNHORN_STS_R5_LORA_APP_DATA_PORT 11U
|
||||
#define YUNHORN_STS_R5_LORA_APP_DATA_PORT 10U
|
||||
#define YUNHORN_STS_R5_LORA_APP_HTBT_PORT 11U
|
||||
|
||||
//#define YUNHORN_STS_M1_LORA_APP_DATA_PORT 6U
|
||||
|
@ -239,7 +239,7 @@
|
|||
#define sts_appctrlport (YUNHORN_STS_R0_USER_APP_CTRL_PORT)
|
||||
#define sts_appctrl_reply_port (YUNHORN_STS_R0_USER_APP_CTRL_REPLY_PORT)
|
||||
|
||||
#define NVM_CFG_PARAMETER_SIZE (STS_R0_NVM_CFG_SIZE)
|
||||
//#define NVM_CFG_PARAMETER_SIZE (STS_R0_NVM_CFG_SIZE)
|
||||
#define MEMS_POWER_Pin GPIO_PIN_4 // PMU_ENABLE
|
||||
#define MEMS_POWER_GPIO_Port GPIOB // PMU_ENABLE
|
||||
|
||||
|
@ -249,7 +249,6 @@
|
|||
#ifdef STS_USE_TOF_VL53L0X // RETIRED TODO
|
||||
#define I2C_TIMING_TOF250 0x20303E5D
|
||||
#define I2C_TIMING 0x20303E5D //DEFAULT FOR I2C TOF
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -261,7 +260,7 @@
|
|||
#define CFG_CMD_RSS_FULL_SIZE (STS_O6_CFG_CMD_SIZE)
|
||||
#define CFG_CMD_RSS_SIMPLE_SIZE (STS_O6_CFG_CMD_SHORT_LEN)
|
||||
#define CFG_CMD_MODE_COLOR_LENGTH (STS_MODE_COLOR_CMD_LEN)
|
||||
|
||||
#endif
|
||||
|
||||
#define PRESENCE_SENSOR_SPI_HANDLE hspi1
|
||||
#define PRESENCE_SENSOR_TIM_HANDLE htim2
|
||||
|
@ -286,8 +285,6 @@
|
|||
#define I2C_TIMING_FAST_PLUS_MODE 0x20000209 //FAST PLUS MODE 1000Khz
|
||||
#endif
|
||||
|
||||
#endif /* YUNHORN_STS_O6_ENABLED */
|
||||
|
||||
|
||||
#ifdef YUNHORN_STS_E4_ENABLED
|
||||
//#include "yunhorn_sts_e4_conf.h"
|
||||
|
@ -302,15 +299,11 @@
|
|||
#endif /* YUNHORN_STS_R0_ENABLED */
|
||||
|
||||
#ifdef YUNHORN_STS_M7_ENABLED
|
||||
#define MajorVer 22U
|
||||
#define MinorVer 11U
|
||||
#define SubMinorVer 03U
|
||||
#define FirmwareVersion 3U
|
||||
#define YUNHORN_STS_M7_NVM_CFG_SIZE 3U
|
||||
#define YUNHORN_STS_M7_CFG_CMD_SIZE 9U
|
||||
#define YUNHORN_STS_MAX_NVM_CFG_SIZE 32U
|
||||
|
||||
#include "yunhorn_sts_motion_sensor.h"
|
||||
#include "yunhorn_sts_motion_sensor.h"
|
||||
#define YUNHORN_STS_M7_LORA_APP_DATA_PORT 20U
|
||||
#define YUNHORN_STS_M7_LORA_APP_HTBT_PORT 21U
|
||||
#define YUNHORN_STS_M7_USER_APP_CTRL_PORT 2U
|
||||
|
@ -334,6 +327,7 @@
|
|||
|
||||
#define MOTION_SENSOR_TIM_HANDLE htim2
|
||||
#define MOTION_SENSOR_I2C_HANDLE hi2c1
|
||||
#endif /* YUNHORN_STS_M7_ENABLED */
|
||||
|
||||
#ifdef USE_OLED_SSD1306
|
||||
#define SSD1306_I2C_HANDLE hi2c2
|
||||
|
@ -341,11 +335,10 @@
|
|||
#include "ssd1306_tests.h"
|
||||
#endif
|
||||
|
||||
#endif /* YUNHORN_STS_M7_ENABLED */
|
||||
|
||||
|
||||
#define YUNHORN_STS_DUTY_CYCLE_INTERVAL_ENABLED
|
||||
#ifdef YUNHORN_STS_DUTY_CYCLE_INTERVAL_ENABLED
|
||||
#endif /* YUNHORN_STS_DUTY_CYCLE_INTERVAL_ENABLED */
|
||||
|
||||
|
||||
// YUNHORN_STS_BP (3K,6K,19K)
|
||||
// BATTERY PACK STS_BPER_3K, STS_BPER_6K, STS_BPER_19K
|
||||
|
|
|
@ -121,32 +121,7 @@ enum RSS_CFG_order{
|
|||
RSS_CFG_POWER_MODE
|
||||
};
|
||||
#endif
|
||||
/*
|
||||
LEN= 3
|
||||
YUNHORN_STS_PRD_BOARD_SOFT_RESET=0, //BOARD LEVEL RE_BOOT, REVIVE, 'YZH' : HARDWARE REBOOT
|
||||
YUNHORN_STS_PRD_SENSOR_SELF_TEST, //BOARD LEVEL REPORT VERSION, 'YZS' : SELFT TEST
|
||||
YUNHORN_STS_PRD_LORAWAN_CLASS, //BOARD LEVEL REPORT VERSION, 'YZC' : LORA-WAN CLASS A/B/C
|
||||
|
||||
YUNHORN_STS_PRD_VERSION_REPORT, //BOARD LEVEL REPORT VERSION, 'YVH' : VERSION: FW, HW, SW
|
||||
YUNHORN_STS_PRD_CONFIG_REPORT, //BOARD LEVEL REPORT VERSION, 'YVC' : NVM STORED CONFIG PARAMETER
|
||||
|
||||
STS_SENSOR_CMD_MEMS_POWER_ON_OFF, //Num # MEMS LEVEL POWER ENABLE, 'YO#' : #={1}{2,3..9} POWER ON
|
||||
STS_SENSOR_CMD_MEMS_POWER_ON_OFF, //Num # MEMS LEVEL POWER ENABLE, 'YF#' : #={1}{2,3..9} POWER OFF
|
||||
STS_SENSOR_CMD_MEMS_SOFT_RESET, //Num # MEMS LEVEL SOFT_RESET, 'YH#' : #={1}{,2,3..9} SOFT-RESET
|
||||
|
||||
// LEN = 5
|
||||
YUNHORN_STS_PRD_PERIODICITY_CHANGE, //BOARD LEVEL PERIODICTY CHANGE, 'YD##@' #={0-9} @={S,M,H}
|
||||
|
||||
// LEN >=6
|
||||
YUNHORN_STS_PRD_PERIODICITY_CHANGE, //BOARD LEVEL PERIODICTY CHANGE, 'YP###@' #={0-9} @={S,M,H}
|
||||
// Y P # # # @
|
||||
// # MTM code
|
||||
// # MTM ver
|
||||
// # No. of MEMS
|
||||
// @ Parameter
|
||||
|
||||
// MEMS sensor_control_type
|
||||
*/
|
||||
|
||||
//"P 0 0 "+"1 2 3 1 2 3 1 2 3 1 2"
|
||||
// P
|
||||
// P 1 SENSOR HEAD 0
|
||||
|
@ -264,34 +239,6 @@ typedef struct
|
|||
uint8_t SleepStatus;
|
||||
} STS_PRESENCE_SENSOR_Event_Status_t;
|
||||
|
||||
|
||||
/*
|
||||
#define DEFAULT_PROFILE ACC_SERVICE_PROFILE_4
|
||||
#define DEFAULT_UPDATE_RATE (10)
|
||||
#define DEFAULT_POWER_SAVE_MODE ACC_POWER_SAVE_MODE_ACTIVE
|
||||
#define DEFAULT_SENSOR_ID (1)
|
||||
#define DEFAULT_START_M (0.80f) //default 0.2 unit(meter) [1]
|
||||
#define DEFAULT_LENGTH_M (2.00f) //default 1.0 unit(meter) [2]
|
||||
#define DEFAULT_ZONE_LENGTH (0.4f) //default 0.4 unit(meter)
|
||||
#define DEFAULT_UPDATE_RATE_WAKEUP (2.0f) //default 80 unit(hz)
|
||||
#define DEFAULT_UPDATE_RATE_TRACKING (10.0f) //default 80 unit(hz) [7]
|
||||
#define DEFAULT_UPDATE_RATE_PRESENCE (65.0F) //(65.0f) //default 80 unit(hz)
|
||||
#define DEFAULT_HWAAS (63) //default 10 unit(hz)
|
||||
#define DEFAULT_THRESHOLD (1.5f) //default 1.5 level float [3]
|
||||
|
||||
//acc_detector_presence_configuration_filter_parameters_t
|
||||
#define DEFAULT_INTER_FRAME_DEVIATION_TIME_CONST (0.5f) //default 0.5 unit(seconds) [6]
|
||||
#define DEFAULT_INTER_FRAME_FAST_CUTOFF (10.0f) //default 20.0 unit(hz) [8]
|
||||
#define DEFAULT_INTER_FRAME_SLOW_CUTOFF (0.01f) //(0.01f) 0.2 hz unit(hz) [9]
|
||||
#define DEFAULT_INTRA_FRAME_TIME_CONST (0) //default 0.0 unit(seconds)
|
||||
#define DEFAULT_INTRA_FRAME_WEIGHT (0) //default 0.6
|
||||
#define DEFAULT_OUTPUT_TIME_CONST (0.5f) //default 0.5 unit(seconds) [5]
|
||||
#define DEFAULT_NBR_REMOVED_PC (0) //default 0 int [10]
|
||||
|
||||
#define DEFAULT_DOWNSAMPLING_FACTOR (2) //default 1
|
||||
#define DEFAULT_RECEIVER_GAIN (0.45f) //default 0.9 gain mdB [4]
|
||||
*/
|
||||
|
||||
#ifdef YUNHORN_STS_O6_ENABLED
|
||||
|
||||
typedef struct STS_OO_RSS_SensorTuneDataTypeDef
|
||||
|
@ -567,8 +514,8 @@ typedef struct sts_cfg_nvm {
|
|||
uint8_t hardware_ver;
|
||||
uint8_t periodicity; //count of uplink duty cycle duration high {99}
|
||||
uint8_t unit; // uplink time unit of duty cycle duration, in 'S', 'M','H' seconds, minutes, hours
|
||||
uint8_t sampling; //count of sampling duty cycle duration high {99}
|
||||
uint8_t s_unit; // sampling time unit of duty cycle duration, in 'S', 'M','H' seconds, minutes, hours
|
||||
uint8_t sampling; // heart-beat interval or count of sampling duty cycle duration high {99}
|
||||
uint8_t s_unit; // Heart-beat interval or sampling time unit of duty cycle duration, in 'S', 'M','H' seconds, minutes, hours
|
||||
uint8_t work_mode;
|
||||
uint8_t sts_service_mask;
|
||||
uint8_t reseve01;
|
||||
|
|
|
@ -72,6 +72,20 @@ extern volatile float sts_presence_rss_distance;
|
|||
extern volatile uint8_t sensor_data_ready;
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
// UTIL_SEQ_SetTask((1 << CFG_SEQ_Task_YunhornSTSEventP4), CFG_SEQ_Prio_0);
|
||||
// P1 --- REEDSWITCH, HALL ELEMENT, WATER LEAKAGE
|
||||
// P2 --- SEE ABOVE, RSS PRESENCE
|
||||
// P3 ---- LAMP BAR SCOLLER PROCESS
|
||||
// P4 --- TOF DISTANCE VL53L0X simple distance
|
||||
// P5 --- TOF IN OUT COUNT VL53L3X in out or duration
|
||||
// P6 --- SOAP Level, capacitive measurement
|
||||
// P7 --- UltraSonic, 2nd wave UltraSonic range measure
|
||||
// P8 --- AIR QUALITY AND ODOR LEVEL, SMOKING DETECTION
|
||||
*/
|
||||
|
||||
|
||||
/* USER CODE END Includes */
|
||||
|
||||
/* External variables ---------------------------------------------------------*/
|
||||
|
@ -146,6 +160,10 @@ void STS_YunhornSTSEventRFAC_Process(void)
|
|||
|
||||
}
|
||||
|
||||
/*
|
||||
* STS-P1 --- REEDSWITCH, HALL ELEMENT, WATER LEAKAGE
|
||||
*/
|
||||
|
||||
void STS_YunhornSTSEventP1_Process(void)
|
||||
{
|
||||
#if (defined(YUNHORN_STS_O6_ENABLED) && defined(USE_ACCONEER_A111))
|
||||
|
@ -166,6 +184,10 @@ void STS_YunhornSTSEventP1_Process(void)
|
|||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* STS-P2 --- SEE ABOVE, RSS PRESENCE
|
||||
*/
|
||||
void STS_YunhornSTSEventP2_Process(void)
|
||||
{
|
||||
#if (defined(YUNHORN_STS_O6_ENABLED) && defined(USE_ACCONEER_A111))
|
||||
|
@ -242,13 +264,9 @@ void STS_YunhornSTSEventP3_Process(void)
|
|||
}
|
||||
|
||||
/*
|
||||
* STS P4 Process, STS_CAP_Sensor_Detection Process
|
||||
* STS_CAP_SWITCH(ON) Boost Voltage to 5V, then hold for 1000 ms
|
||||
* HAL_Delay(1000) (ms)
|
||||
* STS_CAP_Read_Data() Read STS_CAP_DATA state
|
||||
* STS_CAP_SWITCH(OFF) Switch Off Boosted Voltage
|
||||
* STS-P4 Detection ToF distance (VL53L0X)
|
||||
*
|
||||
*/
|
||||
//static void OnYunhornSTSSamplingCheckTimerEvent(void *context)
|
||||
void STS_YunhornSTSEventP4_Process(void)
|
||||
{
|
||||
|
||||
|
@ -257,21 +275,24 @@ void STS_YunhornSTSEventP4_Process(void)
|
|||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* STS P5 Process, Detection ToF distance (VL53L0X)
|
||||
* STS P5 Process, Detection ToF IN-OUT PEOPLE COUNT (VL53L3X)
|
||||
*
|
||||
*/
|
||||
|
||||
void STS_YunhornSTSEventP5_Process(void)
|
||||
{
|
||||
APP_LOG(TS_OFF, VLEVEL_L, "\r\n P5 Testing Process\r\n");
|
||||
}
|
||||
|
||||
/*
|
||||
* STS P6 Process, Detection ToF IN-OUT PEOPLE COUNT (VL53L3X)
|
||||
*
|
||||
* STS-P6 --- SOAP Level, capacitive measurement
|
||||
* STS Soap Level Detection Process, STS_CAP_Sensor_Detection Process
|
||||
* STS_CAP_SWITCH(ON) Boost Voltage to 5V, then hold for 1000 ms
|
||||
* HAL_Delay(1000) (ms)
|
||||
* STS_CAP_Read_Data() Read STS_CAP_DATA state
|
||||
* STS_CAP_SWITCH(OFF) Switch Off Boosted Voltage
|
||||
*/
|
||||
|
||||
void STS_YunhornSTSEventP6_Process(void)
|
||||
{
|
||||
APP_LOG(TS_OFF, VLEVEL_L, "\r\n P6 Testing Process\r\n");
|
||||
|
@ -282,7 +303,6 @@ void STS_YunhornSTSEventP6_Process(void)
|
|||
* STS P7 Process, Detection IAQ Sensors
|
||||
* air quality and odor level sensors
|
||||
*/
|
||||
|
||||
void STS_YunhornSTSEventP7_Process(void)
|
||||
{
|
||||
APP_LOG(TS_OFF, VLEVEL_L, "\r\n P7 Testing Process\r\n");
|
||||
|
@ -293,7 +313,6 @@ void STS_YunhornSTSEventP7_Process(void)
|
|||
* STS P8 Process, Detection xxx Sensors
|
||||
* xxx sensors
|
||||
*/
|
||||
|
||||
void STS_YunhornSTSEventP8_Process(void)
|
||||
{
|
||||
APP_LOG(TS_OFF, VLEVEL_L, "\r\n P8 Testing Process\r\n");
|
||||
|
|
|
@ -67,10 +67,10 @@ volatile sts_cfg_nvm_t sts_cfg_nvm = {
|
|||
sts_mtmcode2,
|
||||
sts_version,
|
||||
sts_hardware_ver,
|
||||
0x02,
|
||||
'S', //Upload message interval
|
||||
0x0A,
|
||||
'S', //Sampling sensor interval
|
||||
0x02, //Regular TxPeriodicity interval
|
||||
'M', //unit of Regular TxPeriodicity interval
|
||||
0x0A, //Heart-beat interval or Sampling interval
|
||||
'S', //unit of Heart-beat interval or Sampling interval
|
||||
0x04, // dual mode
|
||||
0x00, // service mask
|
||||
0x00, // reserve01
|
||||
|
@ -330,6 +330,16 @@ static void OnYunhornSTSHeartBeatPeriodicityChanged(uint32_t periodicity);
|
|||
static void OnYunhornSTSHeartBeatTimerEvent(void *context);
|
||||
|
||||
|
||||
/**
|
||||
* @brief Yunhorn STS Uploading Message periodically
|
||||
* @param context ptr of context
|
||||
*/
|
||||
static void OnYunhornSTSUploadingMessageEvent(void *context);
|
||||
|
||||
/**
|
||||
* @brief Yunhorn RFAC Handle process
|
||||
* @param void
|
||||
*/
|
||||
static void STS_YUNHORN_RFAC_HANDLE_PROCESS(void);
|
||||
|
||||
/* USER CODE END PFP */
|
||||
|
@ -444,11 +454,12 @@ static UTIL_TIMER_Object_t YunhornSTSRSSWakeUpTimer;
|
|||
/**
|
||||
* @brief Timer to handle the YunHorn STS Sensor Sampling Process
|
||||
*/
|
||||
// static UTIL_TIMER_Object_t YunhornSTSSamplingCheckTimer;
|
||||
static UTIL_TIMER_Object_t YunhornSTSSamplingCheckTimer;
|
||||
|
||||
/**
|
||||
* @brief Timer to handle the YunHorn STS Sensor Uploading Process
|
||||
*/
|
||||
//static UTIL_TIMER_Object_t YunhornSTSUploadingMessageTimer;
|
||||
static UTIL_TIMER_Object_t YunhornSTSUploadingMessageTimer;
|
||||
|
||||
/**
|
||||
* @brief Timer to handle the YunHorn STS Sensor Heart Beat Process
|
||||
|
@ -601,12 +612,14 @@ void LoRaWAN_Init(void)
|
|||
|
||||
// Heart Beat Timer
|
||||
// FOR Event trigger type sensor, use this as Heart Beat Timer, such as O1/O2/O3/M1
|
||||
#if (defined(YUNHORN_STS_R0_ENABLED))
|
||||
UTIL_TIMER_Create(&YunhornSTSHeartBeatTimer, HeartBeatPeriodicity,
|
||||
UTIL_TIMER_PERIODIC, OnYunhornSTSHeartBeatTimerEvent, NULL);
|
||||
UTIL_TIMER_Start(&YunhornSTSHeartBeatTimer);
|
||||
#if (defined(YUNHORN_STS_R0_ENABLED))
|
||||
UTIL_TIMER_Create(&YunhornSTSHeartBeatTimer, HeartBeatPeriodicity,
|
||||
UTIL_TIMER_PERIODIC, OnYunhornSTSHeartBeatTimerEvent, NULL);
|
||||
UTIL_TIMER_Start(&YunhornSTSHeartBeatTimer);
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/* USER CODE END LoRaWAN_Init_Last */
|
||||
}
|
||||
|
||||
|
@ -781,12 +794,13 @@ static void SendTxData(void)
|
|||
if (heart_beat_timer)
|
||||
{
|
||||
heart_beat_timer = 0;
|
||||
AppData.Port = LORAWAN_USER_APP_PORT+1;
|
||||
AppData.Port = LORAWAN_USER_HTBT_PORT; //LORAWAN_USER_APP_PORT+1;
|
||||
|
||||
} else if (upload_message_timer) //sensor_data_ready)
|
||||
{
|
||||
|
||||
sensor_data_ready =0;
|
||||
upload_message_timer =0;
|
||||
|
||||
AppData.Buffer[i++] = (uint8_t)(r0_data.distance_mm_h); //#05
|
||||
AppData.Buffer[i++] = (uint8_t)(r0_data.distance_mm_l); //#05
|
||||
|
@ -830,7 +844,7 @@ static void OnTxTimerEvent(void *context)
|
|||
/* USER CODE BEGIN OnTxTimerEvent_1 */
|
||||
|
||||
/* USER CODE END OnTxTimerEvent_1 */
|
||||
upload_message_timer =1U;
|
||||
upload_message_timer =1U;
|
||||
UTIL_SEQ_SetTask((1 << CFG_SEQ_Task_LoRaSendOnTxTimerOrButtonEvent), CFG_SEQ_Prio_0);
|
||||
|
||||
/*Wait for next tx slot*/
|
||||
|
@ -1296,43 +1310,38 @@ static void OnYunhornSTSSamplingPeriodicityChanged(uint32_t periodicity)
|
|||
* @brief Yunhorn STS Sensor Uploading Message Event callback function
|
||||
* @param context ptr of STS Uploading Message context
|
||||
*/
|
||||
//static void OnYunhornSTSUploadingMessageEvent(void *context)
|
||||
//{
|
||||
// if (STS_LoRa_WAN_Joined )
|
||||
// {
|
||||
static void OnYunhornSTSUploadingMessageEvent(void *context)
|
||||
{
|
||||
if (STS_LoRa_WAN_Joined )
|
||||
{
|
||||
|
||||
//#ifdef YUNHORN_STS_R0_ENABLED
|
||||
#ifdef YUNHORN_STS_R0_ENABLED
|
||||
|
||||
// heart_beat_timer = 1;
|
||||
// UTIL_SEQ_SetTask((1 << CFG_SEQ_Task_LoRaSendOnTxTimerOrButtonEvent), CFG_SEQ_Prio_0);
|
||||
// UTIL_TIMER_Start(&YunhornSTSUploadingMessageTimer);
|
||||
//#endif
|
||||
// }
|
||||
//}
|
||||
heart_beat_timer = 1;
|
||||
UTIL_SEQ_SetTask((1 << CFG_SEQ_Task_LoRaSendOnTxTimerOrButtonEvent), CFG_SEQ_Prio_0);
|
||||
UTIL_TIMER_Start(&YunhornSTSUploadingMessageTimer);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Yunhorn STS Sensor Sampling Check Timer callback function
|
||||
* @param context ptr of STS Sampling Check context
|
||||
*/
|
||||
/*
|
||||
|
||||
static void OnYunhornSTSSamplingCheckTimerEvent(void *context)
|
||||
{
|
||||
if (STS_LoRa_WAN_Joined )
|
||||
{
|
||||
// P1 --- REEDSWITCH, HALL ELEMENT, WATER LEAKAGE
|
||||
//#ifdef YUNHORN_STS_O6_ENABLED
|
||||
// UTIL_SEQ_SetTask((1 << CFG_SEQ_Task_YunhornSTSEventP1), CFG_SEQ_Prio_0);
|
||||
//#endif
|
||||
#ifdef YUNHORN_STS_R0_ENABLED
|
||||
|
||||
#ifdef YUNHORN_STS_E0_ENABLED
|
||||
|
||||
//upload_message_timer = 1U;
|
||||
upload_message_timer = 1U;
|
||||
UTIL_SEQ_SetTask((1 << CFG_SEQ_Task_YunhornSTSEventP4), CFG_SEQ_Prio_0);
|
||||
UTIL_TIMER_Start(&YunhornSTSSamplingCheckTimer);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @brief Yunhorn STS Sensor Heart Beat Timer callback function
|
||||
|
@ -1353,17 +1362,11 @@ static void OnYunhornSTSHeartBeatTimerEvent(void *context)
|
|||
}
|
||||
UTIL_SEQ_SetTask((1 << CFG_SEQ_Task_YunhornSTSEventRFAC), CFG_SEQ_Prio_0);
|
||||
}
|
||||
|
||||
|
||||
UTIL_TIMER_Start(&YunhornSTSHeartBeatTimer);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
void USER_APP_AUTO_RESPONDER_Parse(char *tlv_buf, size_t tlv_buf_size)
|
||||
{
|
||||
uint8_t i=0, mems_ver, invalid_flag=1;
|
||||
|
@ -2030,9 +2033,9 @@ void STS_REBOOT_CONFIG_Init(void)
|
|||
sts_cfg_nvm.mtmcode2 = (uint8_t)nvm_stored_value[NVM_MTM2];
|
||||
sts_cfg_nvm.version = (uint8_t)nvm_stored_value[NVM_VER];
|
||||
sts_cfg_nvm.hardware_ver = (uint8_t)nvm_stored_value[NVM_HWV];
|
||||
sts_cfg_nvm.periodicity = (uint8_t)(nvm_stored_value[NVM_PERIODICITY]);
|
||||
sts_cfg_nvm.periodicity = (uint8_t)(nvm_stored_value[NVM_PERIODICITY]); //TxPeriodicity interval
|
||||
sts_cfg_nvm.unit = (uint8_t)(nvm_stored_value[NVM_UNIT]);
|
||||
sts_cfg_nvm.sampling = (uint8_t)(nvm_stored_value[NVM_SAMPLING]);
|
||||
sts_cfg_nvm.sampling = (uint8_t)(nvm_stored_value[NVM_SAMPLING]); //Heart-beat or sampling interval
|
||||
sts_cfg_nvm.s_unit = (uint8_t)(nvm_stored_value[NVM_S_UNIT]);
|
||||
sts_cfg_nvm.work_mode = (uint8_t)(nvm_stored_value[NVM_WORK_MODE]);
|
||||
sts_cfg_nvm.sts_service_mask = (uint8_t)(nvm_stored_value[NVM_SERVICE_MASK]);
|
||||
|
@ -2061,7 +2064,7 @@ void STS_REBOOT_CONFIG_Init(void)
|
|||
|
||||
void OnRestoreSTSCFGContextProcess(void)
|
||||
{
|
||||
uint32_t periodicity = (sts_cfg_nvm.periodicity);
|
||||
uint32_t periodicity = (sts_cfg_nvm.periodicity); //TxPeriodicty interval
|
||||
if ((char)sts_cfg_nvm.unit =='M') {
|
||||
periodicity *= 60;
|
||||
} else if ((char) sts_cfg_nvm.unit =='H') {
|
||||
|
@ -2073,7 +2076,7 @@ void OnRestoreSTSCFGContextProcess(void)
|
|||
TxPeriodicity= periodicity*1000; // to ms
|
||||
OnTxPeriodicityChanged(TxPeriodicity); // in msec unit
|
||||
|
||||
uint32_t samplingperiodicity = (sts_cfg_nvm.sampling);
|
||||
uint32_t samplingperiodicity = (sts_cfg_nvm.sampling); //Heart-beat or Sampling interval
|
||||
if ((char)sts_cfg_nvm.s_unit =='M') {
|
||||
samplingperiodicity *= 60;
|
||||
} else if ((char) sts_cfg_nvm.s_unit =='H') {
|
||||
|
@ -2082,8 +2085,15 @@ void OnRestoreSTSCFGContextProcess(void)
|
|||
samplingperiodicity *= 1;
|
||||
}
|
||||
|
||||
//Heart-beat or Sampling interval
|
||||
samplingperiodicity = (samplingperiodicity > 0)? samplingperiodicity : 1; // in seconds unit
|
||||
#ifdef YUNHORN_STS_O6_ENABLED
|
||||
OnYunhornSTSSamplingPeriodicityChanged(samplingperiodicity*1000); // in m-sec unit
|
||||
#endif
|
||||
|
||||
#ifdef YUNHORN_STS_R0_ENABLED
|
||||
OnYunhornSTSHeartBeatPeriodicityChanged(samplingperiodicity*1000);
|
||||
#endif
|
||||
|
||||
sts_work_mode = sts_cfg_nvm.work_mode;
|
||||
sts_service_mask = sts_cfg_nvm.sts_service_mask;
|
||||
|
|
|
@ -59,6 +59,7 @@ extern "C" {
|
|||
*/
|
||||
//#define LORAWAN_USER_APP_PORT 2
|
||||
#define LORAWAN_USER_APP_PORT sts_senddataport
|
||||
#define LORAWAN_USER_HTBT_PORT sts_sendhtbtport
|
||||
#define LORAWAN_USER_APP_CTRL_PORT sts_appctrlport
|
||||
#define LORAWAN_USER_APP_CTRL_REPLY_PORT sts_appctrl_reply_port
|
||||
/*!
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
|
||||
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
|
||||
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
|
||||
<provider class="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" console="false" env-hash="856846852047785661" id="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="MCU ARM GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD "${INPUTS}"" prefer-non-shared="true">
|
||||
<provider class="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" console="false" env-hash="686453894977928153" id="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="MCU ARM GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD "${INPUTS}"" prefer-non-shared="true">
|
||||
<language-scope id="org.eclipse.cdt.core.gcc"/>
|
||||
<language-scope id="org.eclipse.cdt.core.g++"/>
|
||||
</provider>
|
||||
|
@ -16,7 +16,7 @@
|
|||
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
|
||||
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
|
||||
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
|
||||
<provider class="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" console="false" env-hash="856846852047785661" id="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="MCU ARM GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD "${INPUTS}"" prefer-non-shared="true">
|
||||
<provider class="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" console="false" env-hash="686453894977928153" id="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="MCU ARM GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD "${INPUTS}"" prefer-non-shared="true">
|
||||
<language-scope id="org.eclipse.cdt.core.gcc"/>
|
||||
<language-scope id="org.eclipse.cdt.core.g++"/>
|
||||
</provider>
|
||||
|
|
Loading…
Reference in New Issue