RTTTL ringtones on T-Deck / T-Watch S3 and potentially more I2S audio enabled devices (#2917)

* WIP

* ESP8266 SAM fun

* I2S audio / ext. notification module

* Remove

* Protos

* Add use_i2s_as_buzzer from protos

* Fixes

* Stuff

* Thing

* Ext. Notification working(ish)

* Remove SAM commented code

* Trunk upgrade

* Trunk

* Fixes

* Slow not fast... :-|

* T-Deck and T-Watch don't use normal buttons

* Stop ext. notification nagging with touchscreen as well

* Add button gpio back for T-Deck, but guard against long-press during ext. notification

* Ext. notification wrap up

* Better place to guard against long-press false positives

* Adjust default gain and guard against non-i2s devices referencing audio-thread

* Simplify guard logic with a boolean

* Supress uninitMemberVar

* Protos merge got out of wack

* Trunk resolution

* Remove extra crap

* Cleanup and thread-interval

* Default to alert message buzzer and add nag timeout

* Formatting
This commit is contained in:
Ben Meadors
2023-12-12 08:36:37 -06:00
committed by GitHub
parent 35938392f1
commit d14d2c89c3
12 changed files with 179 additions and 18 deletions

View File

@@ -84,6 +84,11 @@ NRF52Bluetooth *nrf52Bluetooth;
#include "AmbientLightingThread.h"
#endif
#ifdef HAS_I2S
#include "AudioThread.h"
AudioThread *audioThread;
#endif
using namespace concurrency;
// We always create a screen object, but we only init it if we find the hardware
@@ -122,6 +127,7 @@ ATECCX08A atecc;
#ifdef T_WATCH_S3
Adafruit_DRV2605 drv;
#endif
bool isVibrating = false;
bool eink_found = true;
@@ -671,6 +677,11 @@ void setup()
}
nodeStatus->observe(&nodeDB.newStatus);
#ifdef HAS_I2S
LOG_DEBUG("Starting audio thread\n");
audioThread = new AudioThread();
#endif
service.init();
// Now that the mesh service is created, create any modules
@@ -880,7 +891,6 @@ void setup()
// This must be _after_ service.init because we need our preferences loaded from flash to have proper timeout values
PowerFSM_setup(); // we will transition to ON in a couple of seconds, FIXME, only do this for cold boots, not waking from SDS
powerFSMthread = new PowerFSMThread();
setCPUFast(false); // 80MHz is fine for our slow peripherals
}