Skip to content

Commit 19d470c

Browse files
committed
Compile Errors: div archs
1 parent 5234b04 commit 19d470c

File tree

7 files changed

+20
-27
lines changed

7 files changed

+20
-27
lines changed

examples/examples-stream/streams-generator-serial/streams-generator-serial.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ StreamCopy copier(out, sound); // copies sound to ou
1818
void setup(void) {
1919
// Open Serial
2020
Serial.begin(115200);
21-
AudioToolsLogger.begin(Serial, AudioToolsLogLevel::Warning);
21+
//AudioToolsLogger.begin(Serial, AudioToolsLogLevel::Warning);
2222

2323
// Define CSV Output
2424
out.begin(audio_info);

src/AudioConfig.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -605,8 +605,8 @@ using WiFiServerSecure = BearSSL::WiFiServerSecure;
605605
#undef DEFAULT_BUFFER_SIZE
606606
#define DEFAULT_BUFFER_SIZE 125
607607

608-
// #undef USE_AUDIO_LOGGING
609608
// logging is using too much memory
609+
#undef USE_AUDIO_LOGGING
610610
#undef LOG_PRINTF_BUFFER_SIZE
611611
#define LOG_PRINTF_BUFFER_SIZE 80
612612

src/AudioTools/AudioCodecs/MP3HeaderParser.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,9 +259,9 @@ class MP3HeaderParser {
259259
// LOGI("bit rate index: %d", getFrameHeader().BitrateIndex);
260260
LOGI("bit rate: %d", getBitRate());
261261
LOGI("Padding: %d", getFrameHeader().Padding);
262-
LOGI("Layer: %s (0x%x)", getLayerStr(), getFrameHeader().Layer);
262+
LOGI("Layer: %s (0x%x)", getLayerStr(),(int) getFrameHeader().Layer);
263263
LOGI("Version: %s (0x%x)", getVersionStr(),
264-
getFrameHeader().AudioVersion);
264+
(int)getFrameHeader().AudioVersion);
265265
LOGI("-------------------");
266266
}
267267
return is_valid_mp3;

src/AudioTools/AudioLibs/FFT/FFTReal.h

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ To Public License, Version 2, as published by Sam Hocevar. See
213213

214214
/*\\ INCLUDE FILES \\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
215215

216-
#include <cassert>
216+
#include <assert.h>
217217

218218

219219

@@ -479,8 +479,11 @@ To Public License, Version 2, as published by Sam Hocevar. See
479479

480480

481481
/*\\ INCLUDE FILES \\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
482-
483-
#include <cmath>
482+
#ifdef AVR
483+
# include <math.h>
484+
#else
485+
# include <cmath>
486+
#endif
484487

485488
namespace std { }
486489

@@ -713,13 +716,6 @@ To Public License, Version 2, as published by Sam Hocevar. See
713716

714717

715718

716-
/*\\ INCLUDE FILES \\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
717-
718-
#include <cassert>
719-
#include <cmath>
720-
721-
722-
723719
namespace ffft
724720
{
725721

@@ -1760,9 +1756,6 @@ To Public License, Version 2, as published by Sam Hocevar. See
17601756

17611757
/*\\ INCLUDE FILES \\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
17621758

1763-
#include <cassert>
1764-
1765-
17661759

17671760
namespace ffft
17681761
{
@@ -1961,9 +1954,6 @@ To Public License, Version 2, as published by Sam Hocevar. See
19611954

19621955
/*\\ INCLUDE FILES \\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
19631956

1964-
#include <cassert>
1965-
1966-
19671957

19681958
namespace ffft
19691959
{
@@ -3700,9 +3690,6 @@ inline float * FFTRealSelect <0>::sel_bin (float *e_ptr, float *o_ptr)
37003690
/*\\ EOF \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
37013691

37023692

3703-
#include <cassert>
3704-
#include <cmath>
3705-
37063693
namespace std { }
37073694

37083695

src/AudioTools/CoreAudio/AudioBasic/Collections/Allocator.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,14 @@ class Allocator {
4444
void* addr = allocate(sizeof(T) * len);
4545
T* addrT = (T*)addr;
4646
// call constructor
47+
#ifndef NO_INPLACE_INIT_SUPPORT
4748
for (int j = 0; j < len; j++) new (addrT + j) T();
49+
#else
50+
T default_value;
51+
for (int j = 0; j < len; j++) {
52+
memcpy((uint8_t*)addr+(j*sizeof(T)), &default_value, sizeof(T));
53+
}
54+
#endif
4855
return (T*)addr;
4956
}
5057

@@ -111,7 +118,7 @@ class AllocatorExt : public Allocator {
111118

112119
/**
113120
* @brief ESP32 Memory allocateator which forces the allocation with the defined
114-
* attirbutes
121+
* attributes (default MALLOC_CAP_8BIT | MALLOC_CAP_INTERNAL)
115122
* @ingroup memorymgmt
116123
* @author Phil Schatzmann
117124
* @copyright GPLv3

src/AudioTools/CoreAudio/AudioEffects/FFTEffects.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ class FFTWhisper : public FFTEffect {
151151
FFTBin bin;
152152
for (int n = 0; n < fft.size(); n++) {
153153
float amplitude = fft.magnitude(n);
154-
float phase = rand() / (float)RAND_MAX * 2.f * M_PI;
154+
float phase = rand() / (float)RAND_MAX * 2.f * PI;
155155

156156
// update new bin value
157157
bin.real = cosf(phase) * amplitude;

src/AudioTools/CoreAudio/AudioMetaData/MimeDetector.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,7 @@ class MimeDetector {
6767

6868
static bool checkAACExt(uint8_t* start, size_t len) {
6969
// quick check
70-
if (!start[0] == 0xFF &&
71-
(start[1] == 0xF0 || start[1] == 0xF1 || start[1] == 0xF9))
70+
if (!(start[0] == 0xFF && (start[1] == 0xF0 || start[1] == 0xF1 || start[1] == 0xF9)))
7271
return false;
7372
MP3HeaderParser mp3;
7473
// it should start with a synch word

0 commit comments

Comments
 (0)