RM2_1 #2
|
@ -89,7 +89,12 @@ enum RSS_CFG_order{
|
|||
#endif
|
||||
|
||||
#if defined(STS_O7)||defined(STS_O6)
|
||||
|
||||
#define STS_RSS_CONFIG_NON 0x00
|
||||
#define STS_RSS_CONFIG_DEFAULT 0x01
|
||||
#define STS_RSS_CONFIG_SIMPLE 0x02
|
||||
#define STS_RSS_CONFIG_FULL 0x04
|
||||
#define STS_RSS_CONFIG_FALL_DETECTION 0x08
|
||||
#if 0
|
||||
enum sts_rss_config_update_t {
|
||||
STS_RSS_CONFIG_NON=0,
|
||||
STS_RSS_CONFIG_DEFAULT,
|
||||
|
@ -97,7 +102,7 @@ enum sts_rss_config_update_t {
|
|||
STS_RSS_CONFIG_FULL,
|
||||
STS_RSS_CONFIG_FALL_DETECTION
|
||||
};
|
||||
|
||||
#endif
|
||||
enum sts_ctrl_cmd_type {
|
||||
STS_CTRL_CMD_TYPE_DUTYCYCLE_LEVEL_CHANGE,
|
||||
STS_CTRL_CMD_MEMS_TUNE_TOF_VL53L0X=0x00,
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
#include "app_lorawan.h"
|
||||
#include "gpio.h"
|
||||
#include "usart.h"
|
||||
#include "stdio.h"
|
||||
/* Private includes ----------------------------------------------------------*/
|
||||
/* USER CODE BEGIN Includes */
|
||||
#include "spi.h"
|
||||
|
@ -91,7 +92,6 @@ int main(void)
|
|||
MX_TIM1_Init();
|
||||
MX_SPI1_Init();
|
||||
/* USER CODE END SysInit */
|
||||
|
||||
/* Initialize all configured peripherals */
|
||||
|
||||
MX_LoRaWAN_Init();
|
||||
|
|
|
@ -262,6 +262,7 @@ static void set_default_fall_rise_configuration(acc_detector_presence_configurat
|
|||
// if detection toggles too often, increase the following, if too sluggish, decrease it instead
|
||||
filter.output_time_const = DEFAULT_OUTPUT_TIME_CONST; //0.0f;
|
||||
acc_detector_presence_configuration_filter_parameters_set(presence_configuration, &filter);
|
||||
|
||||
acc_detector_presence_configuration_nbr_removed_pc_set(presence_configuration, DEFAULT_NBR_REMOVED_PC);
|
||||
acc_detector_presence_configuration_power_save_mode_set(presence_configuration, ACC_POWER_SAVE_MODE_ACTIVE);
|
||||
}
|
||||
|
@ -272,8 +273,9 @@ static void sts_rss_set_current_configuration_full(acc_detector_presence_configu
|
|||
acc_detector_presence_configuration_sensor_set(presence_configuration, DEFAULT_SENSOR_ID);
|
||||
|
||||
// acc_service_profile_t presence_profile = sts_presence_rss_config.default_profile;
|
||||
// acc_detector_presence_configuration_service_profile_set(presence_configuration, presence_profile);
|
||||
// acc_detector_presence_configuration_service_profile_set(presence_configuration, presence_profile); 2024-08-21 update
|
||||
|
||||
acc_detector_presence_configuration_service_profile_set(presence_configuration, sts_presence_rss_config.default_profile);
|
||||
acc_detector_presence_configuration_update_rate_set(presence_configuration, sts_presence_rss_config.default_update_rate_presence); //DEFAULT_UPDATE_RATE_2);
|
||||
acc_detector_presence_configuration_detection_threshold_set(presence_configuration, sts_presence_rss_config.default_threshold);//DEFAULT_DETECTION_THRESHOLD_2);
|
||||
|
||||
|
@ -301,8 +303,9 @@ static void sts_rss_set_current_configuration_full(acc_detector_presence_configu
|
|||
static void sts_rss_set_current_configuration_simple(acc_detector_presence_configuration_t presence_configuration)
|
||||
{
|
||||
acc_detector_presence_configuration_sensor_set(presence_configuration, DEFAULT_SENSOR_ID);
|
||||
acc_detector_presence_configuration_update_rate_set(presence_configuration, DEFAULT_UPDATE_RATE_PRESENCE);
|
||||
//acc_detector_presence_configuration_update_rate_set(presence_configuration, DEFAULT_UPDATE_RATE_PRESENCE); 2024-08-21 update
|
||||
|
||||
acc_detector_presence_configuration_update_rate_set(presence_configuration, sts_presence_rss_config.default_update_rate_presence);
|
||||
acc_detector_presence_configuration_start_set(presence_configuration, sts_presence_rss_config.default_start_m);
|
||||
acc_detector_presence_configuration_length_set(presence_configuration, sts_presence_rss_config.default_length_m); //DEFAULT_LENGTH_M_2);
|
||||
acc_detector_presence_configuration_detection_threshold_set(presence_configuration, sts_presence_rss_config.default_threshold);//DEFAULT_DETECTION_THRESHOLD_2);
|
||||
|
@ -375,6 +378,22 @@ int sts_presence_rss_fall_rise_detection(void)
|
|||
set_default_fall_rise_configuration(presence_configuration);
|
||||
APP_LOG(TS_OFF, VLEVEL_M,"\r\n######### YUNHORN STS *** FALL DETECTION *** cfg applied\n");
|
||||
break;
|
||||
case STS_RSS_CONFIG_DEFAULT|STS_RSS_CONFIG_SIMPLE:
|
||||
set_default_configuration(presence_configuration);
|
||||
sts_rss_set_current_configuration_simple(presence_configuration);
|
||||
break;
|
||||
case STS_RSS_CONFIG_DEFAULT|STS_RSS_CONFIG_FULL:
|
||||
set_default_configuration(presence_configuration);
|
||||
sts_rss_set_current_configuration_full(presence_configuration);
|
||||
break;
|
||||
case STS_RSS_CONFIG_FULL|STS_RSS_CONFIG_FALL_DETECTION:
|
||||
set_default_fall_rise_configuration(presence_configuration);
|
||||
sts_rss_set_current_configuration_full(presence_configuration);
|
||||
break;
|
||||
case STS_RSS_CONFIG_SIMPLE|STS_RSS_CONFIG_FALL_DETECTION:
|
||||
set_default_fall_rise_configuration(presence_configuration);
|
||||
sts_rss_set_current_configuration_simple(presence_configuration);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -275,13 +275,13 @@ void STS_YunhornSTSEventP2_Process(void)
|
|||
{
|
||||
switch (sts_work_mode) {
|
||||
case STS_RSS_MODE:
|
||||
sts_rss_config_updated_flag = STS_RSS_CONFIG_DEFAULT;
|
||||
sts_rss_config_updated_flag |= STS_RSS_CONFIG_DEFAULT;
|
||||
break;
|
||||
case STS_DUAL_MODE:
|
||||
sts_rss_config_updated_flag = STS_RSS_CONFIG_DEFAULT;
|
||||
sts_rss_config_updated_flag |= STS_RSS_CONFIG_DEFAULT;
|
||||
break;
|
||||
case STS_UNI_MODE:
|
||||
sts_rss_config_updated_flag = STS_RSS_CONFIG_FALL_DETECTION;
|
||||
sts_rss_config_updated_flag |= STS_RSS_CONFIG_FALL_DETECTION;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
@ -711,7 +711,7 @@ void STS_PRESENCE_SENSOR_NVM_CFG(void)
|
|||
sts_presence_rss_config.default_downsampling_factor = (float)(sts_cfg_nvm.p[RSS_CFG_DOWNSAMPLING_FACTOR]);
|
||||
sts_presence_rss_config.default_power_save_mode = (float)(sts_cfg_nvm.p[RSS_CFG_POWER_MODE]);
|
||||
|
||||
sts_rss_config_updated_flag = STS_RSS_CONFIG_FULL; //set to 2 for FULL config effect in next detection
|
||||
sts_rss_config_updated_flag = (sts_rss_config_updated_flag|STS_RSS_CONFIG_FULL); //set to 2 for FULL config effect in next detection
|
||||
}
|
||||
|
||||
void STS_PRESENCE_SENSOR_NVM_CFG_SIMPLE(void)
|
||||
|
@ -721,7 +721,7 @@ void STS_PRESENCE_SENSOR_NVM_CFG_SIMPLE(void)
|
|||
sts_presence_rss_config.default_threshold = (float)(sts_cfg_nvm.p[RSS_CFG_THRESHOLD]*0.1f);
|
||||
sts_presence_rss_config.default_receiver_gain = (float)(sts_cfg_nvm.p[RSS_CFG_RECEIVER_GAIN]*0.01f);
|
||||
|
||||
sts_rss_config_updated_flag = STS_RSS_CONFIG_SIMPLE; //set to 1 for simple config effect in next detection
|
||||
sts_rss_config_updated_flag = (sts_rss_config_updated_flag|STS_RSS_CONFIG_SIMPLE); //set to 1 for simple config effect in next detection
|
||||
}
|
||||
|
||||
void STS_PRESENCE_SENSOR_Init_Send_Data(void)
|
||||
|
@ -966,14 +966,14 @@ void STS_PRESENCE_SENSOR_RSS_Init(void)
|
|||
switch (sts_work_mode)
|
||||
{
|
||||
case STS_RSS_MODE:
|
||||
sts_rss_config_updated_flag = STS_RSS_CONFIG_DEFAULT;
|
||||
sts_rss_config_updated_flag |= STS_RSS_CONFIG_DEFAULT;
|
||||
break;
|
||||
case STS_DUAL_MODE:
|
||||
sts_rss_config_updated_flag = STS_RSS_CONFIG_DEFAULT;
|
||||
sts_rss_config_updated_flag |= STS_RSS_CONFIG_DEFAULT;
|
||||
break;
|
||||
|
||||
case STS_UNI_MODE:
|
||||
sts_rss_config_updated_flag = STS_RSS_CONFIG_FALL_DETECTION;
|
||||
sts_rss_config_updated_flag |= STS_RSS_CONFIG_FALL_DETECTION;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
|
|
@ -2553,22 +2553,20 @@ void USER_APP_AUTO_RESPONDER_Parse(char *tlv_buf, uint8_t tlv_buf_size)
|
|||
#if 1
|
||||
for (j =0; j < CFG_CMD_RSS_SIMPLE_SIZE-3; j++)
|
||||
{
|
||||
if ((tlv_buf[CFG_CMD4+j] >='0') && (tlv_buf[CFG_CMD4+j]<='9'))
|
||||
if ((tlv_buf[CFG_CMD4+j] < '0') || (tlv_buf[CFG_CMD4+j] >'9'))
|
||||
{
|
||||
//sts_cfg_nvm.p[j] = (uint8_t)((tlv_buf[CFG_CMD4+j] - 0x30)&0xff);
|
||||
//APP_LOG(TS_OFF,VLEVEL_H,"\r\n tlv_buf %d = %02x cfg->p[%d]=%02x \r\n",j,tlv_buf[CFG_CMD4+j], j, sts_cfg_nvm.p[j]);
|
||||
} else {
|
||||
invalid_flag = 1;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
sts_cfg_nvm.p[RSS_CFG_START_M] = (uint8_t)((tlv_buf[CFG_CMD4] - 0x30)*10+(tlv_buf[CFG_CMD5] - 0x30));
|
||||
sts_cfg_nvm.p[RSS_CFG_LENGTH_M] = (uint8_t)((tlv_buf[CFG_CMD6] - 0x30)*10+(tlv_buf[CFG_CMD7] - 0x30));
|
||||
sts_cfg_nvm.p[RSS_CFG_THRESHOLD] = (uint8_t)((tlv_buf[CFG_CMD8] - 0x30)*10+(tlv_buf[CFG_CMD9] - 0x30));
|
||||
sts_cfg_nvm.p[RSS_CFG_RECEIVER_GAIN] = (uint8_t)((tlv_buf[CFG_CMD10]- 0x30)*10+(tlv_buf[CFG_CMD11]- 0x30));
|
||||
|
||||
if (invalid_flag == 0)
|
||||
{
|
||||
sts_cfg_nvm.p[RSS_CFG_START_M] = (uint8_t)((tlv_buf[CFG_CMD4] - 0x30)*10+(tlv_buf[CFG_CMD5] - 0x30));
|
||||
sts_cfg_nvm.p[RSS_CFG_LENGTH_M] = (uint8_t)((tlv_buf[CFG_CMD6] - 0x30)*10+(tlv_buf[CFG_CMD7] - 0x30));
|
||||
sts_cfg_nvm.p[RSS_CFG_THRESHOLD] = (uint8_t)((tlv_buf[CFG_CMD8] - 0x30)*10+(tlv_buf[CFG_CMD9] - 0x30));
|
||||
sts_cfg_nvm.p[RSS_CFG_RECEIVER_GAIN] = (uint8_t)((tlv_buf[CFG_CMD10]- 0x30)*10+(tlv_buf[CFG_CMD11]- 0x30));
|
||||
|
||||
|
||||
STS_PRESENCE_SENSOR_NVM_CFG_SIMPLE();
|
||||
|
||||
i=0; // Step 1: Prepare status update message
|
||||
|
|
|
@ -10,8 +10,8 @@
|
|||
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.launch.enable_swv" value="false"/>
|
||||
<intAttribute key="com.st.stm32cube.ide.mcu.debug.launch.formatVersion" value="2"/>
|
||||
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.launch.ip_address_local" value="localhost"/>
|
||||
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.launch.limit_swo_clock.enabled" value="false"/>
|
||||
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.launch.limit_swo_clock.value" value=""/>
|
||||
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.launch.limit_swo_clock.enabled" value="true"/>
|
||||
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.launch.limit_swo_clock.value" value="2000000"/>
|
||||
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.launch.loadList" value="{"fItems":[{"fIsFromMainTab":true,"fPath":"Release/STS_O7.elf","fProjectName":"STS_O7","fPerformBuild":true,"fDownload":true,"fLoadSymbols":true}]}"/>
|
||||
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.launch.override_start_address_mode" value="default"/>
|
||||
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.launch.remoteCommand" value="target remote"/>
|
||||
|
@ -20,8 +20,9 @@
|
|||
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.launch.startuptab.exception.unaligned" value="false"/>
|
||||
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.launch.startuptab.haltonexception" value="true"/>
|
||||
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.launch.swd_mode" value="true"/>
|
||||
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.launch.swv_config_enabled" value="true"/>
|
||||
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.launch.swv_port" value="61235"/>
|
||||
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.launch.swv_trace_hclk" value="16000000"/>
|
||||
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.launch.swv_trace_hclk" value="48000000"/>
|
||||
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.launch.useRemoteTarget" value="true"/>
|
||||
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.launch.vector_table" value=""/>
|
||||
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.launch.verify_flash_download" value="true"/>
|
||||
|
@ -41,6 +42,15 @@
|
|||
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.watchdog_config" value="none"/>
|
||||
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.stlinkenable_rtos" value="false"/>
|
||||
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.stlinkrestart_configurations" value="{"fVersion":1,"fItems":[{"fDisplayName":"Reset","fIsSuppressible":false,"fResetAttribute":"Software system reset","fResetStrategies":[{"fDisplayName":"Software system reset","fLaunchAttribute":"system_reset","fGdbCommands":["monitor reset\r\n"],"fCmdOptions":["-g"]},{"fDisplayName":"Hardware reset","fLaunchAttribute":"hardware_reset","fGdbCommands":["monitor reset hardware\r\n"],"fCmdOptions":["-g"]},{"fDisplayName":"Core reset","fLaunchAttribute":"core_reset","fGdbCommands":["monitor reset core\r\n"],"fCmdOptions":["-g"]},{"fDisplayName":"None","fLaunchAttribute":"no_reset","fGdbCommands":[],"fCmdOptions":["-g"]}],"fGdbCommandGroup":{"name":"Additional commands","commands":[]},"fStartApplication":true}]}"/>
|
||||
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.swv.datatrace_0" value="Enabled=false:Address=0x0:Access=Read/Write:Size=Word:Function=Data Value"/>
|
||||
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.swv.datatrace_1" value="Enabled=false:Address=0x0:Access=Read/Write:Size=Word:Function=Data Value"/>
|
||||
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.swv.datatrace_2" value="Enabled=false:Address=0x0:Access=Read/Write:Size=Word:Function=Data Value"/>
|
||||
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.swv.datatrace_3" value="Enabled=false:Address=0x0:Access=Read/Write:Size=Word:Function=Data Value"/>
|
||||
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.swv.itmports" value="1:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0"/>
|
||||
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.swv.itmports_priv" value="0:0:0:0"/>
|
||||
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.swv.pc_sample" value="0:16384"/>
|
||||
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.swv.timestamps" value="1:1"/>
|
||||
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.swv.trace_events" value="Cpi=0:Exc=0:Sleep=0:Lsu=0:Fold=0:Exetrc=0"/>
|
||||
<booleanAttribute key="com.st.stm32cube.ide.mcu.rtosproxy.enableRtosProxy" value="false"/>
|
||||
<stringAttribute key="com.st.stm32cube.ide.mcu.rtosproxy.rtosProxyCustomProperties" value=""/>
|
||||
<stringAttribute key="com.st.stm32cube.ide.mcu.rtosproxy.rtosProxyDriver" value="threadx"/>
|
||||
|
|
Loading…
Reference in New Issue