Skip to content

Commit 68ed301

Browse files
committed
Implement review hints of rovo89
1 parent 9a50a05 commit 68ed301

File tree

4 files changed

+9
-12
lines changed

4 files changed

+9
-12
lines changed

Firmware/LowLevel/include/config.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@
22
#define _CONFIG_H
33

44
#define BATT_ABS_MAX 28.7f
5-
#define BATT_ABS_Min 21.7f
5+
#define BATT_ABS_MIN 21.7f
66

7+
#define BATT_EMPTY BATT_ABS_MIN + 0.3f
78
#define BATT_FULL BATT_ABS_MAX - 0.3f
8-
#define BATT_EMPTY BATT_ABS_Min + 0.3f
9+
10+
#define V_BATT_CUTOFF 29.0f
911

1012
#define TILT_EMERGENCY_MILLIS 2500 // Time for a single wheel to be lifted in order to count as emergency (0 disable). This is to filter uneven ground.
1113
#define LIFT_EMERGENCY_MILLIS 100 // Time for both wheels to be lifted in order to count as emergency (0 disable). This is to filter uneven ground.

Firmware/LowLevel/include/debug.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222

2323
#ifdef USB_DEBUG
2424
#define DEBUG_SERIAL Serial
25-
// #define DfMiniMp3Debug DEBUG_SERIAL // Also output DFPlayer IN/OUT cmd data
2625

2726
// Some bloody simple debug macros which superfluous '#ifdef USB_DEBUG' ...
2827
#define DEBUG_BEGIN(b) \
@@ -39,9 +38,5 @@
3938
#define DEBUG_PRINTF(fmt, ...)
4039
#endif
4140

42-
#define PRINTF_BINARY_PATTERN_INT8 "%c%c%c%c%c%c%c%c"
43-
#define PRINTF_BYTE_TO_BINARY_INT8(i) \
44-
(((i)&0x80ll) ? '1' : '0'), (((i)&0x40ll) ? '1' : '0'), (((i)&0x20ll) ? '1' : '0'), (((i)&0x10ll) ? '1' : '0'), \
45-
(((i)&0x08ll) ? '1' : '0'), (((i)&0x04ll) ? '1' : '0'), (((i)&0x02ll) ? '1' : '0'), (((i)&0x01ll) ? '1' : '0')
4641

4742
#endif // _DEBUG_H_

Firmware/LowLevel/src/datatypes.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,9 @@ typedef char iso639_1[2]; // Two char ISO 639-1 language code
144144

145145
enum class HallMode : uint8_t {
146146
off = 0,
147-
emergency, // lift & tilt
148-
stop,
149-
pause
147+
emergency, // Triggers emergency with lift & tilt functionality
148+
stop, // Stop mower
149+
pause // Pause the mower (not yet implemented in ROS)
150150
};
151151

152152
// FIXME: Decide later which is more comfortable, activeLow = 0 | 1
@@ -176,7 +176,7 @@ struct ll_high_level_config {
176176
uint16_t rain_threshold = 700; // If (stock CoverUI) rain value < rain_threshold then it rains. Expected to differ between C500, SA and SC types
177177
float v_charge_cutoff = V_CHARGE_MAX; // Protective max. charging voltage before charging get switched off
178178
float i_charge_cutoff = I_CHARGE_MAX; // Protective max. charging current before charging get switched off
179-
float v_battery_cutoff = 29.0f; // Protective max. battery voltage before charging get switched off
179+
float v_battery_cutoff = V_BATT_CUTOFF; // Protective max. battery voltage before charging get switched off
180180
float v_battery_empty = BATT_EMPTY; // Empty battery voltage used for % calc of capacity
181181
float v_battery_full = BATT_FULL; // Full battery voltage used for % calc of capacity
182182
uint16_t lift_period = LIFT_EMERGENCY_MILLIS; // Period (ms) for both wheels to be lifted in order to count as emergency (0 disable, 0xFFFF do not change). This is to filter uneven ground

Firmware/LowLevel/src/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ void setup() {
367367
rp2040.idleOtherCore();
368368

369369
#ifdef USB_DEBUG
370-
DEBUG_SERIAL.begin(9600);
370+
DEBUG_BEGIN(9600);
371371
#endif
372372

373373
emergency_latch = true;

0 commit comments

Comments
 (0)