summaryrefslogtreecommitdiff
path: root/src/drivers/haptics.cpp
diff options
context:
space:
mode:
authorcooljqln <cooljqln@noreply.codeberg.org>2024-05-03 04:48:17 +0000
committercooljqln <cooljqln@noreply.codeberg.org>2024-05-03 04:48:17 +0000
commit3ceb8025ee4330c177101ed30ec17dfb0002f41e (patch)
tree58350210f15df7d00d967cac6f30eeceeb031a3c /src/drivers/haptics.cpp
parent964da15a0b84f8e5f00e8abac2f7dfda0bf60488 (diff)
parent9fafd797a5504f458b5fcae4a1d28a68da936315 (diff)
downloadtangara-fw-3ceb8025ee4330c177101ed30ec17dfb0002f41e.tar.gz
Merge pull request 'Break dependency cycles with our components by merging co-dependent components together' (#68) from jqln/component-merge into main
Reviewed-on: https://codeberg.org/cool-tech-zone/tangara-fw/pulls/68
Diffstat (limited to 'src/drivers/haptics.cpp')
-rw-r--r--src/drivers/haptics.cpp12
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);