add PIR for occupy state, fix AS923_JP bug

This commit is contained in:
Yunhorn 2025-04-17 18:45:59 +08:00
parent 735cf8c2aa
commit 25ee04154b
24 changed files with 29 additions and 29 deletions

View File

@ -90,7 +90,7 @@ void MX_GPIO_Init(void)
#ifdef STS_T6 #ifdef STS_T6
GPIO_InitStruct.Pin = PIR_Pin; GPIO_InitStruct.Pin = PIR_Pin;
GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING_FALLING; //GPIO_MODE_INPUT; GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING_FALLING; //GPIO_MODE_INPUT;
GPIO_InitStruct.Pull = GPIO_PULLUP; GPIO_InitStruct.Pull = GPIO_PULLDOWN;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
HAL_GPIO_Init(PIR_GPIO_Port, &GPIO_InitStruct); HAL_GPIO_Init(PIR_GPIO_Port, &GPIO_InitStruct);
@ -222,7 +222,7 @@ void MX_GPIO_Init(void)
HAL_NVIC_EnableIRQ(EXTI15_10_IRQn); HAL_NVIC_EnableIRQ(EXTI15_10_IRQn);
#ifdef STS_T6 #ifdef STS_T6
HAL_NVIC_SetPriority(PIR_EXTI_IRQn, 0, 0); HAL_NVIC_SetPriority(PIR_EXTI_IRQn, 2, 0);
HAL_NVIC_EnableIRQ(PIR_EXTI_IRQn); HAL_NVIC_EnableIRQ(PIR_EXTI_IRQn);
#endif #endif

View File

@ -657,9 +657,9 @@ void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin)
case PIR_Pin: case PIR_Pin:
sts_pir_state= PIR_STATE; sts_pir_state= PIR_STATE;
// HAL_Delay(50); // HAL_Delay(50);
__HAL_GPIO_EXTI_CLEAR_IT(GPIO_Pin); //__HAL_GPIO_EXTI_CLEAR_IT(GPIO_Pin);
// APP_LOG(TS_OFF, VLEVEL_M, "\r\nMotion Detection result=%d \r\n", sts_pir_state); // APP_LOG(TS_OFF, VLEVEL_M, "\r\nMotion Detection result=%d \r\n", sts_pir_state);
// UTIL_SEQ_SetTask((1 << CFG_SEQ_Task_LoRaSendOnTxTimerOrButtonEvent), CFG_SEQ_Prio_0); UTIL_SEQ_SetTask((1 << CFG_SEQ_Task_LoRaSendOnTxTimerOrButtonEvent), CFG_SEQ_Prio_0);
break; break;
#endif #endif
@ -1229,9 +1229,9 @@ static void OnJoinRequest(LmHandlerJoinParams_t *joinParams)
} }
AppData.Port = 1; AppData.Port = 1;
AppData.BufferSize = 16; AppData.BufferSize = 16;
UTIL_MEM_cpy_8((uint8_t*)AppData.Buffer, (uint8_t *)"YUNHORN168", 10); //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)); 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)+10; AppData.BufferSize = sizeof(YUNHORN_STS_PRD_STRING)-1;
LmHandlerParams.IsTxConfirmed = true; LmHandlerParams.IsTxConfirmed = true;
LmHandlerErrorStatus_t status = LmHandlerSend(&AppData, LmHandlerParams.IsTxConfirmed, false); LmHandlerErrorStatus_t status = LmHandlerSend(&AppData, LmHandlerParams.IsTxConfirmed, false);
if (status ==LORAMAC_HANDLER_SUCCESS ) LmHandlerParams.IsTxConfirmed = false; if (status ==LORAMAC_HANDLER_SUCCESS ) LmHandlerParams.IsTxConfirmed = false;

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_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) * - 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 * @brief Limits the number usable channels by default for AU915, CN470 and US915 regions

View File

@ -5,7 +5,7 @@
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/> <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.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" 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="-1759988577722177836" 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="-859626784961551925" 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.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/> <language-scope id="org.eclipse.cdt.core.g++"/>
</provider> </provider>
@ -16,7 +16,7 @@
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/> <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.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" 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="-1759988577722177836" 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="-859626784961551925" 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.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/> <language-scope id="org.eclipse.cdt.core.g++"/>
</provider> </provider>

