Skip to content

Commit

Permalink
ResetSettings: move reset setting in config file
Browse files Browse the repository at this point in the history
reducing default values to reduce injurie risck

Signed-off-by: benoit bobert <[email protected]>
  • Loading branch information
Ptibibi committed Nov 4, 2024
1 parent d32464f commit f55e00a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
14 changes: 13 additions & 1 deletion Software/src/constants/Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace Config {
namespace Driver {

// Top linear speed of the device.
constexpr float maxSpeedMmPerSecond = 900.0f;
constexpr float maxSpeedMmPerSecond = 600.0f;

// This should match the step/rev of your stepper or servo.
// N.b. the iHSV57 has a table on the side for setting the DIP switches
Expand Down Expand Up @@ -105,6 +105,18 @@ namespace Config {

}

/**
Default drive settings
*/
namespace ResetSettings {

// Default settings to start in safe
constexpr float speed = 0.0f;
constexpr float stroke = 0.0f;
constexpr float depth = 0.0f;
constexpr float sensation = 50.0f;
}

}

// Alias for "_mm" operator
Expand Down
8 changes: 4 additions & 4 deletions Software/src/ossm/OSSM.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@ class OSSM {
auto drawPatternControls = [](OSSM &o) { o.drawPatternControls(); };
auto drawPreflight = [](OSSM &o) { o.drawPreflight(); };
auto resetSettings = [](OSSM &o) {
o.setting.speed = 0;
o.setting.stroke = 0;
o.setting.depth = 50;
o.setting.sensation = 50;
o.setting.speed = Config::ResetSettings::speed;
o.setting.stroke = Config::ResetSettings::stroke;
o.setting.depth = Config::ResetSettings::depth;
o.setting.sensation = Config::ResetSettings::sensation;
o.playControl = PlayControls::STROKE;

// Prepare the encoder
Expand Down

0 comments on commit f55e00a

Please sign in to comment.