Merge remote-tracking branch 'origin/wio-unified' into wio-unified

# Conflicts:
#	examples/companion_radio/DataStore.cpp
This commit is contained in:
Jakub
2026-06-04 17:13:49 +02:00
7 changed files with 52 additions and 19 deletions
@@ -38,6 +38,7 @@ class SettingsScreen : public UIScreen {
BUZZER_VOLUME,
DM_MELODY,
CH_MELODY,
AD_SOUND,
// Home pages section
SECTION_HOME_PAGES,
HOME_CLOCK, HOME_FAVOURITES, HOME_RECENT, HOME_RADIO, HOME_BT, HOME_ADVERT,
@@ -446,6 +447,12 @@ class SettingsScreen : public UIScreen {
{ static const char* L[] = { "built-in", "M1", "M2" };
uint8_t v = p ? p->notif_melody_ch : 0;
display.print(L[v < 3 ? v : 0]); }
} else if (item == AD_SOUND) {
display.print("AD sound");
display.setCursor(display.valCol(), y);
{ static const char* L[] = { "built-in", "M1", "M2" };
uint8_t v = p ? p->notif_melody_ad : 0;
display.print(L[v < 3 ? v : 0]); }
} else if (isHomePage(item)) {
if (p) ensurePageOrderInit(p);
int pos = homePagePosition(item, p);
@@ -696,6 +703,10 @@ public:
p->notif_melody_ch = (p->notif_melody_ch + (left ? 2 : 1)) % 3;
_dirty = true; return true;
}
if (_selected == AD_SOUND && p && (left || right || enter)) {
p->notif_melody_ad = (p->notif_melody_ad + (left ? 2 : 1)) % 3;
_dirty = true; return true;
}
if (isHomePage(_selected) && p) {
if (left || right) {
movePageInOrder(_selected, left ? -1 : 1, p);
+18 -1
View File
@@ -1448,11 +1448,28 @@ switch(t){
_last_notif_ch_idx = -1;
break;
}
case UIEventType::advertReceived: {
if (!buzzer.isQuiet()) {
int slot = _node_prefs ? (int)_node_prefs->notif_melody_ad : 0;
bool custom_played = false;
if (slot > 0 && _node_prefs) {
if (buzzer.isPlaying()) buzzer.stop(); // stop before overwriting _notif_mel_buf
buildMelodyFromPrefs(_node_prefs, slot, _notif_mel_buf, sizeof(_notif_mel_buf));
if (_notif_mel_buf[0]) {
buzzer.play(_notif_mel_buf);
custom_played = true;
}
}
if (!custom_played) {
buzzer.play("MsgRcv3:d=4,o=6,b=200:32e,32g,32b,16c7");
}
}
break;
}
case UIEventType::ack:
buzzer.play("ack:d=32,o=8,b=120:c");
break;
case UIEventType::roomMessage:
case UIEventType::newContactMessage:
case UIEventType::none:
default:
break;