Skip to content

Commit

Permalink
IS_I2S_IMPLEMENTED and make SPDIFOutput optional
Browse files Browse the repository at this point in the history
  • Loading branch information
pschatzmann committed Aug 24, 2024
1 parent 284d525 commit 9538017
Show file tree
Hide file tree
Showing 13 changed files with 25 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* @copyright GPLv3
*/
#include "AudioTools.h"
#include "AudioLibs/SPDIFOutput.h"
#include "BluetoothA2DPSink.h"

AudioInfo info(44100, 2, 16);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/

#include "AudioTools.h"

#include "AudioLibs/SPDIFOutput.h"

AudioInfo info(44100, 2, 16);
SineWaveGenerator<int16_t> sineWave(32000); // subclass of SoundGenerator with max amplitude of 32000
Expand Down
4 changes: 3 additions & 1 deletion src/AudioI2S/I2SESP32.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@
#include "esp_system.h"

#ifndef I2S_MCLK_MULTIPLE_DEFAULT
#define I2S_MCLK_MULTIPLE_DEFAULT ((i2s_mclk_multiple_t)0)
# define I2S_MCLK_MULTIPLE_DEFAULT ((i2s_mclk_multiple_t)0)
#endif

#define IS_I2S_IMPLEMENTED

namespace audio_tools {

/**
Expand Down
3 changes: 3 additions & 0 deletions src/AudioI2S/I2SESP32V1.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
#include "driver/i2s_tdm.h"
#include "esp_system.h"

#define IS_I2S_IMPLEMENTED


namespace audio_tools {

/**
Expand Down
2 changes: 2 additions & 0 deletions src/AudioI2S/I2SESP8266.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
#include "AudioI2S/I2SConfig.h"
#include "AudioTools/AudioLogger.h"

#define IS_I2S_IMPLEMENTED

namespace audio_tools {

/**
Expand Down
2 changes: 2 additions & 0 deletions src/AudioI2S/I2SNanoSenseBLE.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
#include "AudioTools/AudioTypes.h"
#include "AudioTools/Buffers.h"

#define IS_I2S_IMPLEMENTED

namespace audio_tools {

static int i2s_buffer_size = 0;
Expand Down
2 changes: 2 additions & 0 deletions src/AudioI2S/I2SRP2040-MBED.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
#if defined(RP2040_MBED)
#include "RP2040-I2S.h"

#define IS_I2S_IMPLEMENTED

namespace audio_tools {

#if !defined(ARDUINO_ARCH_MBED_RP2040)
Expand Down
2 changes: 2 additions & 0 deletions src/AudioI2S/I2SRP2040.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
#if defined(RP2040_HOWER)
#include <I2S.h>

#define IS_I2S_IMPLEMENTED

namespace audio_tools {

/**
Expand Down
3 changes: 2 additions & 1 deletion src/AudioI2S/I2SSAMD.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

#if defined(ARDUINO_ARCH_SAMD)
#include <I2S.h>

#include "AudioI2S/I2SConfig.h"

#define IS_I2S_IMPLEMENTED

namespace audio_tools {

/**
Expand Down
4 changes: 4 additions & 0 deletions src/AudioI2S/I2SSTM32.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
#include "AudioI2S/I2SConfig.h"
#include "stm32-i2s.h"

#ifdef STM_I2S_PINS
#define IS_I2S_IMPLEMENTED

namespace audio_tools {

/**
Expand Down Expand Up @@ -415,3 +418,4 @@ using I2SDriver = I2SDriverSTM32;
} // namespace audio_tools

#endif
#endif
3 changes: 3 additions & 0 deletions src/AudioI2S/I2SStream.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
#include "AudioTools/AudioStreams.h"
#include "AudioTools/AudioTypes.h"

#if defined(IS_I2S_IMPLEMENTED)

namespace audio_tools {

/**
Expand Down Expand Up @@ -150,3 +152,4 @@ class I2SStream : public AudioStream {
} // namespace audio_tools

#endif
#endif
File renamed without changes.
4 changes: 0 additions & 4 deletions src/AudioTools.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,6 @@
# include "AudioEffects/Synthesizer.h"
#endif

#if defined(USE_I2S)
# include "AudioTools/AudioSPDIF.h"
#endif


/**
* -------------------------------------------------------------------------
Expand Down

0 comments on commit 9538017

Please sign in to comment.