diff options
| author | ailurux <ailuruxx@gmail.com> | 2024-05-10 13:06:20 +1000 |
|---|---|---|
| committer | ailurux <ailuruxx@gmail.com> | 2024-05-10 13:06:20 +1000 |
| commit | 3f177cdb8880abf199f4445f1398cd69fb813892 (patch) | |
| tree | e20de4949b1344c826e5af41ab701f3db75b21bc /src/drivers/haptics.cpp | |
| parent | 8019c7691889cde4c3d40bbd78d485a92d713bbf (diff) | |
| parent | e4ce7c4ac23402e09be8d6a52e0f739c0dff4ff0 (diff) | |
| download | tangara-fw-3f177cdb8880abf199f4445f1398cd69fb813892.tar.gz | |
Merge branch 'main' into file-browser
Diffstat (limited to 'src/drivers/haptics.cpp')
| -rw-r--r-- | src/drivers/haptics.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/drivers/haptics.cpp b/src/drivers/haptics.cpp index f7b18086..55fa9ad8 100644 --- a/src/drivers/haptics.cpp +++ b/src/drivers/haptics.cpp @@ -4,7 +4,7 @@ * SPDX-License-Identifier: GPL-3.0-only */ -#include "haptics.hpp" +#include "drivers/haptics.hpp" #include <stdint.h> #include <cstdint> @@ -21,7 +21,7 @@ #include "hal/gpio_types.h" #include "hal/i2c_types.h" -#include "i2c.hpp" +#include "drivers/i2c.hpp" namespace drivers { @@ -54,7 +54,8 @@ Haptics::Haptics(const std::variant<ErmMotor, LraMotor>& motor) { // Set library // TODO(robin): try the other libraries and test response. C is marginal, D // too much? - WriteRegister(Register::kWaveformLibrary, static_cast<uint8_t>(kDefaultErmLibrary)); + WriteRegister(Register::kWaveformLibrary, + static_cast<uint8_t>(kDefaultErmLibrary)); } else if (std::holds_alternative<LraMotor>(motor)) { ESP_LOGI(kTag, "Setting up LRA motor..."); @@ -75,7 +76,8 @@ Haptics::Haptics(const std::variant<ErmMotor, LraMotor>& motor) { ControlMask::kLraOpenLoop); // Set library; only option is the LRA one for, well, LRA motors. - WriteRegister(Register::kWaveformLibrary, static_cast<uint8_t>(Library::LRA)); + WriteRegister(Register::kWaveformLibrary, + static_cast<uint8_t>(Library::LRA)); } // Set mode (internal trigger, on writing 1 to Go register) @@ -123,7 +125,6 @@ auto Haptics::SetWaveformEffect(Effect effect) -> void { current_effect_ = effect; } - auto Haptics::TourEffects() -> void { TourEffects(Effect::kFirst, Effect::kLast, kDefaultErmLibrary); } @@ -174,7 +175,6 @@ auto Haptics::TourLibraries(Effect from, Effect to) -> void { } } - auto Haptics::PowerDown() -> void { WriteRegister(Register::kMode, static_cast<uint8_t>(Mode::kInternalTrigger) | ModeMask::kStandby); |
