1. re-detect sensor position for every ranging no matter power on-off

2. set i2c speed to standard mode 100k instead of fast mode 400k for
   longer cable support
This commit is contained in:
Yunhorn 2023-10-31 21:09:42 +08:00
parent b96a4ea9f8
commit fdb7fddf61
3 changed files with 7 additions and 3 deletions

View File

@ -44,7 +44,7 @@ void MX_I2C2_Init(void)
/* USER CODE END I2C2_Init 1 */
hi2c2.Instance = I2C2;
hi2c2.Init.Timing = 0x2010091A; //0x2010091A = 400K Fast Mode, 0x20303E5D, 100K Standard mode, 0x20000209 Fast Mode Plus, 1Mbps
hi2c2.Init.Timing = 0x20303E5D; //0x2010091A = 400K Fast Mode, 0x20303E5D, 100K Standard mode, 0x20000209 Fast Mode Plus, 1Mbps
hi2c2.Init.OwnAddress1 = 0;
hi2c2.Init.AddressingMode = I2C_ADDRESSINGMODE_7BIT;
hi2c2.Init.DualAddressMode = I2C_DUALADDRESS_DISABLE;

View File

@ -12,7 +12,7 @@
<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=""/>
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.launch.loadList" value="{&quot;fItems&quot;:[{&quot;fIsFromMainTab&quot;:true,&quot;fPath&quot;:&quot;D:\\ONEDRIVE\\STM32WLV13\\Projects\\NUCLEO-WL55JC\\Applications\\LoRaWAN\\STS_RR_R125\\STM32CubeIDE\\Release\\STS_RR_R125_ROCTEC20231030.hex&quot;,&quot;fProjectName&quot;:&quot;STS_RR_R125&quot;,&quot;fPerformBuild&quot;:true,&quot;fDownload&quot;:true,&quot;fLoadSymbols&quot;:true}]}"/>
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.launch.loadList" value="{&quot;fItems&quot;:[{&quot;fIsFromMainTab&quot;:true,&quot;fPath&quot;:&quot;D:\\ONEDRIVE\\STM32WLV13\\Projects\\NUCLEO-WL55JC\\Applications\\LoRaWAN\\STS_RR_R125\\STM32CubeIDE\\Release\\STS_RR_R125.elf&quot;,&quot;fProjectName&quot;:&quot;STS_RR_R125&quot;,&quot;fPerformBuild&quot;:true,&quot;fDownload&quot;:true,&quot;fLoadSymbols&quot;: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"/>
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.launch.startServer" value="true"/>
@ -67,7 +67,7 @@
<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_START_MODE" value="remote"/>
<booleanAttribute key="org.eclipse.cdt.launch.DEBUGGER_STOP_AT_MAIN" value="true"/>
<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_STOP_AT_MAIN_SYMBOL" value="main"/>
<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_NAME" value="D:\ONEDRIVE\STM32WLV13\Projects\NUCLEO-WL55JC\Applications\LoRaWAN\STS_RR_R125\STM32CubeIDE\Release\STS_RR_R125_ROCTEC20231030.hex"/>
<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_NAME" value="D:\ONEDRIVE\STM32WLV13\Projects\NUCLEO-WL55JC\Applications\LoRaWAN\STS_RR_R125\STM32CubeIDE\Release\STS_RR_R125.elf"/>
<stringAttribute key="org.eclipse.cdt.launch.PROJECT_ATTR" value="STS_RR_R125"/>
<booleanAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_AUTO_ATTR" value="false"/>
<stringAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_ID_ATTR" value=""/>

View File

@ -411,6 +411,10 @@ void STS_TOF_VL53L0X_Range_Process(void)
}
} // nSensorPresent >0
// reset for next ranging
nDevMask = 0;
nSensorPresent = 0;
}