---- revised for reboot issue..not yet
This commit is contained in:
parent
be38c056a8
commit
f49d4afb24
|
@ -265,8 +265,8 @@
|
|||
#define sts_sendhtbtport (YUNHORN_STS_O6_LORA_APP_HTBT_PORT)
|
||||
#endif
|
||||
#ifdef STS_O7
|
||||
#define sts_senddataport (YUNHORN_STS_O6_LORA_APP_DATA_PORT)
|
||||
#define sts_sendhtbtport (YUNHORN_STS_O6_LORA_APP_HTBT_PORT)
|
||||
#define sts_senddataport (YUNHORN_STS_O7_LORA_APP_DATA_PORT)
|
||||
#define sts_sendhtbtport (YUNHORN_STS_O7_LORA_APP_HTBT_PORT)
|
||||
#endif
|
||||
#if defined(STS_O6)||defined(STS_O7)
|
||||
#define sts_appctrlport (YUNHORN_STS_O7_USER_APP_CTRL_PORT)
|
||||
|
|
|
@ -319,7 +319,9 @@ static void print_result(acc_detector_presence_result_t result)
|
|||
{
|
||||
if (result.presence_detected)
|
||||
{
|
||||
uint32_t detected_zone = (uint32_t)((float)(result.presence_distance - DEFAULT_START_M) / (float)DEFAULT_ZONE_LENGTH);
|
||||
//uint32_t detected_zone = (uint32_t)((float)(result.presence_distance - DEFAULT_START_M) / (float)DEFAULT_ZONE_LENGTH);
|
||||
// 2024-08-05
|
||||
uint32_t detected_zone = (uint32_t)((float)(result.presence_distance) / (float)DEFAULT_ZONE_LENGTH);
|
||||
APP_LOG(TS_OFF, VLEVEL_H,"Motion in zone: %u, distance: %d, score: %d\n", (unsigned int)detected_zone,
|
||||
(int)(result.presence_distance * 1000.0f),
|
||||
(int)(result.presence_score * 1000.0f));
|
||||
|
@ -418,15 +420,18 @@ int sts_presence_rss_fall_rise_detection(void)
|
|||
break;
|
||||
}
|
||||
|
||||
print_result(result);
|
||||
//print_result(result);
|
||||
if (!result.data_saturated)
|
||||
{
|
||||
if (result.presence_detected)
|
||||
{
|
||||
print_result(result);
|
||||
average_result++;
|
||||
average_distance += result.presence_distance;
|
||||
average_score += result.presence_score;
|
||||
detected_zone = (uint16_t)((float)(result.presence_distance - DEFAULT_START_M) / (float)DEFAULT_ZONE_LENGTH);
|
||||
//detected_zone = (uint16_t)((float)(result.presence_distance - DEFAULT_START_M) / (float)DEFAULT_ZONE_LENGTH);
|
||||
//2024-08-05
|
||||
detected_zone = (uint16_t)((float)(result.presence_distance) / (float)DEFAULT_ZONE_LENGTH);
|
||||
motion_in_zone[detected_zone]++;
|
||||
// new add 2024-06-18
|
||||
//detected_hs_zone = (uint16_t)((float)(sts_sensor_install_height/1000.0f - (result.presence_distance))/(float)DEFAULT_ZONE_LENGTH);
|
||||
|
@ -489,15 +494,18 @@ int sts_presence_rss_fall_rise_detection(void)
|
|||
break;
|
||||
}
|
||||
|
||||
print_result(result);
|
||||
//print_result(result);
|
||||
if (!result.data_saturated)
|
||||
{
|
||||
if (result.presence_detected)
|
||||
{
|
||||
print_result(result);
|
||||
average_result++;
|
||||
average_distance += result.presence_distance;
|
||||
average_score += result.presence_score;
|
||||
detected_zone = (uint16_t)((float)(result.presence_distance - DEFAULT_START_M) / (float)DEFAULT_ZONE_LENGTH);
|
||||
//detected_zone = (uint16_t)((float)(result.presence_distance - DEFAULT_START_M) / (float)DEFAULT_ZONE_LENGTH);
|
||||
// 2024-08-05
|
||||
detected_zone = (uint16_t)((float)(result.presence_distance) / (float)DEFAULT_ZONE_LENGTH);
|
||||
motion_in_zone[detected_zone]++;
|
||||
// new add 2024-06-18
|
||||
|
||||
|
@ -530,7 +538,7 @@ 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);
|
||||
|
||||
//uint8_t thiscnt= motion_detected_count;
|
||||
uint8_t thiscnt= motion_detected_count;
|
||||
|
||||
if (motion_detected_count++ == 10) {
|
||||
motion_detected_count=0;
|
||||
|
@ -562,7 +570,7 @@ int sts_presence_rss_fall_rise_detection(void)
|
|||
|
||||
|
||||
|
||||
#ifdef LOG_RSS
|
||||
//#ifdef LOG_RSS
|
||||
APP_LOG(TS_OFF, VLEVEL_L,"\r\nSensor at Ceiling Height: %4u mm\r\n",(int)sts_sensor_install_height);
|
||||
|
||||
for (uint8_t k=0; k<12; k++) {
|
||||
|
@ -575,7 +583,7 @@ int sts_presence_rss_fall_rise_detection(void)
|
|||
APP_LOG(TS_OFF, VLEVEL_L,"\r\nMotion Distance Zone: %2u %4s", k, " ");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
//#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;
|
||||
|
@ -701,10 +709,10 @@ void STS_YunhornCheckStandardDeviation(void)
|
|||
APP_LOG(TS_OFF, VLEVEL_L, "\r\n---Sensor Install Height=%6u-----Distance Average =%6u; Variance = %6u ; Standard =%6u \r\n",
|
||||
(int)sts_sensor_install_height, (int)(average_presence_distance*1000.0f), (int)(variance_presence_distance*1000.0f), (int)(standard_variance_presence_distance*1000.0f));
|
||||
#endif
|
||||
#ifdef LOG_RSS
|
||||
//#ifdef LOG_RSS
|
||||
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));
|
||||
#endif
|
||||
//#endif
|
||||
#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));
|
||||
|
|
|
@ -39,6 +39,8 @@
|
|||
extern volatile sts_cfg_nvm_t sts_cfg_nvm;
|
||||
|
||||
extern volatile uint8_t sts_ac_code[20];
|
||||
volatile uint8_t sts_work_mode = STS_UNI_MODE;
|
||||
#if 0
|
||||
#if defined(STS_O7)
|
||||
volatile uint8_t sts_work_mode = STS_UNI_MODE;
|
||||
#elif defined(STS_O6)
|
||||
|
@ -46,7 +48,7 @@ volatile uint8_t sts_work_mode = STS_DUAL_MODE;
|
|||
#elif defined(STS_O2)
|
||||
volatile uint8_t sts_work_mode = STS_RSS_MODE;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
volatile uint8_t sts_service_mask=0;
|
||||
volatile uint32_t rfac_timer;
|
||||
volatile uint8_t sensor_data_ready=0;
|
||||
|
|
|
@ -2376,7 +2376,7 @@ void USER_APP_AUTO_RESPONDER_Parse(char *tlv_buf, uint8_t tlv_buf_size)
|
|||
STS_Combined_Status_Processing();
|
||||
HAL_Delay(2000);
|
||||
|
||||
OnSystemReset();
|
||||
//OnSystemReset();
|
||||
|
||||
} else {
|
||||
invalid_flag = 1;
|
||||
|
@ -2611,7 +2611,7 @@ 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.sts_ioc_mask;
|
||||
nvm_store_value[i++] = (uint8_t) STS_O7_NVM_CFG_SIZE; //sts_cfg_nvm.length;
|
||||
nvm_store_value[i++] = sts_cfg_nvm.length; //(uint8_t) STS_O7_NVM_CFG_SIZE; //sts_cfg_nvm.length;
|
||||
|
||||
for (j = 0; j < STS_O7_CFG_PCFG_SIZE; j++) {
|
||||
nvm_store_value[i++] = (sts_cfg_nvm.p[j]);
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
</tool>
|
||||
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.185590387" name="MCU GCC Compiler" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler">
|
||||
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.debuglevel.996713053" name="Debug level" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.debuglevel" useByScannerDiscovery="false" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.debuglevel.value.g3" valueType="enumerated"/>
|
||||
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level.1022522097" 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.og" valueType="enumerated"/>
|
||||
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level.1022522097" 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.2089215826" 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"/>
|
||||
|
@ -137,7 +137,8 @@
|
|||
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.nanoscanffloat.1874218879" name="Use float with scanf from newlib-nano (-u _scanf_float)" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.nanoscanffloat" useByScannerDiscovery="false" value="false" valueType="boolean"/>
|
||||
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.nanoprintffloat.1776401448" name="Use float with printf from newlib-nano (-u _printf_float)" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.nanoprintffloat" useByScannerDiscovery="false" value="true" valueType="boolean"/>
|
||||
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.convertbinary.639397767" name="Convert to binary file (-O binary)" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.convertbinary" useByScannerDiscovery="false" value="true" valueType="boolean"/>
|
||||
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.converthex.2096511505" name="Convert to Intel Hex file (-O ihex)" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.converthex" useByScannerDiscovery="false" value="true" valueType="boolean"/>
|
||||
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.converthex.2096511505" name="Convert to Intel Hex file (-O ihex)" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.converthex" useByScannerDiscovery="false" value="false" valueType="boolean"/>
|
||||
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.listfile.769752034" name="Generate list file" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.listfile" useByScannerDiscovery="false" value="false" valueType="boolean"/>
|
||||
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.targetplatform.504306143" isAbstract="false" osList="all" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.targetplatform"/>
|
||||
<builder buildPath="${workspace_loc:/LoRaWAN_End_Node}/Release" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.builder.820311016" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" parallelBuildOn="true" parallelizationNumber="optimal" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.builder"/>
|
||||
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.1121803732" name="MCU GCC Assembler" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler">
|
||||
|
@ -207,6 +208,7 @@
|
|||
<listOptionValue builtIn="false" value="-Xlinker -no-enum-size-warning"/>
|
||||
<listOptionValue builtIn="false" value="-z noexecstack"/>
|
||||
</option>
|
||||
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.linker.option.uselinkergroup.144730019" name="Place libraries in a linker group (-Wl,--start-group $(LIBS) -Wl,--end-group)" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.linker.option.uselinkergroup" value="true" valueType="boolean"/>
|
||||
<inputType id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.linker.input.715223353" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.linker.input">
|
||||
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
|
||||
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
|
||||
|
|
|
@ -56,12 +56,6 @@ STS_O7.map \
|
|||
SIZE_OUTPUT += \
|
||||
default.size.stdout \
|
||||
|
||||
OBJDUMP_LIST += \
|
||||
STS_O7.list \
|
||||
|
||||
OBJCOPY_HEX += \
|
||||
STS_O7.hex \
|
||||
|
||||
OBJCOPY_BIN += \
|
||||
STS_O7.bin \
|
||||
|
||||
|
@ -74,7 +68,7 @@ main-build: STS_O7.elf secondary-outputs
|
|||
|
||||
# Tool invocations
|
||||
STS_O7.elf STS_O7.map: $(OBJS) $(USER_OBJS) D:\ONEDRIVE\STM32WLV13\Projects\NUCLEO-WL55JC\Applications\LoRaWAN\YUNHORN_STS_E5CC_AS923_POC\STM32CubeIDE\STM32WLE5CCUX_FLASH.ld makefile objects.list $(OPTIONAL_TOOL_DEPS)
|
||||
arm-none-eabi-gcc -o "STS_O7.elf" @"objects.list" $(USER_OBJS) $(LIBS) -mcpu=cortex-m4 -T"D:\ONEDRIVE\STM32WLV13\Projects\NUCLEO-WL55JC\Applications\LoRaWAN\YUNHORN_STS_E5CC_AS923_POC\STM32CubeIDE\STM32WLE5CCUX_FLASH.ld" --specs=nosys.specs -Wl,-Map="STS_O7.map" -Wl,--gc-sections -static -L"D:\ONEDRIVE\STM32WLV13\Projects\NUCLEO-WL55JC\Applications\LoRaWAN\STS_O7\STM32CubeIDE\rss\lib" -L../../../../../../../Middlewares/ST/STM32_Cryptographic/lib -Xlinker -no-enum-size-warning -z noexecstack --specs=nano.specs -mfloat-abi=soft -mthumb -u _printf_float -Wl,--start-group -lc -lm -Wl,--end-group
|
||||
arm-none-eabi-gcc -o "STS_O7.elf" @"objects.list" $(USER_OBJS) -Wl,--start-group $(LIBS) -Wl,--end-group -mcpu=cortex-m4 -T"D:\ONEDRIVE\STM32WLV13\Projects\NUCLEO-WL55JC\Applications\LoRaWAN\YUNHORN_STS_E5CC_AS923_POC\STM32CubeIDE\STM32WLE5CCUX_FLASH.ld" --specs=nosys.specs -Wl,-Map="STS_O7.map" -Wl,--gc-sections -static -L"D:\ONEDRIVE\STM32WLV13\Projects\NUCLEO-WL55JC\Applications\LoRaWAN\STS_O7\STM32CubeIDE\rss\lib" -L../../../../../../../Middlewares/ST/STM32_Cryptographic/lib -Xlinker -no-enum-size-warning -z noexecstack --specs=nano.specs -mfloat-abi=soft -mthumb -u _printf_float -Wl,--start-group -lc -lm -Wl,--end-group
|
||||
@echo 'Finished building target: $@'
|
||||
@echo ' '
|
||||
|
||||
|
@ -83,16 +77,6 @@ default.size.stdout: $(EXECUTABLES) makefile objects.list $(OPTIONAL_TOOL_DEPS)
|
|||
@echo 'Finished building: $@'
|
||||
@echo ' '
|
||||
|
||||
STS_O7.list: $(EXECUTABLES) makefile objects.list $(OPTIONAL_TOOL_DEPS)
|
||||
arm-none-eabi-objdump -h -S $(EXECUTABLES) > "STS_O7.list"
|
||||
@echo 'Finished building: $@'
|
||||
@echo ' '
|
||||
|
||||
STS_O7.hex: $(EXECUTABLES) makefile objects.list $(OPTIONAL_TOOL_DEPS)
|
||||
arm-none-eabi-objcopy -O ihex $(EXECUTABLES) "STS_O7.hex"
|
||||
@echo 'Finished building: $@'
|
||||
@echo ' '
|
||||
|
||||
STS_O7.bin: $(EXECUTABLES) makefile objects.list $(OPTIONAL_TOOL_DEPS)
|
||||
arm-none-eabi-objcopy -O binary $(EXECUTABLES) "STS_O7.bin"
|
||||
@echo 'Finished building: $@'
|
||||
|
@ -100,10 +84,10 @@ STS_O7.bin: $(EXECUTABLES) makefile objects.list $(OPTIONAL_TOOL_DEPS)
|
|||
|
||||
# Other Targets
|
||||
clean:
|
||||
-$(RM) STS_O7.bin STS_O7.elf STS_O7.hex STS_O7.list STS_O7.map default.size.stdout
|
||||
-$(RM) STS_O7.bin STS_O7.elf STS_O7.map default.size.stdout
|
||||
-@echo ' '
|
||||
|
||||
secondary-outputs: $(SIZE_OUTPUT) $(OBJDUMP_LIST) $(OBJCOPY_HEX) $(OBJCOPY_BIN)
|
||||
secondary-outputs: $(SIZE_OUTPUT) $(OBJCOPY_BIN)
|
||||
|
||||
fail-specified-linker-script-missing:
|
||||
@echo 'Error: Cannot find the specified linker script. Check the linker settings in the build configuration.'
|
||||
|
|
Loading…
Reference in New Issue