fix confirmed message issue

This commit is contained in:
Yunhorn 2024-12-04 15:55:44 +08:00
parent cd2c39e7f0
commit ff61a5e2b7
9 changed files with 35 additions and 15 deletions

View File

@ -47,12 +47,12 @@ extern "C" {
/**
* @brief Verbose level for all trace logs
*/
#define VERBOSE_LEVEL VLEVEL_M
#define VERBOSE_LEVEL VLEVEL_OFF
/**
* @brief Enable trace logs
*/
#define APP_LOG_ENABLED 1
#define APP_LOG_ENABLED 0
/**
* @brief Activate monitoring (probes) of some internal RF signals for debug purpose
@ -75,13 +75,13 @@ extern "C" {
* @brief Enable/Disable MCU Debugger pins (dbg serial wires)
* @note by HW serial wires are ON by default, need to put them OFF to save power
*/
#define DEBUGGER_ENABLED 1
#define DEBUGGER_ENABLED 0
/**
* @brief Disable Low Power mode
* @note 0: LowPowerMode enabled. MCU enters stop2 mode, 1: LowPowerMode disabled. MCU enters sleep mode only
*/
#define LOW_POWER_DISABLE 1
#define LOW_POWER_DISABLE 0
/* USER CODE BEGIN EC */

View File

@ -102,7 +102,7 @@ int main(void)
/* Initialize all configured peripherals */
MX_GPIO_Init();
#if 0
#if 1
if(__HAL_PWR_GET_FLAG(PWR_FLAG_SB) != RESET)
{
__HAL_PWR_CLEAR_FLAG(PWR_FLAG_SB);

View File

@ -79,21 +79,31 @@ const struct UTIL_LPM_Driver_s UTIL_PowerDriver =
void PWR_EnterOffMode(void)
{
/* USER CODE BEGIN EnterOffMode_1 */
HAL_GPIO_DeInit(GPIOA,GPIO_PIN_All);
HAL_GPIO_DeInit(GPIOB,GPIO_PIN_All);
HAL_GPIO_DeInit(GPIOC,GPIO_PIN_All);
HAL_SuspendTick();
LL_PWR_ClearFlag_C1STOP_C1STB();
HAL_PWR_EnterSTANDBYMode();
/* USER CODE END EnterOffMode_1 */
}
void PWR_ExitOffMode(void)
{
/* USER CODE BEGIN ExitOffMode_1 */
HAL_ResumeTick();
return;
/* USER CODE END ExitOffMode_1 */
}
void PWR_EnterStopMode(void)
{
/* USER CODE BEGIN EnterStopMode_1 */
PME_OFF;
HAL_GPIO_DeInit(GPIOA,GPIO_PIN_All);
HAL_GPIO_DeInit(GPIOB,GPIO_PIN_All);
HAL_GPIO_DeInit(GPIOC,GPIO_PIN_All);
/* USER CODE END EnterStopMode_1 */
HAL_SuspendTick();
/* Clear Status Flag before entering STOP/STANDBY Mode */

View File

@ -1111,12 +1111,12 @@ static void OnJoinRequest(LmHandlerJoinParams_t *joinParams)
}
AppData.Port = 1;
AppData.BufferSize = 16;
UTIL_MEM_cpy_8((uint8_t*)AppData.Buffer, (uint8_t *)"YUNHORN168", 10);
UTIL_MEM_cpy_8((uint8_t*)AppData.Buffer+10, (uint8_t *)(uint8_t*)YUNHORN_STS_PRD_STRING, sizeof(YUNHORN_STS_PRD_STRING));
AppData.BufferSize = sizeof(YUNHORN_STS_PRD_STRING)+10;
LmHandlerParams.IsTxConfirmed = true;
//UTIL_MEM_cpy_8((uint8_t*)AppData.Buffer, (uint8_t *)"YUNHORN168", 10);
UTIL_MEM_cpy_8((uint8_t*)AppData.Buffer, (uint8_t *)(uint8_t*)YUNHORN_STS_PRD_STRING, sizeof(YUNHORN_STS_PRD_STRING));
AppData.BufferSize = sizeof(YUNHORN_STS_PRD_STRING);
LmHandlerParams.IsTxConfirmed = LORAMAC_HANDLER_CONFIRMED_MSG;
LmHandlerErrorStatus_t status = LmHandlerSend(&AppData, LmHandlerParams.IsTxConfirmed, false);
if (status ==LORAMAC_HANDLER_SUCCESS ) LmHandlerParams.IsTxConfirmed = false;
if (status ==LORAMAC_HANDLER_SUCCESS ) LmHandlerParams.IsTxConfirmed = LORAMAC_HANDLER_UNCONFIRMED_MSG;
}
else
{

View File

@ -109,7 +109,7 @@ extern "C" {
* - CHANNEL_PLAN_GROUP_AS923_4 (Freq offset = -5.90 MHz / Freq range = 917-920MHz)
* - CHANNEL_PLAN_GROUP_AS923_1_JP (Freq offset = 0.0 MHz / Freq range = 920.6-923.4MHz)
*/
#define REGION_AS923_DEFAULT_CHANNEL_PLAN CHANNEL_PLAN_GROUP_AS923_1_JP
#define REGION_AS923_DEFAULT_CHANNEL_PLAN CHANNEL_PLAN_GROUP_AS923_1
/*!
* @brief Limits the number usable channels by default for AU915, CN470 and US915 regions

View File

@ -98,6 +98,9 @@
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.symbolsrec.1950275040" name="MCU Output Converter Motorola S-rec with symbols" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.symbolsrec"/>
</toolChain>
</folderInfo>
<sourceEntries>
<entry excluding="Application/User/STS/TOF/App/app_tof_peoplecount.c" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
</sourceEntries>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
@ -211,6 +214,9 @@
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.symbolsrec.807803134" name="MCU Output Converter Motorola S-rec with symbols" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.symbolsrec"/>
</toolChain>
</folderInfo>
<sourceEntries>
<entry excluding="Application/User/STS/TOF/App/app_tof_peoplecount.c" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
</sourceEntries>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>

View File

@ -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="1048471218779752885" 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 &quot;${INPUTS}&quot;" prefer-non-shared="true">
<provider class="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" console="false" env-hash="-1581009204476899933" 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 &quot;${INPUTS}&quot;" 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="1048471218779752885" 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 &quot;${INPUTS}&quot;" prefer-non-shared="true">
<provider class="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" console="false" env-hash="-1581009204476899933" 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 &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/>
</provider>

View File

@ -18,9 +18,11 @@ RM := rm -rf
-include Drivers/BSP/Components/subdir.mk
-include Drivers/BSP/53L8A1/subdir.mk
-include Application/User/Startup/subdir.mk
-include Application/User/STS/TOF/vl53l1x_uld/subdir.mk
-include Application/User/STS/TOF/vl53l0x/subdir.mk
-include Application/User/STS/TOF/Target/subdir.mk
-include Application/User/STS/TOF/App/subdir.mk
-include Application/User/STS/RSS/subdir.mk
-include Application/User/STS/Core/Src/subdir.mk
-include Application/User/LoRaWAN/Target/subdir.mk
-include Application/User/LoRaWAN/App/subdir.mk

View File

@ -26,9 +26,11 @@ Application/User/Core \
Application/User/LoRaWAN/App \
Application/User/LoRaWAN/Target \
Application/User/STS/Core/Src \
Application/User/STS/RSS \
Application/User/STS/TOF/App \
Application/User/STS/TOF/Target \
Application/User/STS/TOF/vl53l0x \
Application/User/STS/TOF/vl53l1x_uld \
Application/User/Startup \
Drivers/BSP/53L8A1 \
Drivers/BSP/Components \