From dd8a0d79d3e585686f8e98336f2ab2fb0ea23178 Mon Sep 17 00:00:00 2001 From: boerge1 Date: Thu, 15 Aug 2024 13:50:27 +0200 Subject: [PATCH 1/2] Issue_220: New shortcut for switching BT on/off --- README.md | 5 ++++- TonUINO-TNG.ino | 2 +- audio_messages_de.txt | 1 + sd-card/mp3/0324_mode_switch_bt.mp3 | Bin 0 -> 19480 bytes src/chip_card.hpp | 1 + src/mp3.hpp | 1 + src/state_machine.cpp | 10 ++++++++-- src/tonuino.cpp | 16 ++++++++++------ src/tonuino.hpp | 1 + 9 files changed, 27 insertions(+), 10 deletions(-) create mode 100644 sd-card/mp3/0324_mode_switch_bt.mp3 diff --git a/README.md b/README.md index 5ffa1ae..ba2d0a9 100644 --- a/README.md +++ b/README.md @@ -86,10 +86,13 @@ Eine Anleitung dafür findet man [hier](https://discourse.voss.earth/t/tonuino-s # Installation -Die SD Karte (Ordner mp3 und advert) hat sich gegenüber der Version 3.1.10 geändert. Hier kann man die Dateien downloaden: [tonuino.github.io/TonUINO-TNG/sd-card.zip](https://tonuino.github.io/TonUINO-TNG/sd-card.zip) +Die SD Karte (Ordner mp3 und advert) hat sich gegenüber der Version 3.1.11 geändert. Hier kann man die Dateien downloaden: [tonuino.github.io/TonUINO-TNG/sd-card.zip](https://tonuino.github.io/TonUINO-TNG/sd-card.zip) # Change Log +## Version 3.1.12 (15.08.2024) +- [Issue 220](https://github.com/tonuino/TonUINO-TNG/issues/220): New shortcut for switching BT on/off + ## Version 3.1.11 (31.07.2024) - [Issue 212](https://github.com/tonuino/TonUINO-TNG/issues/212): Sleep Timer Modification card doesn't work properly with NeoPixel Ring - [Issue 215](https://github.com/tonuino/TonUINO-TNG/issues/215): New optional Feature: Support BT Modul diff --git a/TonUINO-TNG.ino b/TonUINO-TNG.ino index ddf88d3..7e28696 100644 --- a/TonUINO-TNG.ino +++ b/TonUINO-TNG.ino @@ -35,7 +35,7 @@ void setup() LOG(init_log, s_error, F("TonUINO Version 3.1 - refactored by Boerge1\n")); LOG(init_log, s_error, F("created by Thorsten Voß and licensed under GNU/GPL.")); LOG(init_log, s_error, F("Information and contribution at https://tonuino.de.\n")); - LOG(init_log, s_error, F("V3.1.11 31.07.24\n")); + LOG(init_log, s_error, F("V3.1.12 15.08.24\n")); #ifdef TonUINO_Classic LOG(init_log, s_error, F("C "), lf_no); diff --git a/audio_messages_de.txt b/audio_messages_de.txt index e4943cb..08002cb 100644 --- a/audio_messages_de.txt +++ b/audio_messages_de.txt @@ -28,6 +28,7 @@ mp3/0320_mode_audio_book_single.mp3|Hörbuch Modus einzeln: Den nächsten Titel mp3/0321_mode_repeat_last_card.mp3|Wiederhole Karte Modus: Die letzte Karte oder der letzte Shortcut wird wiederholt. mp3/0322_mode_quiz_game.mp3|Quiz Spiel Modus: Spiele ein Quiz. mp3/0323_mode_memory_game.mp3|Memory Spiel Modus: Spiele ein Memory. +mp3/0324_mode_switch_bt.mp3|Switch Bluetooth: Schalte Bluetooth an oder aus. mp3/0327_select_file.mp3|OK, wähle nun bitte die Datei mit den Lautstärketasten aus. mp3/0328_select_first_file.mp3|OK, wähle nun bitte die Startdatei mit den Lautstärketasten aus. mp3/0329_select_last_file.mp3|Wähle nun bitte die Enddatei mit den Lautstärketasten aus. diff --git a/sd-card/mp3/0324_mode_switch_bt.mp3 b/sd-card/mp3/0324_mode_switch_bt.mp3 new file mode 100644 index 0000000000000000000000000000000000000000..6df2a76d3dfb74d0ca1f0e5c83a6464c0509b4fe GIT binary patch literal 19480 zcmZsiRZtvVw1o$Eg1fs14VvKY?(Xgy65J)YyE90D;2PZB9fC`6l3>#p{`+*R?s=H0 zo~fz+dhONw>~nUHtOOS<=xtDIsH;o9zP|&3U=&Qfta$j?ct5alu(SX7?fDFkMJgPKhX$16kzrH{c_|p+pqJIO2cI33ZMkRPizUG>G%g+;&(mUyMO;a-9H@XsDA51$`>v?ZUJu125@P{ z%MOjhZD3YmX%vMvX>iOUNW)-9!|6U^j+hw}PA)5K{i6>H%{XO;k2m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e91603 100644 --- a/src/chip_card.hpp +++ b/src/chip_card.hpp @@ -24,6 +24,7 @@ enum class pmode_t: uint8_t { repeat_last = 11, quiz_game = 12, memory_game = 13, + switch_bt = 14, // modifier modes sleep_timer = 1, diff --git a/src/mp3.hpp b/src/mp3.hpp index 4c7060d..43f9164 100644 --- a/src/mp3.hpp +++ b/src/mp3.hpp @@ -57,6 +57,7 @@ enum class mp3Tracks: uint16_t { t_321_mode_repeat_last_card = 321, t_322_mode_quiz_game = 322, t_323_mode_memory_game = 323, + t_324_mode_switch_bt = 324, t_327_select_file = 327, t_328_select_first_file = 328, t_329_select_last_file = 329, diff --git a/src/state_machine.cpp b/src/state_machine.cpp index 6bd7d5c..de0676c 100644 --- a/src/state_machine.cpp +++ b/src/state_machine.cpp @@ -140,7 +140,7 @@ void ChMode::entry() { folder = folderSettings{}; - numberOfOptions = 13; + numberOfOptions = 14; startMessage = mp3Tracks::t_310_select_mode; messageOffset = mp3Tracks::t_310_select_mode; preview = false; @@ -169,7 +169,7 @@ void ChMode::react(command_e const &cmd_e) { transit(); return; } - if (folder.mode == pmode_t::repeat_last) { + if (folder.mode == pmode_t::repeat_last || folder.mode == pmode_t::switch_bt) { folder.folder = 0xff; // dummy value > 0 to make readCard() returning true transit(); return; @@ -515,6 +515,12 @@ bool Base::readCard() { bool Base::handleShortcut(uint8_t shortCut) { folderSettings sc_folderSettings = settings.getShortCut(shortCut); if (sc_folderSettings.folder != 0) { +#ifdef BT_MODULE + if (sc_folderSettings.mode == pmode_t::switch_bt) { + tonuino.switchBtModuleOnOff(); + return false; // do not end the current play + } +#endif // BT_MODULE if (sc_folderSettings.mode != pmode_t::repeat_last) tonuino.setMyFolder(sc_folderSettings, false /*myFolderIsCard*/); if (tonuino.getFolder() != 0) { diff --git a/src/tonuino.cpp b/src/tonuino.cpp index c7f87e9..2819236 100644 --- a/src/tonuino.cpp +++ b/src/tonuino.cpp @@ -354,6 +354,15 @@ void Tonuino::shutdown() { } #ifdef BT_MODULE +void Tonuino::switchBtModuleOnOff() { + btModuleOn = not btModuleOn; + if (btModuleOn) + mp3.playAdvertisement(advertTracks::t_320_bt_on , false/*olnyIfIsPlaying*/); + else + mp3.playAdvertisement(advertTracks::t_321_bt_off, false/*olnyIfIsPlaying*/); + digitalWrite(btModuleOnPin, getLevel(btModuleOnPinType, btModuleOn ? level::active : level::inactive)); +} + void Tonuino::btModulePairing() { if (not btModulePairingTimer.isActive()) { mp3.playAdvertisement(advertTracks::t_322_bt_pairing, false/*olnyIfIsPlaying*/); @@ -405,12 +414,7 @@ bool Tonuino::specialCard(const folderSettings &nfcTag) { #ifdef BT_MODULE case pmode_t::bt_module: LOG(card_log, s_info, F("toggle bt module from "), btModuleOn); - btModuleOn = not btModuleOn; - if (btModuleOn) - mp3.playAdvertisement(advertTracks::t_320_bt_on , false/*olnyIfIsPlaying*/); - else - mp3.playAdvertisement(advertTracks::t_321_bt_off, false/*olnyIfIsPlaying*/); - digitalWrite(btModuleOnPin, getLevel(btModuleOnPinType, btModuleOn ? level::active : level::inactive)); + switchBtModuleOnOff(); break; #endif // BT_MODULE diff --git a/src/tonuino.hpp b/src/tonuino.hpp index 56ec5a4..33d9309 100644 --- a/src/tonuino.hpp +++ b/src/tonuino.hpp @@ -69,6 +69,7 @@ class Tonuino { #ifdef BT_MODULE bool isBtModuleOn() { return btModuleOn; } + void switchBtModuleOnOff(); void btModulePairing(); #endif From a18e14476117190c011a542c917f9b5b1293229d Mon Sep 17 00:00:00 2001 From: boerge1 Date: Mon, 19 Aug 2024 11:41:17 +0200 Subject: [PATCH 2/2] Issue_220: New shortcut for switching BT on/off * fix: now also cards work, created mith mode "switch bt" --- src/state_machine.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/state_machine.cpp b/src/state_machine.cpp index de0676c..0968037 100644 --- a/src/state_machine.cpp +++ b/src/state_machine.cpp @@ -480,6 +480,12 @@ bool Base::readCard() { case Chip_card::readCardEvent::none : return false; case Chip_card::readCardEvent::known: +#ifdef BT_MODULE + if (lastCardRead.mode == pmode_t::switch_bt) { + tonuino.switchBtModuleOnOff(); + return false; + } +#endif if (lastCardRead.folder == 0) { if (lastCardRead.mode == pmode_t::admin_card) { LOG(state_log, s_debug, str_Base(), str_to(), str_Admin_Entry());