mirror of
https://github.com/ByteWelder/Tactility.git
synced 2026-04-20 10:25:06 +00:00
Fixes
This commit is contained in:
parent
54e8afae71
commit
f3e01ea7f8
@ -1,6 +1,6 @@
|
|||||||
#include <Bq27220.h>
|
#include <Bq27220.h>
|
||||||
#include <Tactility/TactilityCore.h>
|
|
||||||
#include <Tactility/Logger.h>
|
#include <Tactility/Logger.h>
|
||||||
|
#include <Tactility/LogMessages.h>
|
||||||
#include <Tactility/kernel/SystemEvents.h>
|
#include <Tactility/kernel/SystemEvents.h>
|
||||||
#include <Tactility/service/gps/GpsService.h>
|
#include <Tactility/service/gps/GpsService.h>
|
||||||
#include <Tactility/hal/gps/GpsConfiguration.h>
|
#include <Tactility/hal/gps/GpsConfiguration.h>
|
||||||
|
|||||||
@ -4,6 +4,17 @@
|
|||||||
|
|
||||||
static const auto LOGGER = tt::Logger("DRV2605");
|
static const auto LOGGER = tt::Logger("DRV2605");
|
||||||
|
|
||||||
|
Drv2605::Drv2605(i2c_port_t port, bool autoPlayStartupBuzz) : I2cDevice(port, ADDRESS), autoPlayStartupBuzz(autoPlayStartupBuzz) {
|
||||||
|
if (!init()) {
|
||||||
|
LOGGER.error("Failed to initialize DRV2605");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (autoPlayStartupBuzz) {
|
||||||
|
setWaveFormForBuzz();
|
||||||
|
startPlayback();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool Drv2605::init() {
|
bool Drv2605::init() {
|
||||||
uint8_t status;
|
uint8_t status;
|
||||||
if (!readRegister8(static_cast<uint8_t>(Register::Status), status)) {
|
if (!readRegister8(static_cast<uint8_t>(Register::Status), status)) {
|
||||||
|
|||||||
@ -4,7 +4,6 @@
|
|||||||
|
|
||||||
class Drv2605 : public tt::hal::i2c::I2cDevice {
|
class Drv2605 : public tt::hal::i2c::I2cDevice {
|
||||||
|
|
||||||
const tt::Logger logger = tt::Logger("DRV2605");
|
|
||||||
static constexpr auto ADDRESS = 0x5A;
|
static constexpr auto ADDRESS = 0x5A;
|
||||||
|
|
||||||
bool autoPlayStartupBuzz;
|
bool autoPlayStartupBuzz;
|
||||||
@ -63,16 +62,7 @@ class Drv2605 : public tt::hal::i2c::I2cDevice {
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
explicit Drv2605(i2c_port_t port, bool autoPlayStartupBuzz = true) : I2cDevice(port, ADDRESS), autoPlayStartupBuzz(autoPlayStartupBuzz) {
|
explicit Drv2605(i2c_port_t port, bool autoPlayStartupBuzz = true);
|
||||||
if (!init()) {
|
|
||||||
logger.error("Failed to initialize DRV2605");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (autoPlayStartupBuzz) {
|
|
||||||
setWaveFormForBuzz();
|
|
||||||
startPlayback();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string getName() const final { return "DRV2605"; }
|
std::string getName() const final { return "DRV2605"; }
|
||||||
std::string getDescription() const final { return "Haptic driver for ERM/LRA with waveform library & auto-resonance tracking"; }
|
std::string getDescription() const final { return "Haptic driver for ERM/LRA with waveform library & auto-resonance tracking"; }
|
||||||
@ -83,7 +73,6 @@ public:
|
|||||||
void setWaveFormForClick();
|
void setWaveFormForClick();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @param slot a value from 0 to 7
|
* @param slot a value from 0 to 7
|
||||||
* @param waveform
|
* @param waveform
|
||||||
*/
|
*/
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user