From a0f8dfca972665823ab6dbc26e5cf2d5258c18d2 Mon Sep 17 00:00:00 2001 From: YunHorn Technology Date: Mon, 8 Apr 2024 15:40:33 +0800 Subject: [PATCH] port to 19, STS O7 instead of O6 --- Core/Inc/yunhorn_sts_prd_conf.h | 44 ++++----- Core/Inc/yunhorn_sts_sensors.h | 10 +-- Core/Src/yunhorn_sts_presence_rss.c | 2 +- Core/Src/yunhorn_sts_presence_sensor.c | 118 ++++++++++++------------- LoRaWAN/App/lora_app.c | 22 ++--- 5 files changed, 98 insertions(+), 98 deletions(-) diff --git a/Core/Inc/yunhorn_sts_prd_conf.h b/Core/Inc/yunhorn_sts_prd_conf.h index 78860cf..438c1b3 100644 --- a/Core/Inc/yunhorn_sts_prd_conf.h +++ b/Core/Inc/yunhorn_sts_prd_conf.h @@ -59,8 +59,8 @@ /*#define YUNHORN_STS_O9_ENABLED */ /*#define YUNHORN_STS_O10_ENABLED */ - #define YUNHORN_STS_O6_ENABLED - +// #define YUNHORN_STS_O6_ENABLED +#define YUNHORN_STS_O7_ENABLED /** YUNHORN SMARTOILETS ENVIRONMENT PRODUCTS **/ /*#define YUNHORN_STS_E1_ENABLED */ /*#define YUNHORN_STS_E2_ENABLED */ @@ -155,10 +155,10 @@ //#define YUNHORN_STS_O5_LORA_APP_DATA_PORT 4U //#define YUNHORN_STS_O5_LORA_APP_HTBT_PORT 5U -#define YUNHORN_STS_O6_LORA_APP_DATA_PORT 17U -#define YUNHORN_STS_O6_LORA_APP_HTBT_PORT 18U -#define YUNHORN_STS_O6_USER_APP_CTRL_PORT 2U -#define YUNHORN_STS_O6_USER_APP_CTRL_REPLY_PORT 1U +#define YUNHORN_STS_O7_LORA_APP_DATA_PORT 19U +#define YUNHORN_STS_O7_LORA_APP_HTBT_PORT 20U +#define YUNHORN_STS_O7_USER_APP_CTRL_PORT 2U +#define YUNHORN_STS_O7_USER_APP_CTRL_REPLY_PORT 1U //#define YUNHORN_STS_E1_LORA_APP_DATA_PORT 102U //#define YUNHORN_STS_E1_LORA_APP_HTBT_PORT 103U @@ -205,19 +205,19 @@ //#define YUNHORN_STS_M10_LORA_APP_HTBT_PORT 9U -#ifdef YUNHORN_STS_O6_ENABLED -#define MajorVer 23U -#define MinorVer 07U -#define SubMinorVer 03U +#ifdef YUNHORN_STS_O7_ENABLED +#define MajorVer 24U +#define MinorVer 04U +#define SubMinorVer 8U #define FirmwareVersion 3U #define YUNHORN_STS_MAX_NVM_CFG_SIZE 64U #define YUNHORN_STS_AC_CODE_SIZE 20U -#define STS_O6_NVM_CFG_SIZE 32U -#define STS_O6_CFG_PCFG_SIZE 28U -#define STS_O6_CFG_CMD_SIZE 30U -#define STS_O6_CFG_CMD_SHORT_LEN 8U +#define STS_O7_NVM_CFG_SIZE 32U +#define STS_O7_CFG_PCFG_SIZE 28U +#define STS_O7_CFG_CMD_SIZE 30U +#define STS_O7_CFG_CMD_SHORT_LEN 8U #define STS_MODE_COLOR_CMD_LEN 5U #define sts_mtmcode1 0U @@ -225,14 +225,14 @@ #define sts_version 1U #define sts_hardware_ver 1U -#define sts_senddataport (YUNHORN_STS_O6_LORA_APP_DATA_PORT) -#define sts_sendhtbtport (YUNHORN_STS_O6_LORA_APP_HTBT_PORT) -#define sts_appctrlport (YUNHORN_STS_O6_USER_APP_CTRL_PORT) -#define sts_appctrl_reply_port (YUNHORN_STS_O6_USER_APP_CTRL_REPLY_PORT) +#define sts_senddataport (YUNHORN_STS_O7_LORA_APP_DATA_PORT) +#define sts_sendhtbtport (YUNHORN_STS_O7_LORA_APP_HTBT_PORT) +#define sts_appctrlport (YUNHORN_STS_O7_USER_APP_CTRL_PORT) +#define sts_appctrl_reply_port (YUNHORN_STS_O7_USER_APP_CTRL_REPLY_PORT) -#define NVM_CFG_PARAMETER_SIZE (STS_O6_NVM_CFG_SIZE) -#define CFG_CMD_RSS_FULL_SIZE (STS_O6_CFG_CMD_SIZE) -#define CFG_CMD_RSS_SIMPLE_SIZE (STS_O6_CFG_CMD_SHORT_LEN) +#define NVM_CFG_PARAMETER_SIZE (STS_O7_NVM_CFG_SIZE) +#define CFG_CMD_RSS_FULL_SIZE (STS_O7_CFG_CMD_SIZE) +#define CFG_CMD_RSS_SIMPLE_SIZE (STS_O7_CFG_CMD_SHORT_LEN) #define CFG_CMD_MODE_COLOR_LENGTH (STS_MODE_COLOR_CMD_LEN) #define MEMS_POWER_Pin GPIO_PIN_4 // PMU_ENABLE @@ -269,7 +269,7 @@ #define I2C_TIMING_FAST_PLUS_MODE 0x20000209 //FAST PLUS MODE 1000Khz #endif -#endif /* YUNHORN_STS_O6_ENABLED */ +#endif /* YUNHORN_STS_O7_ENABLED */ #ifdef YUNHORN_STS_E4_ENABLED diff --git a/Core/Inc/yunhorn_sts_sensors.h b/Core/Inc/yunhorn_sts_sensors.h index 42d5edd..de4ea83 100644 --- a/Core/Inc/yunhorn_sts_sensors.h +++ b/Core/Inc/yunhorn_sts_sensors.h @@ -39,7 +39,7 @@ extern "C" { * Sensor data parameters */ -#if (defined(YUNHORN_STS_M7_ENABLED) || defined(YUNHORN_STS_O6_ENABLED)) +#if (defined(YUNHORN_STS_M7_ENABLED) || defined(YUNHORN_STS_O7_ENABLED)) enum cfg_cmd_order{ CFG_CMD1=0, //'Y' CFG_CMD2, //'D' 'Z' 'V' 'O' 'F' 'H' 'M' @@ -86,7 +86,7 @@ enum RSS_CFG_order{ #endif -#ifdef YUNHORN_STS_O6_ENABLED +#ifdef YUNHORN_STS_O7_ENABLED enum sts_rss_config_t { STS_RSS_CONFIG_DEFAULT=0, @@ -158,7 +158,7 @@ typedef struct } STS_R0_SensorDataTypeDef; #endif -#if (defined(YUNHORN_STS_O0_ENABLED) || defined(YUNHORN_STS_O1_ENABLED) || defined(YUNHORN_STS_O2_ENABLED) || defined(YUNHORN_STS_O3_ENABLED) || defined(YUNHORN_STS_O4_ENABLED) || defined(YUNHORN_STS_O5_ENABLED)|| defined(YUNHORN_STS_O6_ENABLED)) +//#if (defined(YUNHORN_STS_O0_ENABLED) || defined(YUNHORN_STS_O1_ENABLED) || defined(YUNHORN_STS_O2_ENABLED) || defined(YUNHORN_STS_O3_ENABLED) || defined(YUNHORN_STS_O4_ENABLED) || defined(YUNHORN_STS_O5_ENABLED)|| defined(YUNHORN_STS_O6_ENABLED)) typedef struct STS_OO_SensorStatusDataTypeDef { uint8_t lamp_bar_color; /*measured color ID, 0,1,2,3,4,5,6,7,8,9 */ @@ -179,7 +179,7 @@ typedef struct STS_OO_SensorStatusDataTypeDef uint32_t event_start_time; uint32_t event_stop_time; } STS_OO_SensorStatusDataTypeDef; -#endif +//#endif enum sts_presence_fall_detection_type { @@ -547,7 +547,7 @@ typedef struct sts_cfg_nvm { uint8_t sts_service_mask; uint8_t reseve01; uint8_t length; // length of following parameters except AC CODE(20bytes) - uint8_t p[STS_O6_CFG_PCFG_SIZE]; + uint8_t p[STS_O7_CFG_PCFG_SIZE]; uint8_t fall_detection_acc_threshold; // 0 - 9: 0:disable: 1-9 accelaration mg/s2 uint8_t fall_detection_depth_threshold; // 0 - 9: 0:disable: 1-9 fall down depth * 10 cm uint8_t fall_detection_reserve; diff --git a/Core/Src/yunhorn_sts_presence_rss.c b/Core/Src/yunhorn_sts_presence_rss.c index 7b6057f..0250d25 100644 --- a/Core/Src/yunhorn_sts_presence_rss.c +++ b/Core/Src/yunhorn_sts_presence_rss.c @@ -128,7 +128,7 @@ extern volatile uint8_t sts_presence_fall_detection; /* Private function prototypes -----------------------------------------------*/ /* USER CODE BEGIN PFP */ -#if (defined(YUNHORN_STS_O6_ENABLED) && defined(USE_ACCONEER_A111)) +#if (defined(YUNHORN_STS_O7_ENABLED) && defined(USE_ACCONEER_A111)) #endif diff --git a/Core/Src/yunhorn_sts_presence_sensor.c b/Core/Src/yunhorn_sts_presence_sensor.c index 46a6477..d6310ea 100644 --- a/Core/Src/yunhorn_sts_presence_sensor.c +++ b/Core/Src/yunhorn_sts_presence_sensor.c @@ -34,12 +34,12 @@ #include "yunhorn_sts_sensors.h" #include "sts_cmox_hmac_sha.h" /* USER CODE BEGIN Includes */ -#if (defined(YUNHORN_STS_O6_ENABLED) && defined(USE_ACCONEER_A111)) +#if (defined(YUNHORN_STS_O7_ENABLED) && defined(USE_ACCONEER_A111)) //#include "yunhorn_sts_rss_sensor.h" extern volatile uint8_t sts_ac_code[20]; volatile uint32_t rfac_timer; -volatile STS_OO_SensorStatusDataTypeDef sts_o6_sensorData; -volatile STS_PRESENCE_SENSOR_Event_Status_t sts_o6_event_status; +volatile STS_OO_SensorStatusDataTypeDef sts_o7_sensorData; +volatile STS_PRESENCE_SENSOR_Event_Status_t sts_o7_event_status; volatile float sts_distance_rss_distance; extern volatile float sts_presence_rss_distance, sts_presence_rss_score; volatile uint8_t sts_rss_config_updated_flag = 0; @@ -89,7 +89,7 @@ SysTime_t mems_event_time; /* Private function prototypes -----------------------------------------------*/ /* USER CODE BEGIN PFP */ -#if (defined(YUNHORN_STS_O6_ENABLED) && defined(USE_ACCONEER_A111)) +#if (defined(YUNHORN_STS_O7_ENABLED) && defined(USE_ACCONEER_A111)) #endif @@ -120,7 +120,7 @@ void STS_YunhornSTSEventRFAC_Process(void) { APP_LOG(TS_OFF, VLEVEL_H, "\r\n -------------------RFAC Process\r\n"); //STS_SENSOR_Upload_Message(LORAWAN_USER_APP_CTRL_REPLY_PORT, 4, "RFAC"); - STS_SENSOR_Upload_Message(YUNHORN_STS_O6_USER_APP_CTRL_REPLY_PORT, 4, "RFAC"); + STS_SENSOR_Upload_Message(YUNHORN_STS_O7_USER_APP_CTRL_REPLY_PORT, 4, "RFAC"); } if ((rfac_timer > (STS_BURN_IN_RFAC + 2))) { @@ -238,71 +238,71 @@ void STS_PRESENCE_SENSOR_NVM_CFG_SIMPLE(void) void STS_PRESENCE_SENSOR_Init_Send_Data(void) { - sts_o6_sensorData.lamp_bar_color = STS_GREEN; - sts_o6_sensorData.workmode = STS_DUAL_MODE; + sts_o7_sensorData.lamp_bar_color = STS_GREEN; + sts_o7_sensorData.workmode = STS_DUAL_MODE; - sts_o6_sensorData.state_sensor1_on_off = 0x0; - sts_o6_sensorData.state_sensor2_on_off = 0x0; - sts_o6_sensorData.state_sensor3_on_off = 0x0; - sts_o6_sensorData.state_sensor4_on_off = 0x0; - sts_o6_sensorData.rss_presence_distance = 0x0; - sts_o6_sensorData.rss_presence_score = 0x0; - sts_o6_sensorData.fall_state = STS_PRESENCE_NONE; - sts_o6_sensorData.fall_speed = 0x0; - sts_o6_sensorData.fall_gravity = 0x0; - sts_o6_sensorData.event_start_time = 0x0; - sts_o6_sensorData.event_stop_time = 0x0; - sts_o6_sensorData.overtime = 0x0; + sts_o7_sensorData.state_sensor1_on_off = 0x0; + sts_o7_sensorData.state_sensor2_on_off = 0x0; + sts_o7_sensorData.state_sensor3_on_off = 0x0; + sts_o7_sensorData.state_sensor4_on_off = 0x0; + sts_o7_sensorData.rss_presence_distance = 0x0; + sts_o7_sensorData.rss_presence_score = 0x0; + sts_o7_sensorData.fall_state = STS_PRESENCE_NONE; + sts_o7_sensorData.fall_speed = 0x0; + sts_o7_sensorData.fall_gravity = 0x0; + sts_o7_sensorData.event_start_time = 0x0; + sts_o7_sensorData.event_stop_time = 0x0; + sts_o7_sensorData.overtime = 0x0; - sts_o6_sensorData.battery_Pct = 99; // 99% as init value - sts_o6_sensorData.dutycycletimelevel = 1; + sts_o7_sensorData.battery_Pct = 99; // 99% as init value + sts_o7_sensorData.dutycycletimelevel = 1; sensor_data_ready = 0; } void STS_PRESENCE_SENSOR_Prepare_Send_Data(void) { - sts_o6_sensorData.lamp_bar_color = sts_lamp_bar_color; - sts_o6_sensorData.workmode = sts_work_mode; - sts_o6_sensorData.state_sensor1_on_off = ((STS_Reed_Hall_State == STS_Status_Door_Open)? 0U:1U); - sts_o6_sensorData.state_sensor2_on_off = sts_rss_result; - sts_o6_sensorData.state_sensor3_on_off = sts_tof_result; - sts_o6_sensorData.state_sensor4_on_off = sts_rss_2nd_result; + sts_o7_sensorData.lamp_bar_color = sts_lamp_bar_color; + sts_o7_sensorData.workmode = sts_work_mode; + sts_o7_sensorData.state_sensor1_on_off = ((STS_Reed_Hall_State == STS_Status_Door_Open)? 0U:1U); + sts_o7_sensorData.state_sensor2_on_off = sts_rss_result; + sts_o7_sensorData.state_sensor3_on_off = sts_tof_result; + sts_o7_sensorData.state_sensor4_on_off = sts_rss_2nd_result; if (sts_rss_result == STS_RESULT_MOTION) { - sts_o6_sensorData.rss_presence_distance = (uint16_t)(sts_presence_rss_distance)&0xFFFF; - sts_o6_sensorData.rss_presence_score = (uint16_t)(sts_presence_rss_score)&0xFFFF; + 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; } else { - sts_o6_sensorData.rss_presence_distance = 0x0; - sts_o6_sensorData.rss_presence_score = 0x0; + sts_o7_sensorData.rss_presence_distance = 0x0; + sts_o7_sensorData.rss_presence_score = 0x0; } - sts_o6_sensorData.fall_state = sts_fall_rising_detected_result; + sts_o7_sensorData.fall_state = sts_fall_rising_detected_result; if (sts_fall_rising_detected_result != STS_PRESENCE_NONE) { - sts_o6_sensorData.fall_speed = (uint8_t)sts_fall_rising_pattern_factor1; - sts_o6_sensorData.fall_gravity = (uint8_t)sts_roc_acc_standard_variance; + sts_o7_sensorData.fall_speed = (uint8_t)sts_fall_rising_pattern_factor1; + sts_o7_sensorData.fall_gravity = (uint8_t)sts_roc_acc_standard_variance; } - sts_o6_sensorData.overtime = (event_stop_time - event_start_time)> (sts_occupancy_overtime_threshold*60)? 1:0; - sts_o6_sensorData.event_start_time = event_start_time; - sts_o6_sensorData.event_stop_time = event_stop_time; + sts_o7_sensorData.overtime = (event_stop_time - event_start_time)> (sts_occupancy_overtime_threshold*60)? 1:0; + sts_o7_sensorData.event_start_time = event_start_time; + sts_o7_sensorData.event_stop_time = event_stop_time; } void STS_PRESENCE_SENSOR_Read(STS_OO_SensorStatusDataTypeDef *o6_data) { - o6_data->lamp_bar_color = (uint8_t)sts_o6_sensorData.lamp_bar_color; - o6_data->workmode = (uint8_t)sts_o6_sensorData.workmode; + o6_data->lamp_bar_color = (uint8_t)sts_o7_sensorData.lamp_bar_color; + o6_data->workmode = (uint8_t)sts_o7_sensorData.workmode; - o6_data->state_sensor1_on_off = (uint8_t)sts_o6_sensorData.state_sensor1_on_off; - o6_data->state_sensor2_on_off = (uint8_t)sts_o6_sensorData.state_sensor2_on_off; - o6_data->state_sensor3_on_off = (uint8_t)sts_o6_sensorData.state_sensor3_on_off; - o6_data->state_sensor4_on_off = (uint8_t)sts_o6_sensorData.state_sensor4_on_off; - o6_data->rss_presence_distance = (uint16_t)sts_o6_sensorData.rss_presence_distance; - o6_data->rss_presence_score = (uint16_t)sts_o6_sensorData.rss_presence_score; - o6_data->event_start_time = (uint32_t)sts_o6_sensorData.event_start_time; - o6_data->event_stop_time = (uint32_t)sts_o6_sensorData.event_stop_time; - o6_data->overtime = (uint8_t)sts_o6_sensorData.overtime; + o6_data->state_sensor1_on_off = (uint8_t)sts_o7_sensorData.state_sensor1_on_off; + o6_data->state_sensor2_on_off = (uint8_t)sts_o7_sensorData.state_sensor2_on_off; + o6_data->state_sensor3_on_off = (uint8_t)sts_o7_sensorData.state_sensor3_on_off; + o6_data->state_sensor4_on_off = (uint8_t)sts_o7_sensorData.state_sensor4_on_off; + o6_data->rss_presence_distance = (uint16_t)sts_o7_sensorData.rss_presence_distance; + o6_data->rss_presence_score = (uint16_t)sts_o7_sensorData.rss_presence_score; + o6_data->event_start_time = (uint32_t)sts_o7_sensorData.event_start_time; + o6_data->event_stop_time = (uint32_t)sts_o7_sensorData.event_stop_time; + o6_data->overtime = (uint8_t)sts_o7_sensorData.overtime; - o6_data->battery_Pct = (uint8_t)sts_o6_sensorData.battery_Pct; - o6_data->dutycycletimelevel = (uint8_t)sts_o6_sensorData.dutycycletimelevel; + o6_data->battery_Pct = (uint8_t)sts_o7_sensorData.battery_Pct; + o6_data->dutycycletimelevel = (uint8_t)sts_o7_sensorData.dutycycletimelevel; } @@ -334,12 +334,12 @@ void STS_PRESENCE_SENSOR_Init(void) { APP_LOG(TS_ON, VLEVEL_M, "##### YunHorn SmarToilets(r) Presence Sensor Started\r\n"); - sts_o6_sensorData.workmode = (uint8_t)STS_DUAL_MODE; - sts_o6_sensorData.lamp_bar_color = (uint8_t)STS_GREEN; - sts_o6_sensorData.battery_Pct = 99; - sts_o6_sensorData.dutycycletimelevel = 1; - sts_o6_sensorData.event_start_time = 0; - sts_o6_sensorData.event_stop_time = 0; + sts_o7_sensorData.workmode = (uint8_t)STS_DUAL_MODE; + sts_o7_sensorData.lamp_bar_color = (uint8_t)STS_GREEN; + sts_o7_sensorData.battery_Pct = 99; + sts_o7_sensorData.dutycycletimelevel = 1; + sts_o7_sensorData.event_start_time = 0; + sts_o7_sensorData.event_stop_time = 0; STS_SENSOR_Power_ON(0); STS_PRESENCE_SENSOR_REEDSWITCH_HALL_Init(); @@ -496,7 +496,7 @@ void STS_SENSOR_Power_ON(uint8_t cnt) #ifdef YUNHORN_STS_M7_ENABLED HAL_GPIO_WritePin(MEMS_POWER_GPIO_Port, MEMS_POWER_Pin, GPIO_PIN_SET); #endif -#ifdef YUNHORN_STS_O6_ENABLED +#ifdef YUNHORN_STS_O7_ENABLED HAL_GPIO_WritePin(MEMS_POWER_GPIO_Port, MEMS_POWER_Pin, GPIO_PIN_SET); #endif break; @@ -514,7 +514,7 @@ void STS_SENSOR_Power_OFF(uint8_t cnt) #ifdef YUNHORN_STS_M7_ENABLED HAL_GPIO_WritePin(MEMS_POWER_GPIO_Port, MEMS_POWER_Pin, GPIO_PIN_RESET); #endif -#ifdef YUNHORN_STS_O6_ENABLED +#ifdef YUNHORN_STS_O7_ENABLED HAL_GPIO_WritePin(MEMS_POWER_GPIO_Port, MEMS_POWER_Pin, GPIO_PIN_RESET); #endif break; @@ -532,7 +532,7 @@ void STS_SENSOR_MEMS_Reset(uint8_t cnt) #ifdef YUNHORN_STS_M7_ENABLED HAL_GPIO_WritePin(MEMS_RESET_GPIO_Port, MEMS_RESET_Pin, GPIO_PIN_SET); #endif -#ifdef YUNHORN_STS_O6_ENABLED +#ifdef YUNHORN_STS_O7_ENABLED HAL_GPIO_WritePin(MEMS_RESET_GPIO_Port, MEMS_RESET_Pin, GPIO_PIN_RESET); HAL_Delay(100); HAL_GPIO_WritePin(MEMS_RESET_GPIO_Port, MEMS_RESET_Pin, GPIO_PIN_SET); diff --git a/LoRaWAN/App/lora_app.c b/LoRaWAN/App/lora_app.c index e5c9da0..86503ff 100644 --- a/LoRaWAN/App/lora_app.c +++ b/LoRaWAN/App/lora_app.c @@ -115,9 +115,9 @@ volatile sts_cfg_nvm_t sts_cfg_nvm = { {0x0,0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0,0x0} }; -#ifdef YUNHORN_STS_O6_ENABLED +#ifdef YUNHORN_STS_O7_ENABLED extern volatile uint8_t sensor_data_ready; -extern volatile STS_OO_SensorStatusDataTypeDef sts_o6_sensorData; +extern volatile STS_OO_SensorStatusDataTypeDef sts_o7_sensorData; extern volatile float sts_distance_rss_distance; volatile uint8_t sts_presence_fall_detection; @@ -553,7 +553,7 @@ void LoRaWAN_Init(void) UTIL_SEQ_RegTask((1 << CFG_SEQ_Task_YunhornSTSEventP7), UTIL_SEQ_RFU, STS_YunhornSTSEventP7_Process); UTIL_SEQ_RegTask((1 << CFG_SEQ_Task_YunhornSTSEventP8), UTIL_SEQ_RFU, STS_YunhornSTSEventP8_Process); -#ifdef YUNHORN_STS_O6_ENABLED +#ifdef YUNHORN_STS_O7_ENABLED UTIL_TIMER_Create(&YunhornSTSRSSWakeUpTimer, YUNHORN_STS_RSS_WAKEUP_CHECK_TIME, UTIL_TIMER_PERIODIC, OnYunhornSTSOORSSWakeUpTimerEvent, NULL); @@ -1301,7 +1301,7 @@ static void OnYunhornSTSSamplingPeriodicityChanged(uint32_t periodicity) /* Update timer periodicity */ -#ifdef YUNHORN_STS_O6_ENABLED +#ifdef YUNHORN_STS_O7_ENABLED UTIL_TIMER_Stop(&YunhornSTSRSSWakeUpTimer); UTIL_TIMER_SetPeriod(&YunhornSTSRSSWakeUpTimer, SamplingPeriodicity); UTIL_TIMER_Start(&YunhornSTSRSSWakeUpTimer); @@ -2021,8 +2021,8 @@ void OnStoreSTSCFGContextRequest(void) /* USER CODE BEGIN OnStoreContextRequest_1 */ uint8_t i=0, j=0, nvm_store_value[YUNHORN_STS_MAX_NVM_CFG_SIZE]=""; -#ifdef YUNHORN_STS_O6_ENABLED - sts_cfg_nvm.length = STS_O6_NVM_CFG_SIZE; +#ifdef YUNHORN_STS_O7_ENABLED + sts_cfg_nvm.length = STS_O7_NVM_CFG_SIZE; nvm_store_value[i++] = sts_cfg_nvm.mtmcode1; nvm_store_value[i++] = sts_cfg_nvm.mtmcode2; nvm_store_value[i++] = sts_cfg_nvm.version; @@ -2034,9 +2034,9 @@ void OnStoreSTSCFGContextRequest(void) nvm_store_value[i++] = sts_cfg_nvm.work_mode; nvm_store_value[i++] = sts_cfg_nvm.sts_service_mask; nvm_store_value[i++] = sts_cfg_nvm.reseve01; - nvm_store_value[i++] = (uint8_t) STS_O6_NVM_CFG_SIZE; //sts_cfg_nvm.length; + nvm_store_value[i++] = (uint8_t) STS_O7_NVM_CFG_SIZE; //sts_cfg_nvm.length; - for (j = 0; j < STS_O6_CFG_PCFG_SIZE; j++) { + for (j = 0; j < STS_O7_CFG_PCFG_SIZE; j++) { nvm_store_value[i++] = (sts_cfg_nvm.p[j]); } @@ -2092,7 +2092,7 @@ void STS_REBOOT_CONFIG_Init(void) UTIL_MEM_cpy_8(nvm_stored_value, (void *)STS_CONFIG_NVM_BASE_ADDRESS, YUNHORN_STS_MAX_NVM_CFG_SIZE); /* USER CODE BEGIN OnRestoreContextRequest_Last */ -#ifdef YUNHORN_STS_O6_ENABLED +#ifdef YUNHORN_STS_O7_ENABLED if ((nvm_stored_value[NVM_MTM1] != sts_mtmcode1) || (nvm_stored_value[NVM_MTM2] != sts_mtmcode2) || (nvm_stored_value[NVM_VER] != sts_version)) { APP_LOG(TS_OFF, VLEVEL_M, "Initial Boot with Empty Config, Flash with default config....\r\n"); @@ -2178,7 +2178,7 @@ void OnRestoreSTSCFGContextProcess(void) } -#ifdef YUNHORN_STS_O6_ENABLED +#ifdef YUNHORN_STS_O7_ENABLED if ((sts_version == sts_cfg_nvm.version)&& (NVM_CFG_PARAMETER_SIZE == sts_cfg_nvm.length)) { STS_PRESENCE_SENSOR_Init(); @@ -2220,7 +2220,7 @@ void STS_SENSOR_Function_Test_Process(void) else { tstbuf[i++] = (uint8_t)14; //length of following data - #ifdef YUNHORN_STS_O6_ENABLED + #ifdef YUNHORN_STS_O7_ENABLED uint8_t self_test_result[10]={0,0,0,0,0, 0,0,0,0,0}; STS_PRESENCE_SENSOR_Function_Test_Process(self_test_result, count);