mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-31 15:10:40 +00:00
T-Watch S3 Support (#2632)
* T-Watch WIP * Updates * Temp * Update screen spi bus and and backlight en * Peripherals progress * Fixes * Fixes * Updates * DRV scaffolding * Fixed touch-screen driver selection. WIP on DRV haptic feedback * DRV2605 pmu channel * Trunk * Fixes and defaults * Dropped an s * Move PMU and turn off screen that way * Add t-deck and t-watch-s3 to CI and cleanup * More cleanup
This commit is contained in:
@@ -93,6 +93,10 @@ int32_t ExternalNotificationModule::runOnce()
|
||||
rgb.setColor(red, green, blue);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef T_WATCH_S3
|
||||
drv.go();
|
||||
#endif
|
||||
}
|
||||
|
||||
// now let the PWM buzzer play
|
||||
@@ -124,7 +128,8 @@ void ExternalNotificationModule::setExternalOn(uint8_t index)
|
||||
digitalWrite(moduleConfig.external_notification.output_buzzer, true);
|
||||
break;
|
||||
default:
|
||||
digitalWrite(output, (moduleConfig.external_notification.active ? true : false));
|
||||
if (output > 0)
|
||||
digitalWrite(output, (moduleConfig.external_notification.active ? true : false));
|
||||
break;
|
||||
}
|
||||
#ifdef HAS_NCP5623
|
||||
@@ -132,6 +137,9 @@ void ExternalNotificationModule::setExternalOn(uint8_t index)
|
||||
rgb.setColor(red, green, blue);
|
||||
}
|
||||
#endif
|
||||
#ifdef T_WATCH_S3
|
||||
drv.go();
|
||||
#endif
|
||||
}
|
||||
|
||||
void ExternalNotificationModule::setExternalOff(uint8_t index)
|
||||
@@ -149,7 +157,8 @@ void ExternalNotificationModule::setExternalOff(uint8_t index)
|
||||
digitalWrite(moduleConfig.external_notification.output_buzzer, false);
|
||||
break;
|
||||
default:
|
||||
digitalWrite(output, (moduleConfig.external_notification.active ? false : true));
|
||||
if (output > 0)
|
||||
digitalWrite(output, (moduleConfig.external_notification.active ? false : true));
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -161,6 +170,9 @@ void ExternalNotificationModule::setExternalOff(uint8_t index)
|
||||
rgb.setColor(red, green, blue);
|
||||
}
|
||||
#endif
|
||||
#ifdef T_WATCH_S3
|
||||
drv.stop();
|
||||
#endif
|
||||
}
|
||||
|
||||
bool ExternalNotificationModule::getExternal(uint8_t index)
|
||||
@@ -174,6 +186,9 @@ void ExternalNotificationModule::stopNow()
|
||||
nagCycleCutoff = 1; // small value
|
||||
isNagging = false;
|
||||
setIntervalFromNow(0);
|
||||
#ifdef T_WATCH_S3
|
||||
drv.stop();
|
||||
#endif
|
||||
}
|
||||
|
||||
ExternalNotificationModule::ExternalNotificationModule()
|
||||
@@ -185,7 +200,6 @@ ExternalNotificationModule::ExternalNotificationModule()
|
||||
without having to configure it from the PythonAPI or WebUI.
|
||||
*/
|
||||
|
||||
// moduleConfig.external_notification.enabled = true;
|
||||
// moduleConfig.external_notification.alert_message = true;
|
||||
// moduleConfig.external_notification.alert_message_buzzer = true;
|
||||
// moduleConfig.external_notification.alert_message_vibra = true;
|
||||
@@ -213,8 +227,10 @@ ExternalNotificationModule::ExternalNotificationModule()
|
||||
: EXT_NOTIFICATION_MODULE_OUTPUT;
|
||||
|
||||
// Set the direction of a pin
|
||||
LOG_INFO("Using Pin %i in digital mode\n", output);
|
||||
pinMode(output, OUTPUT);
|
||||
if (output > 0) {
|
||||
LOG_INFO("Using Pin %i in digital mode\n", output);
|
||||
pinMode(output, OUTPUT);
|
||||
}
|
||||
setExternalOff(0);
|
||||
externalTurnedOn[0] = 0;
|
||||
if (moduleConfig.external_notification.output_vibra) {
|
||||
@@ -250,7 +266,12 @@ ExternalNotificationModule::ExternalNotificationModule()
|
||||
ProcessMessage ExternalNotificationModule::handleReceived(const meshtastic_MeshPacket &mp)
|
||||
{
|
||||
if (moduleConfig.external_notification.enabled) {
|
||||
|
||||
#if T_WATCH_S3
|
||||
drv.setWaveform(0, 75);
|
||||
drv.setWaveform(1, 56);
|
||||
drv.setWaveform(2, 0);
|
||||
drv.go();
|
||||
#endif
|
||||
if (getFrom(&mp) != nodeDB.getNodeNum()) {
|
||||
|
||||
// Check if the message contains a bell character. Don't do this loop for every pin, just once.
|
||||
@@ -343,7 +364,6 @@ ProcessMessage ExternalNotificationModule::handleReceived(const meshtastic_MeshP
|
||||
}
|
||||
setIntervalFromNow(0); // run once so we know if we should do something
|
||||
}
|
||||
|
||||
} else {
|
||||
LOG_INFO("External Notification Module Disabled\n");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user