View File

@ -1,6 +1,6 @@
################################################################################ ################################################################################
# Automatically-generated file. Do not edit! # Automatically-generated file. Do not edit!
# Toolchain: GNU Tools for STM32 (12.3.rel1) # Toolchain: GNU Tools for STM32 (13.3.rel1)
################################################################################ ################################################################################
# Add inputs and outputs from these tool invocations to the build variables # Add inputs and outputs from these tool invocations to the build variables

View File

@ -1,6 +1,6 @@
################################################################################ ################################################################################
# Automatically-generated file. Do not edit! # Automatically-generated file. Do not edit!
# Toolchain: GNU Tools for STM32 (12.3.rel1) # Toolchain: GNU Tools for STM32 (13.3.rel1)
################################################################################ ################################################################################
# Add inputs and outputs from these tool invocations to the build variables # Add inputs and outputs from these tool invocations to the build variables

View File

@ -1,6 +1,6 @@
################################################################################ ################################################################################
# Automatically-generated file. Do not edit! # Automatically-generated file. Do not edit!
# Toolchain: GNU Tools for STM32 (12.3.rel1) # Toolchain: GNU Tools for STM32 (13.3.rel1)
################################################################################ ################################################################################
# Add inputs and outputs from these tool invocations to the build variables # Add inputs and outputs from these tool invocations to the build variables

View File

@ -1,6 +1,6 @@
################################################################################ ################################################################################
# Automatically-generated file. Do not edit! # Automatically-generated file. Do not edit!
# Toolchain: GNU Tools for STM32 (12.3.rel1) # Toolchain: GNU Tools for STM32 (13.3.rel1)
################################################################################ ################################################################################
# Add inputs and outputs from these tool invocations to the build variables # Add inputs and outputs from these tool invocations to the build variables

View File

@ -1,6 +1,6 @@
################################################################################ ################################################################################
# Automatically-generated file. Do not edit! # Automatically-generated file. Do not edit!
# Toolchain: GNU Tools for STM32 (12.3.rel1) # Toolchain: GNU Tools for STM32 (13.3.rel1)
################################################################################ ################################################################################
# Add inputs and outputs from these tool invocations to the build variables # Add inputs and outputs from these tool invocations to the build variables

View File

@ -1,6 +1,6 @@
################################################################################ ################################################################################
# Automatically-generated file. Do not edit! # Automatically-generated file. Do not edit!
# Toolchain: GNU Tools for STM32 (12.3.rel1) # Toolchain: GNU Tools for STM32 (13.3.rel1)
################################################################################ ################################################################################
# Add inputs and outputs from these tool invocations to the build variables # Add inputs and outputs from these tool invocations to the build variables

View File

@ -1,6 +1,6 @@
################################################################################ ################################################################################
# Automatically-generated file. Do not edit! # Automatically-generated file. Do not edit!
# Toolchain: GNU Tools for STM32 (12.3.rel1) # Toolchain: GNU Tools for STM32 (13.3.rel1)
################################################################################ ################################################################################
# Add inputs and outputs from these tool invocations to the build variables # Add inputs and outputs from these tool invocations to the build variables

View File

@ -1,6 +1,6 @@
################################################################################ ################################################################################
# Automatically-generated file. Do not edit! # Automatically-generated file. Do not edit!
# Toolchain: GNU Tools for STM32 (12.3.rel1) # Toolchain: GNU Tools for STM32 (13.3.rel1)
################################################################################ ################################################################################
# Add inputs and outputs from these tool invocations to the build variables # Add inputs and outputs from these tool invocations to the build variables

View File

@ -1,6 +1,6 @@
################################################################################ ################################################################################
# Automatically-generated file. Do not edit! # Automatically-generated file. Do not edit!
# Toolchain: GNU Tools for STM32 (12.3.rel1) # Toolchain: GNU Tools for STM32 (13.3.rel1)
################################################################################ ################################################################################
# Add inputs and outputs from these tool invocations to the build variables # Add inputs and outputs from these tool invocations to the build variables

View File

