Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enlargeable Config Packet #110

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
6d00ee3
Initial proposal
Apehaenger Oct 7, 2024
e19c952
Add missing files
Apehaenger Oct 7, 2024
f3936e6
Abort one large config struct consideration
Apehaenger Oct 9, 2024
d90b6ca
Finish flexible length config packet
Apehaenger Oct 10, 2024
9a50a05
Cleanup, add and rename config struct member
Apehaenger Oct 11, 2024
13aff7f
refactor: create applyConfig()
rovo89 Oct 11, 2024
1c0cfac
PoC for LittleFS
rovo89 Oct 11, 2024
68ed301
Implement review hints of rovo89
Apehaenger Oct 11, 2024
1ff7d31
Don't write config to flash if it hasn't changed
rovo89 Oct 11, 2024
bca5826
Implement review hints of rovo89
Apehaenger Oct 11, 2024
7899164
Merge pull request #1 from rovo89/config_flash
Apehaenger Oct 12, 2024
4f11010
Minor LittleFS implementation changes
Apehaenger Oct 12, 2024
0075f68
Intermediate result after protocol implementation with ROS
Apehaenger Oct 14, 2024
37f2ac6
Missing commit
Apehaenger Oct 14, 2024
9e24b05
Intermediate commit #2
Apehaenger Oct 18, 2024
7eaa6fd
Adjust v_charge_cutoff to MAX20405
Apehaenger Oct 18, 2024
5f5d5b8
Change config_bitmask to option bitfield
Apehaenger Oct 20, 2024
a1a6492
Make IGNORE_CHARGING_CURRENT configurable via LL/HL config `options.i…
Apehaenger Oct 20, 2024
5b18e4a
Finalize LittleFS
Apehaenger Oct 20, 2024
859de1b
Finish new flexible hall implementation
Apehaenger Oct 22, 2024
4135fa5
Remove IGNORE_CHARGING_CURRENT builds from artifacts
Apehaenger Oct 22, 2024
fe8e829
Make halls const
Apehaenger Oct 22, 2024
32d6576
Apply received packet on default-config (instead of live-config)
Apehaenger Oct 24, 2024
2328792
Add configurable (Stock-CoverUI) rain threshold
Apehaenger Oct 24, 2024
21e5baf
Change config packet IDs
Apehaenger Oct 26, 2024
12874d2
Cleanup
Apehaenger Oct 26, 2024
485e0a8
Cosmetic changes
Apehaenger Oct 28, 2024
7ba963d
Store config packet instead of effective config
Apehaenger Oct 28, 2024
4d43638
Optimize hall handling with etl::vector
Apehaenger Oct 29, 2024
e55bc19
Change ConfigOptions from boolean to tree-state enums
Apehaenger Oct 29, 2024
480cadf
Change shutdown_esc_max_pitch to uint8_t
Apehaenger Oct 29, 2024
d185090
Add new/missing config values to applyConfig()
Apehaenger Oct 29, 2024
542419f
Fix hall handling
Apehaenger Oct 30, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions Firmware/LowLevel/include/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
#define _CONFIG_H

#define BATT_ABS_MAX 28.7f
#define BATT_ABS_Min 21.7f
#define BATT_ABS_MIN 21.7f

#define BATT_EMPTY BATT_ABS_MIN + 0.3f
#define BATT_FULL BATT_ABS_MAX - 0.3f
#define BATT_EMPTY BATT_ABS_Min + 0.3f

#define V_BATT_CUTOFF 29.0f

#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.
#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.
Expand Down
5 changes: 0 additions & 5 deletions Firmware/LowLevel/include/debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

#ifdef USB_DEBUG
#define DEBUG_SERIAL Serial
// #define DfMiniMp3Debug DEBUG_SERIAL // Also output DFPlayer IN/OUT cmd data

// Some bloody simple debug macros which superfluous '#ifdef USB_DEBUG' ...
#define DEBUG_BEGIN(b) \
Apehaenger marked this conversation as resolved.
Show resolved Hide resolved
Expand All @@ -39,9 +38,5 @@
#define DEBUG_PRINTF(fmt, ...)
#endif

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

#endif // _DEBUG_H_
8 changes: 4 additions & 4 deletions Firmware/LowLevel/src/datatypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,9 @@ typedef char iso639_1[2]; // Two char ISO 639-1 language code

enum class HallMode : uint8_t {
off = 0,
emergency, // lift & tilt
stop,
pause
emergency, // Triggers emergency with lift & tilt functionality
stop, // Stop mower
pause // Pause the mower (not yet implemented in ROS)
};

// FIXME: Decide later which is more comfortable, activeLow = 0 | 1
Apehaenger marked this conversation as resolved.
Show resolved Hide resolved
Expand Down Expand Up @@ -176,7 +176,7 @@ struct ll_high_level_config {
uint16_t rain_threshold = 700; // If (stock CoverUI) rain value < rain_threshold then it rains. Expected to differ between C500, SA and SC types
float v_charge_cutoff = V_CHARGE_MAX; // Protective max. charging voltage before charging get switched off
float i_charge_cutoff = I_CHARGE_MAX; // Protective max. charging current before charging get switched off
float v_battery_cutoff = 29.0f; // Protective max. battery voltage before charging get switched off
float v_battery_cutoff = V_BATT_CUTOFF; // Protective max. battery voltage before charging get switched off
float v_battery_empty = BATT_EMPTY; // Empty battery voltage used for % calc of capacity
float v_battery_full = BATT_FULL; // Full battery voltage used for % calc of capacity
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
Expand Down
2 changes: 1 addition & 1 deletion Firmware/LowLevel/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ void setup() {
rp2040.idleOtherCore();

#ifdef USB_DEBUG
DEBUG_SERIAL.begin(9600);
DEBUG_BEGIN(9600);
Apehaenger marked this conversation as resolved.
Show resolved Hide resolved
#endif
Apehaenger marked this conversation as resolved.
Show resolved Hide resolved

emergency_latch = true;
Expand Down
Loading