mirror of
https://github.com/meshtastic/firmware.git
synced 2025-09-01 01:15:10 +00:00
I think this will fix portduino...
This commit is contained in:
parent
3b19040590
commit
d9d8c7eb74
@ -71,6 +71,7 @@ int32_t ExternalNotificationModule::runOnce()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// now let the PWM buzzer play
|
// now let the PWM buzzer play
|
||||||
|
#ifndef ARCH_PORTDUINO
|
||||||
if (moduleConfig.external_notification.use_pwm) {
|
if (moduleConfig.external_notification.use_pwm) {
|
||||||
if (rtttl::isPlaying()) {
|
if (rtttl::isPlaying()) {
|
||||||
rtttl::play();
|
rtttl::play();
|
||||||
@ -79,6 +80,7 @@ int32_t ExternalNotificationModule::runOnce()
|
|||||||
rtttl::begin(config.device.buzzer_gpio, pwmRingtone);
|
rtttl::begin(config.device.buzzer_gpio, pwmRingtone);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
return 25;
|
return 25;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -129,7 +131,9 @@ bool ExternalNotificationModule::getExternal(uint8_t index)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ExternalNotificationModule::stopNow() {
|
void ExternalNotificationModule::stopNow() {
|
||||||
|
#ifndef ARCH_PORTDUINO
|
||||||
rtttl::stop();
|
rtttl::stop();
|
||||||
|
#endif
|
||||||
nagCycleCutoff = 1; // small value
|
nagCycleCutoff = 1; // small value
|
||||||
setIntervalFromNow(0);
|
setIntervalFromNow(0);
|
||||||
}
|
}
|
||||||
@ -240,7 +244,9 @@ ProcessMessage ExternalNotificationModule::handleReceived(const MeshPacket &mp)
|
|||||||
if (!moduleConfig.external_notification.use_pwm) {
|
if (!moduleConfig.external_notification.use_pwm) {
|
||||||
setExternalOn(2);
|
setExternalOn(2);
|
||||||
} else {
|
} else {
|
||||||
|
#ifndef ARCH_PORTDUINO
|
||||||
rtttl::begin(config.device.buzzer_gpio, pwmRingtone);
|
rtttl::begin(config.device.buzzer_gpio, pwmRingtone);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
if (moduleConfig.external_notification.nag_timeout) {
|
if (moduleConfig.external_notification.nag_timeout) {
|
||||||
nagCycleCutoff = millis() + moduleConfig.external_notification.nag_timeout * 1000;
|
nagCycleCutoff = millis() + moduleConfig.external_notification.nag_timeout * 1000;
|
||||||
@ -276,7 +282,9 @@ ProcessMessage ExternalNotificationModule::handleReceived(const MeshPacket &mp)
|
|||||||
if (!moduleConfig.external_notification.use_pwm) {
|
if (!moduleConfig.external_notification.use_pwm) {
|
||||||
setExternalOn(2);
|
setExternalOn(2);
|
||||||
} else {
|
} else {
|
||||||
|
#ifndef ARCH_PORTDUINO
|
||||||
rtttl::begin(config.device.buzzer_gpio, pwmRingtone);
|
rtttl::begin(config.device.buzzer_gpio, pwmRingtone);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
if (moduleConfig.external_notification.nag_timeout) {
|
if (moduleConfig.external_notification.nag_timeout) {
|
||||||
nagCycleCutoff = millis() + moduleConfig.external_notification.nag_timeout * 1000;
|
nagCycleCutoff = millis() + moduleConfig.external_notification.nag_timeout * 1000;
|
||||||
|
@ -3,7 +3,9 @@
|
|||||||
#include "SinglePortModule.h"
|
#include "SinglePortModule.h"
|
||||||
#include "concurrency/OSThread.h"
|
#include "concurrency/OSThread.h"
|
||||||
#include "configuration.h"
|
#include "configuration.h"
|
||||||
|
#ifndef ARCH_PORTDUINO
|
||||||
#include <NonBlockingRtttl.h>
|
#include <NonBlockingRtttl.h>
|
||||||
|
#endif
|
||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user