Skip to content

Commit

Permalink
Add MOD_HALL to RM-ECOW-V1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Apehaenger committed Sep 29, 2024
1 parent 759d743 commit 0ceb795
Show file tree
Hide file tree
Showing 11 changed files with 16,859 additions and 6,169 deletions.
2 changes: 1 addition & 1 deletion Firmware/CoverUI/YardForce/include/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#else
#undef FIRMWARE_VERSION
#endif
#define FIRMWARE_VERSION 205
#define FIRMWARE_VERSION 206

#if defined(MDL_C500)
#include "model_C500.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,29 @@
* @file emergency_RM-ECOW-V100.cpp
* @author Apehaenger ([email protected])
* @brief YardForce RM-ECOW-V1.0.0 CoverUI Emergency class for OpenMower https://github.com/ClemensElflein/OpenMower
* @version 0.2
* @date 2023-11-05
* @version 0.3
* @date 2024-09-28
*
* @copyright Copyright (c) 2023
* @copyright Copyright (c) 2023, 2024
*
*/
#include <Arduino.h>
#include "emergency_RM-ECOW-V100.h"

#include <Arduino.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_STOP_JP5, INPUT_PULLUP, Emergency_state::Emergency_stop1},
{PIN_STOP_JP6, INPUT_PULLUP, Emergency_state::Emergency_stop2}};
{PIN_STOP_JP6, INPUT_PULLUP, Emergency_state::Emergency_stop2}
#endif
};

Emergency emergency(kEmergencyPinStateDefs, sizeof(kEmergencyPinStateDefs) / sizeof(EmergencyPinStateDef));
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,28 @@
* @file emergency_RM-ECOW-V100.h
* @author Apehaenger ([email protected])
* @brief YardForce RM-ECOW-V1.0.0 CoverUI Emergency header for OpenMower https://github.com/ClemensElflein/OpenMower
* @version 0.2
* @date 2023-11-05
* @version 0.3
* @date 2024-09-28
*
* @copyright Copyright (c) 2023
* @copyright Copyright (c) 2023, 2024
*
*/

#ifndef YARDFORCE_EMERGENCY_RMECOWV100_HPP
#define YARDFORCE_EMERGENCY_RMECOWV100_HPP

#include <Arduino.h>

#include "../Emergency.hpp"

#define PIN_STOP_JP5 PC10
#define PIN_STOP_JP6 PA15

#define PIN_HALL1 PA8 // LIFT
#define PIN_HALL2 PF6 // LIFTX
#define PIN_HALL3 PA12 // LBUMP
#define PIN_HALL4 PA11 // RBUMP

extern Emergency emergency;

#endif // YARDFORCE_EMERGENCY_RMECOWV100_HPP
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@ unsigned int HatchRMECOWV100::handle_button(unsigned int button_id, unsigned int
if (button_id == BTN_6H_NUM)
return BTN_TUE_NUM; // Volume down

if (button_id == BTN_8H_NUM)
return BTN_WED_NUM; // Next language

return button_id;
};

Expand Down
7 changes: 7 additions & 0 deletions Firmware/CoverUI/YardForce/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,13 @@ HardwareSerial serial_ll((uint8_t)UART_LL_RX, (uint8_t)UART_LL_TX, 1); // Serial

void setup()
{
#ifdef MDL_RMECOWV100
// RM-ECOW-V1.0.0 might have a populated ESP-WROOM-02 module.
// Disable it, because one might have made MOD_HALL but flash or test another FW variant
pinMode(PF7, OUTPUT); // ESP-WROOM-02 EN pin
digitalWrite(PF7, LOW); // Disable ESP-WROOM-02 module so that it's GPIOs doesn't collide with ours
#endif

leds.setup();
buttons.setup();
#ifdef YARDFORCE_DISPLAY_HPP
Expand Down
58 changes: 58 additions & 0 deletions Firmware/CoverUI/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,64 @@ build_flags =
-DMCU_STM32
-DMDL_RMECOWV100
-DMOD_EMERGENCY
-DMOD_STOP

upload_flags =
-f
YardForce/util/stlink-stm.cfg
upload_command = openocd $UPLOAD_FLAGS -c "init; reset halt; stm32f0x unlock 0; reset run" -c "program {$SOURCE} verify reset; shutdown;"

debug_build_flags = -O0 -g -ggdb2
debug_server =
openocd
-f
YardForce/util/stlink-stm.cfg
-c
reset_config none separate


[env:YF_RM-ECOW-V100_STM32_HALL]
board = disco_f030r8
build_src_filter =
${env.build_src_filter}
+<YardForce/include/model/*_RM-ECOW-V100.*>
+<YardForce/Hatch.*>
+<YardForce/Emergency.*>
build_flags =
${env.build_flags}
-DMCU_STM32
-DMDL_RMECOWV100
-DMOD_EMERGENCY
-DMOD_HALL

upload_flags =
-f
YardForce/util/stlink-stm.cfg
upload_command = openocd $UPLOAD_FLAGS -c "init; reset halt; stm32f0x unlock 0; reset run" -c "program {$SOURCE} verify reset; shutdown;"

debug_build_flags = -O0 -g -ggdb2
debug_server =
openocd
-f
YardForce/util/stlink-stm.cfg
-c
reset_config none separate


[env:YF_RM-ECOW-V100_STM32_HALL_STOP]
board = disco_f030r8
build_src_filter =
${env.build_src_filter}
+<YardForce/include/model/*_RM-ECOW-V100.*>
+<YardForce/Hatch.*>
+<YardForce/Emergency.*>
build_flags =
${env.build_flags}
-DMCU_STM32
-DMDL_RMECOWV100
-DMOD_EMERGENCY
-DMOD_HALL
-DMOD_STOP

upload_flags =
-f
Expand Down
Loading

0 comments on commit 0ceb795

Please sign in to comment.