From 511e3cd0eb9f4917202bcede30f52f3f0d3373a4 Mon Sep 17 00:00:00 2001 From: YunHorn Technology Date: Thu, 2 Nov 2023 17:19:56 +0800 Subject: [PATCH] initial STS_O5 --- Core/Inc/yunhorn_sts_prd_conf.h | 2 +- Core/Src/yunhorn_sts_process.c | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/Core/Inc/yunhorn_sts_prd_conf.h b/Core/Inc/yunhorn_sts_prd_conf.h index a073508..e2df994 100644 --- a/Core/Inc/yunhorn_sts_prd_conf.h +++ b/Core/Inc/yunhorn_sts_prd_conf.h @@ -44,7 +44,7 @@ //#define USE_TOF_VL53L1X #define STS_USE_TOF_VL53L0X 1U #define YUNHORN_STS_R5_ENABLED - +#define YUNHORN_STS_O5_ENABLED // TOF VL53LX number //#define USE_MEMS_ADXL345 //#define USE_ACCONEER_A111 diff --git a/Core/Src/yunhorn_sts_process.c b/Core/Src/yunhorn_sts_process.c index 6e5528a..1b94005 100644 --- a/Core/Src/yunhorn_sts_process.c +++ b/Core/Src/yunhorn_sts_process.c @@ -168,6 +168,23 @@ void STS_YunhornSTSEventRFAC_Process(void) void STS_YunhornSTSEventP1_Process(void) { +#if defined(YUNHORN_STS_O5_ENABLED) + + if ((sts_work_mode == STS_WIRED_MODE) || (sts_work_mode == STS_REEDSWITCH_MODE) || (sts_work_mode == STS_DUAL_MODE)) + { + STS_Reed_Hall_Presence_Detection(); + + if (sts_reed_hall_result == last_sts_reed_hall_result) { + sts_reed_hall_changed_flag = 0; + } else { + sts_reed_hall_changed_flag = 1; + STS_Combined_Status_Processing(); + } + + last_sts_reed_hall_result = sts_reed_hall_result; + } + +#endif #if (defined(YUNHORN_STS_O6_ENABLED) && defined(USE_ACCONEER_A111)) if ((sts_work_mode == STS_WIRED_MODE) || (sts_work_mode == STS_REEDSWITCH_MODE) || (sts_work_mode == STS_DUAL_MODE)) {