Browse Source

Squashed 'dtmf_dolphin/' changes from f7e924b09..5793814f1

5793814f1 fix catalog versions
92645d9b7 combine 1
418b66edd move base pack here
REVERT: f7e924b09 Update README.md
REVERT: 837ce097b Merge pull request #9 from xMasterX/redbox_ca_fix
REVERT: fba220c52 Add Redbox (CA) to menu, apply ./fbt format
REVERT: 6006c9faa Merge pull request #7 from LambdaCalculus37/main
REVERT: db16f7277 Fixed tone generation for Redbox (CA) to add second tone set to 0.0 to satisfy PR issue and to follow with Redbox (US) and Redbox (UK) data
REVERT: 320015c93 Added redbox data for Canadaian payphone coin tones
REVERT: 610de49db Update README.md
REVERT: a443d346b Redbox functionality complete!
REVERT: 5e8e55908 Fixed misc menu.
REVERT: 85a5fed3d Cleanup and fixing misc menu.
REVERT: 3b366ce8e Merge pull request #3 from kowalski7cc/fap-icon
REVERT: 90cc9b0b3 Updated for upstream flipperzero 0.69. Nice.
REVERT: d4821c4ff Add fap icon
REVERT: a2b5ccc8f Update README.md
REVERT: 368dbed09 Added some edumacational links
REVERT: fd0895acd Update README.md
REVERT: 75c011812 Create LICENSE
REVERT: 78050ffe8 Merge pull request #2 from litui/refactor
REVERT: cb02b7280 Now functional as dialer and bluebox.
REVERT: 1f0730d2b Refactor in progress. Many items not working.
REVERT: 508d20aa7 Tweaked README, added image.
REVERT: 4754832d1 Migrated existing state to a new repo.

git-subtree-dir: dtmf_dolphin
git-subtree-split: 5793814f172ea710281620cb0dd4a22540b5ad3a
Willy-JL 2 years ago
parent
commit
9f06522d9f
8 changed files with 17 additions and 10 deletions
  1. 3 3
      README.md
  2. 3 1
      application.fam
  3. 11 6
      dtmf_dolphin_audio.c
  4. BIN
      img/1.png
  5. BIN
      img/2.png
  6. BIN
      img/3.png
  7. BIN
      phone.png
  8. 0 0
      pics/dialer.jpg

+ 3 - 3
README.md

@@ -1,4 +1,6 @@
-![Image](assets/dialer.jpg)
+![Image](pics/dialer.jpg)
+
+[Original Link](https://github.com/litui/dtmf_dolphin)
 
 
 ## DTMF Dolphin
 ## DTMF Dolphin
 
 
@@ -8,8 +10,6 @@ Now in a release-ready state for both Dialer, Bluebox, and Redbox (US/UK) functi
 
 
 Please note that using the current tone output method, the 2600 tone is scaled about 33 Hz higher than it should be. This is a limitation of the current sample rate.
 Please note that using the current tone output method, the 2600 tone is scaled about 33 Hz higher than it should be. This is a limitation of the current sample rate.
 
 
-This is for educational/entertainment purposes only. While the code generates sine waves, the buzzer on the Flipper Zero uses PWM which interferes with the cleanness of the signal. While the tones generated sound fairly accurate, they may not be detected by DTMF applications. This is a hardware limitation.
-
 ### Educational Links:
 ### Educational Links:
 
 
 * http://www.phrack.org/issues/25/7.html#article
 * http://www.phrack.org/issues/25/7.html#article

+ 3 - 1
application.fam

@@ -3,7 +3,6 @@ App(
     name="DTMF Dolphin",
     name="DTMF Dolphin",
     apptype=FlipperAppType.EXTERNAL,
     apptype=FlipperAppType.EXTERNAL,
     entry_point="dtmf_dolphin_app",
     entry_point="dtmf_dolphin_app",
-    cdefines=["DTMF_DOLPHIN"],
     requires=[
     requires=[
         "storage",
         "storage",
         "gui",
         "gui",
@@ -13,4 +12,7 @@ App(
     stack_size=8 * 1024,
     stack_size=8 * 1024,
     order=20,
     order=20,
     fap_category="Tools",
     fap_category="Tools",
+    fap_author="@litui & @xMasterX",
+    fap_version="1.2",
+    fap_description="DTMF (Dual-Tone Multi-Frequency) dialer, Bluebox, and Redbox.",
 )
 )

+ 11 - 6
dtmf_dolphin_audio.c

@@ -214,16 +214,20 @@ bool dtmf_dolphin_audio_play_tones(
     generate_waveform(current_player, 0);
     generate_waveform(current_player, 0);
     generate_waveform(current_player, current_player->half_buffer_length);
     generate_waveform(current_player, current_player->half_buffer_length);
 
 
-    dtmf_dolphin_speaker_init();
     dtmf_dolphin_dma_init((uint32_t)current_player->sample_buffer, current_player->buffer_length);
     dtmf_dolphin_dma_init((uint32_t)current_player->sample_buffer, current_player->buffer_length);
 
 
     furi_hal_interrupt_set_isr(
     furi_hal_interrupt_set_isr(
         FuriHalInterruptIdDma1Ch1, dtmf_dolphin_audio_dma_isr, current_player->queue);
         FuriHalInterruptIdDma1Ch1, dtmf_dolphin_audio_dma_isr, current_player->queue);
-
-    dtmf_dolphin_dma_start();
-    dtmf_dolphin_speaker_start();
-    current_player->playing = true;
-    return true;
+    if(furi_hal_speaker_acquire(1000)) {
+        dtmf_dolphin_speaker_init();
+        dtmf_dolphin_dma_start();
+        dtmf_dolphin_speaker_start();
+        current_player->playing = true;
+        return true;
+    } else {
+        current_player->playing = false;
+        return false;
+    }
 }
 }
 
 
 bool dtmf_dolphin_audio_stop_tones() {
 bool dtmf_dolphin_audio_stop_tones() {
@@ -238,6 +242,7 @@ bool dtmf_dolphin_audio_stop_tones() {
     }
     }
     dtmf_dolphin_speaker_stop();
     dtmf_dolphin_speaker_stop();
     dtmf_dolphin_dma_stop();
     dtmf_dolphin_dma_stop();
+    furi_hal_speaker_release();
 
 
     furi_hal_interrupt_set_isr(FuriHalInterruptIdDma1Ch1, NULL, NULL);
     furi_hal_interrupt_set_isr(FuriHalInterruptIdDma1Ch1, NULL, NULL);
 
 

BIN
img/1.png


BIN
img/2.png


BIN
img/3.png


BIN
phone.png


+ 0 - 0
assets/dialer.jpg → pics/dialer.jpg