Skip to content

Commit

Permalink
RP2040W: BT A2DP source demo [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
lyusupov committed Dec 11, 2023
1 parent 0ea832f commit d27d604
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
13 changes: 13 additions & 0 deletions software/firmware/source/SoftRF/src/driver/Bluetooth.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -993,6 +993,14 @@ IODev_ops_t nRF52_Bluetooth_ops = {
#include "Bluetooth.h"
#include "Battery.h"

#if defined(ENABLE_BT_VOICE)
#include "AudioTools.h"
#include "BTstack_A2DP.h"

SineWaveGenerator<int16_t> sineWave(32000);
GeneratedSoundStream<int16_t> in(sineWave);
#endif /* ENABLE_BT_VOICE */

static bool _running = false;
static mutex_t _mutex;
static bool _overflow = false;
Expand Down Expand Up @@ -1688,6 +1696,11 @@ static void CYW43_Bluetooth_setup()
}
break;
case BLUETOOTH_A2DP_SOURCE:
#if defined(ENABLE_BT_VOICE)
A2DPSource.setVolume(50);
A2DPSource.begin(in);
#endif
break;
case BLUETOOTH_NONE:
default:
break;
Expand Down
1 change: 1 addition & 0 deletions software/firmware/source/SoftRF/src/platform/RP2040.h
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ struct rst_info {
extern WebServer server;
/* Experimental */
#define ENABLE_PROL
//#define ENABLE_BT_VOICE
#else
#define EXCLUDE_WIFI
#define EXCLUDE_BLUETOOTH
Expand Down
2 changes: 1 addition & 1 deletion software/firmware/source/SoftRF/src/ui/Web.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ void handleSettings() {
<option %s value='%d'>Off</option>\
<option %s value='%d'>SPP</option>\
<option %s value='%d'>LE</option>\
<option %s value='%d'>A2DP</option>\
<!--<option %s value='%d'>A2DP</option>-->\
</select>\
</td>\
</tr>"),
Expand Down

0 comments on commit d27d604

Please sign in to comment.