mirror of
https://github.com/alexhopeoconnor/firmware.git
synced 2026-10-17 00:51:30 +10:00
who in their right mind would name something in main.h 'drv'?
Shading locals...
This commit is contained in:
@@ -190,9 +190,9 @@ void TLoraPagerKeyboard::released()
|
||||
|
||||
void TLoraPagerKeyboard::hapticFeedback()
|
||||
{
|
||||
drv.setWaveform(0, 14); // strong buzz 100%
|
||||
drv.setWaveform(1, 0); // end waveform
|
||||
drv.go();
|
||||
hapticDriver.setWaveform(0, 14); // strong buzz 100%
|
||||
hapticDriver.setWaveform(1, 0); // end waveform
|
||||
hapticDriver.go();
|
||||
}
|
||||
|
||||
// toggle brightness of the backlight in three steps
|
||||
|
||||
@@ -152,8 +152,8 @@ int32_t TouchScreenBase::runOnce()
|
||||
void TouchScreenBase::hapticFeedback()
|
||||
{
|
||||
#ifdef T_WATCH_S3
|
||||
drv.setWaveform(0, 75);
|
||||
drv.setWaveform(1, 0); // end waveform
|
||||
drv.go();
|
||||
hapticDriver.setWaveform(0, 75);
|
||||
hapticDriver.setWaveform(1, 0); // end waveform
|
||||
hapticDriver.go();
|
||||
#endif
|
||||
}
|
||||
|
||||
+4
-4
@@ -203,7 +203,7 @@ ScanI2C::FoundDevice rgb_found = ScanI2C::FoundDevice(ScanI2C::DeviceType::NONE,
|
||||
ScanI2C::DeviceAddress aqi_found = ScanI2C::ADDRESS_NONE;
|
||||
|
||||
#ifdef HAS_DRV2605
|
||||
Adafruit_DRV2605 drv;
|
||||
Adafruit_DRV2605 hapticDriver;
|
||||
#endif
|
||||
|
||||
bool isVibrating = false;
|
||||
@@ -758,10 +758,10 @@ void setup()
|
||||
digitalWrite(PIN_DRV_EN, HIGH);
|
||||
delay(10);
|
||||
#endif
|
||||
drv.begin();
|
||||
drv.selectLibrary(1);
|
||||
hapticDriver.begin();
|
||||
hapticDriver.selectLibrary(1);
|
||||
// I2C trigger by sending 'go' command
|
||||
drv.setMode(DRV2605_MODE_INTTRIG);
|
||||
hapticDriver.setMode(DRV2605_MODE_INTTRIG);
|
||||
#endif
|
||||
|
||||
// Init our SPI controller (must be before screen and lora)
|
||||
|
||||
+1
-1
@@ -44,7 +44,7 @@ extern bool isUSBPowered;
|
||||
|
||||
#ifdef HAS_DRV2605
|
||||
#include <Adafruit_DRV2605.h>
|
||||
extern Adafruit_DRV2605 drv;
|
||||
extern Adafruit_DRV2605 hapticDriver;
|
||||
#endif
|
||||
|
||||
#ifdef HAS_PCA9557
|
||||
|
||||
@@ -127,7 +127,7 @@ int32_t ExternalNotificationModule::runOnce()
|
||||
#endif
|
||||
|
||||
#ifdef HAS_DRV2605
|
||||
drv.go();
|
||||
hapticDriver.go();
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -222,9 +222,9 @@ void ExternalNotificationModule::setExternalState(uint8_t index, bool on)
|
||||
|
||||
#ifdef HAS_DRV2605
|
||||
if (on) {
|
||||
drv.go();
|
||||
hapticDriver.go();
|
||||
} else {
|
||||
drv.stop();
|
||||
hapticDriver.stop();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -257,7 +257,7 @@ void ExternalNotificationModule::stopNow()
|
||||
}
|
||||
setIntervalFromNow(0);
|
||||
#ifdef HAS_DRV2605
|
||||
drv.stop();
|
||||
hapticDriver.stop();
|
||||
#endif
|
||||
|
||||
// Prevent the state machine from immediately re-triggering outputs after a manual stop.
|
||||
@@ -422,15 +422,15 @@ ProcessMessage ExternalNotificationModule::handleReceived(const meshtastic_MeshP
|
||||
} else {
|
||||
// Buzz if buzzer mode is not in DIRECT_MSG_ONLY or is DM to us
|
||||
#ifdef HAS_DRV2605
|
||||
drv.setWaveform(0, 16); // Long buzzer 100%
|
||||
drv.setWaveform(1, 0); // Pause
|
||||
drv.setWaveform(2, 16);
|
||||
drv.setWaveform(3, 0);
|
||||
drv.setWaveform(4, 16);
|
||||
drv.setWaveform(5, 0);
|
||||
drv.setWaveform(6, 16);
|
||||
drv.setWaveform(7, 0);
|
||||
drv.go();
|
||||
hapticDriver.setWaveform(0, 16); // Long buzzer 100%
|
||||
hapticDriver.setWaveform(1, 0); // Pause
|
||||
hapticDriver.setWaveform(2, 16);
|
||||
hapticDriver.setWaveform(3, 0);
|
||||
hapticDriver.setWaveform(4, 16);
|
||||
hapticDriver.setWaveform(5, 0);
|
||||
hapticDriver.setWaveform(6, 16);
|
||||
hapticDriver.setWaveform(7, 0);
|
||||
hapticDriver.go();
|
||||
#endif
|
||||
|
||||
if (moduleConfig.external_notification.use_i2s_as_buzzer) {
|
||||
|
||||
Reference in New Issue
Block a user