Skip to content

Commit 7608b44

Browse files
committed
Compile errors in IDF
1 parent 6a7f239 commit 7608b44

File tree

8 files changed

+27
-23
lines changed

8 files changed

+27
-23
lines changed

src/AudioBasic/Int24.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class int24_t {
4343
set((int32_t)in);
4444
}
4545

46-
#if defined(STM32) || defined(ESP32C3) || defined(TARGET_RP2040)
46+
#if defined(STM32) || defined(ESP32C3) || defined(TARGET_RP2040) || !defined(ARDUINO)
4747

4848
int24_t(const int &in) {
4949
set(in);

src/AudioCodecs/CodecMP3LAME.h

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -94,19 +94,6 @@ class MP3EncoderLAME : public AudioEncoder {
9494
enc->begin();
9595
}
9696

97-
// /**
98-
// * @brief Opens the encoder
99-
// *
100-
// * @param input_channels
101-
// * @param input_sample_rate
102-
// * @param input_bits_per_sample
103-
// */
104-
// void begin(int input_channels, int input_sample_rate, int input_bits_per_sample) {
105-
// TRACED();
106-
// createEnc();
107-
// enc->begin(input_channels, input_sample_rate, input_bits_per_sample);
108-
// }
109-
11097

11198
AudioInfoLAME &audioInfo(){
11299
return info;
@@ -153,10 +140,13 @@ class MP3EncoderLAME : public AudioEncoder {
153140

154141
// Create enc only at begin so that we can use psram
155142
void createEnc(){
143+
TRACED();
156144
if (enc==nullptr){
157145
enc = new liblame::MP3EncoderLAME();
158146
if (p_print!=nullptr){
159147
setOutputStream(*p_print);
148+
} else {
149+
LOGE("Output undefined");
160150
}
161151
AudioInfoLAME tmp;
162152
tmp.channels = info.channels;

src/AudioHttp/HttpRequest.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#pragma once
2+
#include "AudioConfig.h"
3+
#ifdef USE_URL_ARDUINO
24

35
#include "AudioHttp/HttpTypes.h"
46
#include "AudioHttp/HttpHeader.h"
@@ -288,3 +290,5 @@ class HttpRequest {
288290
};
289291

290292
}
293+
294+
#endif

src/AudioLibs/AudioKit.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,10 @@ friend class AudioKitStream;
4343
result.fmt = toFormat();
4444
result.sample_rate = toSampleRate();
4545
result.bits_per_sample = toBits();
46+
#if defined(ESP32)
4647
result.buffer_size = buffer_size;
4748
result.buffer_count = buffer_count;
49+
#endif
4850
// we use the AudioKit library only to set up the codec
4951
result.i2s_active = false;
5052
#if AUDIOKIT_SETUP_SD
@@ -67,8 +69,10 @@ friend class AudioKitStream;
6769
pin_ws = pins.ws_io_num;
6870
pin_data = pins.data_out_num;
6971
pin_data_rx = pins.data_in_num;
70-
#if ESP_IDF_VERSION > ESP_IDF_VERSION_VAL(4, 4, 0)
72+
#if defined(ESP32)
73+
# if ESP_IDF_VERSION > ESP_IDF_VERSION_VAL(4, 4, 0)
7174
pin_mck = 0;
75+
# endif
7276
#endif
7377
};
7478

src/AudioLibs/NoArduino.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ extern uint64_t millis();
164164

165165
} // namespace
166166

167-
#if defined(ESP32) || defined(ESP32_CMAKE)
167+
#if defined(ESP32)
168168
#include "driver/gpio.h"
169169
/// e.g. for AudioActions
170170
int digitalRead(int pin) {
@@ -194,10 +194,6 @@ void pinMode(int pin, int mode) {
194194
}
195195
}
196196

197-
#else
198-
/// e.g. for AudioActions
199-
int digitalRead(int pin);
200-
void pinMode(int pin, int mode);
201197
#endif
202198

203199
using namespace audio_tools;

src/AudioMetaData/MetaData.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#pragma once
2-
32
#include <stdlib.h>
3+
#include "AudioConfig.h"
44
#include "AudioTools/AudioTypes.h"
55
#include "AudioTools/AudioStreams.h"
66
#include "AudioMetaData/MetaDataICY.h"
@@ -41,6 +41,8 @@ class MetaDataPrint : public AudioPrint {
4141
callback = fn;
4242
}
4343

44+
#ifdef USE_URL_ARDUINO
45+
4446
/// Starts the processing - iceMetaint is determined from the HttpRequest
4547
virtual void begin(HttpRequest &http) {
4648
TRACED();
@@ -49,13 +51,18 @@ class MetaDataPrint : public AudioPrint {
4951
icySetup.executeCallback(callback);
5052
begin(metaInt);
5153
}
54+
#endif
5255

5356
/// Starts the processing - if iceMetaint is defined we use icecast
5457
virtual void begin(int iceMetaint=0) {
5558
LOGD("%s: %d", LOG_METHOD, iceMetaint);
5659
if (callback!=nullptr){
5760
if (meta == nullptr) {
61+
#if defined(USE_URL_ARDUINO)
5862
meta = (iceMetaint > 0) ? new MetaDataICY() : (AbstractMetaData *) new MetaDataID3();
63+
#else
64+
meta = new MetaDataID3();
65+
#endif
5966
}
6067
meta->setCallback(callback);
6168
meta->setIcyMetaInt(iceMetaint);

src/AudioMetaData/MetaDataICY.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#pragma once
2+
#include "AudioConfig.h"
3+
#ifdef USE_URL_ARDUINO
24

35
#include "AudioMetaData/AbstractMetaData.h"
46
#include "AudioBasic/Str.h"
@@ -305,4 +307,6 @@ class ICYUrlSetup {
305307

306308
};
307309

308-
}
310+
}
311+
312+
#endif

src/AudioTools/AudioTypes.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,6 @@ T readSample(Stream* p_stream){
266266
/// guaranteed to return the requested data
267267
template<typename T>
268268
size_t readSamples(Stream* p_stream, T* data, int samples){
269-
T result=0;
270269
uint8_t *p_result = (uint8_t*) data;
271270
int open = samples*sizeof(T);
272271
int total = 0;

0 commit comments

Comments
 (0)