Skip to content

Commit

Permalink
Add emergencies STOP & HALL
Browse files Browse the repository at this point in the history
  • Loading branch information
Apehaenger committed Nov 28, 2023
1 parent 5f21fa6 commit ef38e82
Show file tree
Hide file tree
Showing 3 changed files with 144 additions and 13 deletions.
28 changes: 28 additions & 0 deletions Firmware/CoverUI/YardForce/include/model/emergency_RM-EC3-V11.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/**
* @file emergency_RM-EC3-V11.cpp
* @author Apehaenger ([email protected])
* @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 <Arduino.h>
#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));
28 changes: 28 additions & 0 deletions Firmware/CoverUI/YardForce/include/model/emergency_RM-EC3-V11.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/**
* @file emergency_RM-EC3-V11.h
* @author Apehaenger ([email protected])
* @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 <Arduino.h>
#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
101 changes: 88 additions & 13 deletions Firmware/CoverUI/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,12 @@ build_src_filter =
-<LEDcontrol.cpp>
-<statemachine.cpp>
+<YardForce/>
-<YardForce/Display.cpp>
-<YardForce/Emergency.cpp>
-<YardForce/Hatch.cpp>
-<YardForce/subscription.cpp>
-<YardForce/ST75256.cpp>
-<YardForce/UC1698.cpp>
-<YardForce/util/>
-<YardForce/include/model/>
-<YardForce/include/UC1698*>
Expand Down Expand Up @@ -403,10 +405,12 @@ build_src_filter =
${env.build_src_filter}
+<YardForce/include/model/*_RM-EC3-V11.*>
+<YardForce/ST75256.cpp>
+<YardForce/Display.cpp>
+<YardForce/assets/*>
+<YardForce/Widget*>
+<YardForce/Hatch.cpp>
+<YardForce/subscription.cpp>

build_flags =
${env.build_flags}
-DMCU_STM32
Expand All @@ -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}
+<YardForce/include/model/*_RM-EC3-V11.*>
+<YardForce/ST75256.cpp>
+<YardForce/Display.cpp>
+<YardForce/assets/*>
+<YardForce/Widget*>
+<YardForce/Hatch.cpp>
+<YardForce/subscription.cpp>
+<YardForce/Emergency.*>

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}
+<YardForce/include/model/*_RM-EC3-V11.*>
+<YardForce/ST75256.cpp>
+<YardForce/Display.cpp>
+<YardForce/assets/*>
+<YardForce/Widget*>
+<YardForce/Hatch.cpp>
+<YardForce/subscription.cpp>
+<YardForce/Emergency.*>

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}
+<YardForce/include/model/*_RM-EC3-V11.*>
+<YardForce/ST75256.cpp>
+<YardForce/Display.cpp>
+<YardForce/assets/*>
+<YardForce/Widget*>
+<YardForce/Hatch.cpp>
+<YardForce/subscription.cpp>
+<YardForce/Emergency.*>

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 *
Expand All @@ -449,6 +522,8 @@ build_src_filter =
${env.build_src_filter}
+<YardForce/include/model/*_SAxPRO.*>
+<YardForce/assets/*>
+<YardForce/UC1698.cpp>
+<YardForce/Display.cpp>
+<YardForce/Widget*>
+<YardForce/Hatch.cpp>
+<YardForce/subscription.cpp>
Expand Down

0 comments on commit ef38e82

Please sign in to comment.