From ef38e82e8cb445121aa21d2052a0b1ecfc5c7f51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Ebeling?= Date: Tue, 28 Nov 2023 23:29:50 +0100 Subject: [PATCH] Add emergencies STOP & HALL --- .../include/model/emergency_RM-EC3-V11.cpp | 28 +++++ .../include/model/emergency_RM-EC3-V11.h | 28 +++++ Firmware/CoverUI/platformio.ini | 101 +++++++++++++++--- 3 files changed, 144 insertions(+), 13 deletions(-) create mode 100644 Firmware/CoverUI/YardForce/include/model/emergency_RM-EC3-V11.cpp create mode 100644 Firmware/CoverUI/YardForce/include/model/emergency_RM-EC3-V11.h diff --git a/Firmware/CoverUI/YardForce/include/model/emergency_RM-EC3-V11.cpp b/Firmware/CoverUI/YardForce/include/model/emergency_RM-EC3-V11.cpp new file mode 100644 index 0000000..b006e76 --- /dev/null +++ b/Firmware/CoverUI/YardForce/include/model/emergency_RM-EC3-V11.cpp @@ -0,0 +1,28 @@ +/** + * @file emergency_RM-EC3-V11.cpp + * @author Apehaenger (joerg@ebeling.ws) + * @brief YardForce RM-EC3-V1.1 CoverUI Emergency class for OpenMower https://github.com/ClemensElflein/OpenMower + * @version 0.1 + * @date 2023-11-28 + * + * @copyright Copyright (c) 2023 + * + */ +#include +#include "emergency_RM-EC3-V11.h" +#include "../Emergency.hpp" + +const EmergencyPinStateDef kEmergencyPinStateDefs[] = { +#ifdef MOD_HALL + {PIN_HALL1, INPUT_PULLUP, Emergency_state::Emergency_lift1}, + {PIN_HALL2, INPUT_PULLUP, Emergency_state::Emergency_lift1}, + {PIN_HALL3, INPUT_PULLUP, Emergency_state::Emergency_lift2}, + {PIN_HALL4, INPUT_PULLUP, Emergency_state::Emergency_lift2}, +#endif +#ifdef MOD_STOP + {PIN_STOP1, INPUT_PULLUP, Emergency_state::Emergency_stop1}, + {PIN_STOP2, INPUT_PULLUP, Emergency_state::Emergency_stop2}, +#endif +}; + +Emergency emergency(kEmergencyPinStateDefs, sizeof(kEmergencyPinStateDefs) / sizeof(EmergencyPinStateDef)); diff --git a/Firmware/CoverUI/YardForce/include/model/emergency_RM-EC3-V11.h b/Firmware/CoverUI/YardForce/include/model/emergency_RM-EC3-V11.h new file mode 100644 index 0000000..72f9a5d --- /dev/null +++ b/Firmware/CoverUI/YardForce/include/model/emergency_RM-EC3-V11.h @@ -0,0 +1,28 @@ +/** + * @file emergency_RM-EC3-V11.h + * @author Apehaenger (joerg@ebeling.ws) + * @brief YardForce RM-EC3-V1.1 CoverUI Emergency header for OpenMower https://github.com/ClemensElflein/OpenMower + * @version 0.1 + * @date 2023-11-28 + * + * @copyright Copyright (c) 2023 + * + */ + +#ifndef YARDFORCE_EMERGENCY_RMEC3V11_H +#define YARDFORCE_EMERGENCY_RMEC3V11_H + +#include +#include "../Emergency.hpp" + +#define PIN_STOP1 PC15 +#define PIN_STOP2 PB6 + +#define PIN_HALL1 PB15 +#define PIN_HALL2 PC0 +#define PIN_HALL3 PC8 +#define PIN_HALL4 PC9 + +extern Emergency emergency; + +#endif // YARDFORCE_EMERGENCY_RMEC3V11_H diff --git a/Firmware/CoverUI/platformio.ini b/Firmware/CoverUI/platformio.ini index 2235440..65f8c8e 100644 --- a/Firmware/CoverUI/platformio.ini +++ b/Firmware/CoverUI/platformio.ini @@ -44,10 +44,12 @@ build_src_filter = - - + + - - - - - + - - - - @@ -403,10 +405,12 @@ build_src_filter = ${env.build_src_filter} + + + + + + + + + build_flags = ${env.build_flags} -DMCU_STM32 @@ -417,24 +421,93 @@ build_flags = lib_deps = lvgl/lvgl@^8.3.9 -;upload_flags = -; -f -; YardForce/util/stlink-stm.cfg -;upload_command = openocd $UPLOAD_FLAGS -c "init; reset halt; stm32f4x unlock 0; reset run" -c "program {$SOURCE} verify reset; shutdown;" +debug_build_flags = -O0 -g2 -ggdb2 + + +[env:YF_RM-EC3-V11_STM32_HALL] +board = genericSTM32F401RC +build_src_filter = + ${env.build_src_filter} + + + + + + + + + + + + + + + + + +build_flags = + ${env.build_flags} + -DMCU_STM32 + -DMDL_RMEC3V11 + -DMOD_EMERGENCY + -DMOD_HALL + -DLV_CONF_INCLUDE_SIMPLE + -DLV_LVGL_H_INCLUDE_SIMPLE + -IYardForce ; Required by LVGL to find his lv_conf.h + +lib_deps = lvgl/lvgl@^8.3.9 debug_build_flags = -O0 -g2 -ggdb2 -;debug_server = -; openocd -; -f -; YardForce/util/stlink-stm.cfg -; -c -; reset_config none separate -;source [find interface/stlink.cfg] -;source [find target/stm32f0x.cfg] +[env:YF_RM-EC3-V11_STM32_HALL_STOP] +board = genericSTM32F401RC +build_src_filter = + ${env.build_src_filter} + + + + + + + + + + + + + + + + + +build_flags = + ${env.build_flags} + -DMCU_STM32 + -DMDL_RMEC3V11 + -DMOD_EMERGENCY + -DMOD_HALL + -DMOD_STOP + -DLV_CONF_INCLUDE_SIMPLE + -DLV_LVGL_H_INCLUDE_SIMPLE + -IYardForce ; Required by LVGL to find his lv_conf.h + +lib_deps = lvgl/lvgl@^8.3.9 + +debug_build_flags = -O0 -g2 -ggdb2 + + +[env:YF_RM-EC3-V11_STM32_STOP] +board = genericSTM32F401RC +build_src_filter = + ${env.build_src_filter} + + + + + + + + + + + + + + + + + +build_flags = + ${env.build_flags} + -DMCU_STM32 + -DMDL_RMEC3V11 + -DMOD_EMERGENCY + -DMOD_STOP + -DLV_CONF_INCLUDE_SIMPLE + -DLV_LVGL_H_INCLUDE_SIMPLE + -IYardForce ; Required by LVGL to find his lv_conf.h + +lib_deps = lvgl/lvgl@^8.3.9 + +debug_build_flags = -O0 -g2 -ggdb2 -;transport select hla_swd; ;******************************************** ;* YardForce SAxPRO, STM32 Variants * @@ -449,6 +522,8 @@ build_src_filter = ${env.build_src_filter} + + + + + + + + +