Skip to content

Commit 9f06522

Browse files
committed
Squashed 'dtmf_dolphin/' changes from f7e924b..5793814
5793814 fix catalog versions 92645d9 combine 1 418b66e move base pack here REVERT: f7e924b Update README.md REVERT: 837ce09 Merge pull request #9 from xMasterX/redbox_ca_fix REVERT: fba220c Add Redbox (CA) to menu, apply ./fbt format REVERT: 6006c9f Merge pull request #7 from LambdaCalculus37/main REVERT: db16f72 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: 320015c Added redbox data for Canadaian payphone coin tones REVERT: 610de49 Update README.md REVERT: a443d34 Redbox functionality complete! REVERT: 5e8e559 Fixed misc menu. REVERT: 85a5fed Cleanup and fixing misc menu. REVERT: 3b366ce Merge pull request #3 from kowalski7cc/fap-icon REVERT: 90cc9b0 Updated for upstream flipperzero 0.69. Nice. REVERT: d4821c4 Add fap icon REVERT: a2b5ccc Update README.md REVERT: 368dbed Added some edumacational links REVERT: fd0895a Update README.md REVERT: 75c0118 Create LICENSE REVERT: 78050ff Merge pull request #2 from litui/refactor REVERT: cb02b72 Now functional as dialer and bluebox. REVERT: 1f0730d Refactor in progress. Many items not working. REVERT: 508d20a Tweaked README, added image. REVERT: 4754832 Migrated existing state to a new repo. git-subtree-dir: dtmf_dolphin git-subtree-split: 5793814
1 parent f7e924b commit 9f06522

8 files changed

+17
-10
lines changed

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
![Image](assets/dialer.jpg)
1+
![Image](pics/dialer.jpg)
2+
3+
[Original Link](https://github.com/litui/dtmf_dolphin)
24

35
## DTMF Dolphin
46

@@ -8,8 +10,6 @@ Now in a release-ready state for both Dialer, Bluebox, and Redbox (US/UK) functi
810

911
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.
1012

11-
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.
12-
1313
### Educational Links:
1414

1515
* http://www.phrack.org/issues/25/7.html#article

application.fam

+3-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ App(
33
name="DTMF Dolphin",
44
apptype=FlipperAppType.EXTERNAL,
55
entry_point="dtmf_dolphin_app",
6-
cdefines=["DTMF_DOLPHIN"],
76
requires=[
87
"storage",
98
"gui",
@@ -13,4 +12,7 @@ App(
1312
stack_size=8 * 1024,
1413
order=20,
1514
fap_category="Tools",
15+
fap_author="@litui & @xMasterX",
16+
fap_version="1.2",
17+
fap_description="DTMF (Dual-Tone Multi-Frequency) dialer, Bluebox, and Redbox.",
1618
)

dtmf_dolphin_audio.c

+11-6
Original file line numberDiff line numberDiff line change
@@ -214,16 +214,20 @@ bool dtmf_dolphin_audio_play_tones(
214214
generate_waveform(current_player, 0);
215215
generate_waveform(current_player, current_player->half_buffer_length);
216216

217-
dtmf_dolphin_speaker_init();
218217
dtmf_dolphin_dma_init((uint32_t)current_player->sample_buffer, current_player->buffer_length);
219218

220219
furi_hal_interrupt_set_isr(
221220
FuriHalInterruptIdDma1Ch1, dtmf_dolphin_audio_dma_isr, current_player->queue);
222-
223-
dtmf_dolphin_dma_start();
224-
dtmf_dolphin_speaker_start();
225-
current_player->playing = true;
226-
return true;
221+
if(furi_hal_speaker_acquire(1000)) {
222+
dtmf_dolphin_speaker_init();
223+
dtmf_dolphin_dma_start();
224+
dtmf_dolphin_speaker_start();
225+
current_player->playing = true;
226+
return true;
227+
} else {
228+
current_player->playing = false;
229+
return false;
230+
}
227231
}
228232

229233
bool dtmf_dolphin_audio_stop_tones() {
@@ -238,6 +242,7 @@ bool dtmf_dolphin_audio_stop_tones() {
238242
}
239243
dtmf_dolphin_speaker_stop();
240244
dtmf_dolphin_dma_stop();
245+
furi_hal_speaker_release();
241246

242247
furi_hal_interrupt_set_isr(FuriHalInterruptIdDma1Ch1, NULL, NULL);
243248

img/1.png

1.63 KB
Loading

img/2.png

2.21 KB
Loading

img/3.png

2.27 KB
Loading

phone.png

8.22 KB
Loading

assets/dialer.jpg pics/dialer.jpg

File renamed without changes.

0 commit comments

Comments
 (0)