Skip to content

Commit 8fabff6

Browse files
committed
Compile errors div architectures
1 parent eb294a8 commit 8fabff6

File tree

7 files changed

+47
-6
lines changed

7 files changed

+47
-6
lines changed

examples/build-arch-log.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
esp32:esp32:esp32 ./examples-stream/streams-generator-serial -> rc=0
2+
esp8266:esp8266:generic ./examples-stream/streams-generator-serial -> rc=0
3+
arduino:mbed_rp2040:pico ./examples-stream/streams-generator-serial -> rc=0
4+
rp2040:rp2040:generic ./examples-stream/streams-generator-serial -> rc=0
5+
arduino:avr:nano ./examples-stream/streams-generator-serial -> rc=0

examples/build-arch.sh

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/bin/bash
2+
##
3+
# We compile an example for different architectures using arduino-cli in order to identify compile errors
4+
# The return codes are made available in the build-examples-log.txt file.
5+
# -> rc=0: success
6+
# -> rc=1: error
7+
##
8+
git -C .. pull
9+
git -C ../../ESP32-A2DP pull
10+
11+
function compile_example {
12+
ARCH=$1
13+
FILE="./examples-stream/streams-generator-serial"
14+
# take action on each file. $f store current file name
15+
arduino-cli compile -b "$ARCH" "$FILE"
16+
EC=$?
17+
echo -e "$ARCH $FILE -> rc=$EC" >> "build-arch-log.txt"
18+
}
19+
20+
rm build-arch-log.txt
21+
compile_example "esp32:esp32:esp32"
22+
compile_example "esp8266:esp8266:generic"
23+
compile_example "arduino:mbed_rp2040:pico"
24+
compile_example "rp2040:rp2040:generic"
25+
compile_example "arduino:avr:nano"
26+
#compile_example "STMicroelectronics:stm32:GenF4"
27+

src/AudioConfig.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -407,8 +407,9 @@ typedef uint32_t eps32_i2s_sample_rate_type;
407407
#ifdef __AVR__
408408
#define USE_PWM
409409
#define USE_TIMER
410-
#include <Ethernet.h>
411-
#define USE_URL_ARDUINO
410+
// Uncomment to activate network
411+
//#include <Ethernet.h>
412+
//#define USE_URL_ARDUINO
412413
#ifndef assert
413414
#define assert(T)
414415
#endif

src/AudioEffects/AudioEffects.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#pragma once
2-
#include <variant>
2+
#if __cplusplus >= 201703L
3+
# include <variant>
4+
#endif
35
#include "AudioBasic/Collections.h"
46
#include "AudioEffects/SoundGenerator.h"
57
#include "AudioEffects/AudioEffect.h"

src/AudioTools/AudioStreams.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class AudioStream : public Stream, public AudioBaseInfoDependent, public AudioBa
5555
p_notify = &bi;
5656
}
5757

58-
virtual size_t readBytes(uint8_t *buffer, size_t length) override { return not_supported(0); }
58+
virtual size_t readBytes(uint8_t *buffer, size_t length) { return not_supported(0); }
5959

6060
virtual size_t write(const uint8_t *buffer, size_t size) override{ return not_supported(0); }
6161

src/AudioTools/AudioTypes.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#pragma once
22

3-
#include <type_traits>
3+
#ifdef USE_TYPETRAITS
4+
# include <type_traits>
5+
#endif
46
#include "AudioConfig.h"
57
#include "AudioTools/AudioLogger.h"
68
#include "AudioBasic/Int24.h"
@@ -181,8 +183,12 @@ class NumberConverter {
181183
/// provides the biggest number for the indicated type
182184
template <typename T>
183185
static int64_t maxValueT(){
186+
#ifdef USE_TYPETRAITS
184187
// int24_t uses 4 bytes instead of 3!
185188
return (std::is_same<T, int24_t>::value ) ? 8388607 : maxValue(sizeof(T)*8);
189+
#else
190+
return maxValue(sizeof(T)*8);
191+
#endif
186192
}
187193

188194
template <typename T>

src/AudioTools/Resample.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#pragma once
22

33
#include "AudioTools/AudioStreams.h"
4-
#include <algorithm> // std::max
4+
//#include <algorithm> // std::max
55

66
namespace audio_tools {
77

0 commit comments

Comments
 (0)