@ -1,6 +1,6 @@
################################################################################ ################################################################################
# Automatically-generated file. Do not edit! # Automatically-generated file. Do not edit!
# Toolchain: GNU Tools for STM32 (12.3.rel1) # Toolchain: GNU Tools for STM32 (13.3.rel1)
################################################################################ ################################################################################
# Add inputs and outputs from these tool invocations to the build variables # Add inputs and outputs from these tool invocations to the build variables

View File

@ -1,6 +1,6 @@
################################################################################ ################################################################################
# Automatically-generated file. Do not edit! # Automatically-generated file. Do not edit!
# Toolchain: GNU Tools for STM32 (12.3.rel1) # Toolchain: GNU Tools for STM32 (13.3.rel1)
################################################################################ ################################################################################
# Add inputs and outputs from these tool invocations to the build variables # Add inputs and outputs from these tool invocations to the build variables

View File

@ -1,6 +1,6 @@
################################################################################ ################################################################################
# Automatically-generated file. Do not edit! # Automatically-generated file. Do not edit!
# Toolchain: GNU Tools for STM32 (12.3.rel1) # Toolchain: GNU Tools for STM32 (13.3.rel1)
################################################################################ ################################################################################
# Add inputs and outputs from these tool invocations to the build variables # Add inputs and outputs from these tool invocations to the build variables

View File

@ -1,6 +1,6 @@
################################################################################ ################################################################################
# Automatically-generated file. Do not edit! # Automatically-generated file. Do not edit!
# Toolchain: GNU Tools for STM32 (12.3.rel1) # Toolchain: GNU Tools for STM32 (13.3.rel1)
################################################################################ ################################################################################
# Add inputs and outputs from these tool invocations to the build variables # Add inputs and outputs from these tool invocations to the build variables

View File

@ -1,6 +1,6 @@
################################################################################ ################################################################################
# Automatically-generated file. Do not edit! # Automatically-generated file. Do not edit!
# Toolchain: GNU Tools for STM32 (12.3.rel1) # Toolchain: GNU Tools for STM32 (13.3.rel1)
################################################################################ ################################################################################
# Add inputs and outputs from these tool invocations to the build variables # Add inputs and outputs from these tool invocations to the build variables

View File

@ -1,6 +1,6 @@
################################################################################ ################################################################################
# Automatically-generated file. Do not edit! # Automatically-generated file. Do not edit!
# Toolchain: GNU Tools for STM32 (12.3.rel1) # Toolchain: GNU Tools for STM32 (13.3.rel1)
################################################################################ ################################################################################
# Add inputs and outputs from these tool invocations to the build variables # Add inputs and outputs from these tool invocations to the build variables

View File

@ -1,6 +1,6 @@
################################################################################ ################################################################################
# Automatically-generated file. Do not edit! # Automatically-generated file. Do not edit!
# Toolchain: GNU Tools for STM32 (12.3.rel1) # Toolchain: GNU Tools for STM32 (13.3.rel1)
################################################################################ ################################################################################
-include ../makefile.init -include ../makefile.init

View File

@ -1,6 +1,6 @@
################################################################################ ################################################################################
# Automatically-generated file. Do not edit! # Automatically-generated file. Do not edit!
# Toolchain: GNU Tools for STM32 (12.3.rel1) # Toolchain: GNU Tools for STM32 (13.3.rel1)
################################################################################ ################################################################################
USER_OBJS := USER_OBJS :=

View File

@ -1,6 +1,6 @@
################################################################################ ################################################################################
# Automatically-generated file. Do not edit! # Automatically-generated file. Do not edit!
# Toolchain: GNU Tools for STM32 (12.3.rel1) # Toolchain: GNU Tools for STM32 (13.3.rel1)
################################################################################ ################################################################################
ELF_SRCS := ELF_SRCS :=

View File

@ -669,7 +669,7 @@ void STS_TOF_VL53LX_PresenceDetection_Process_Start(void)
sts_tof_vl53lx_presence_detection_init(); sts_tof_vl53lx_presence_detection_init();
return ; return ;
} }
if (sts_tof_presence_state ==1) if ((sts_tof_presence_state ==1)|| (sts_pir_state ==1))
{ {
LED_GREEN_OFF; LED_GREEN_OFF;
LED_RED_ON; LED_RED_ON;