Skip to content

Commit 7d53727

Browse files
committed
Basic zephyr support
1 parent 7aac18f commit 7d53727

File tree

4 files changed

+21
-21
lines changed

4 files changed

+21
-21
lines changed

examples/build-arch-log.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,6 @@ rp2040:rp2040:generic ./examples-stream/streams-generator-serial -> rc=0
99
arduino:avr:nano ./examples-stream/streams-generator-serial -> rc=0
1010
arduino:samd:arduino_zero_native ./examples-stream/streams-generator-serial -> rc=0
1111
arduino:renesas_uno:unor4wifi ./examples-stream/streams-generator-serial -> rc=0
12+
arduino:mbed_nano:nano33ble ./examples-stream/streams-generator-serial -> rc=0
13+
arduino:zephyr:nano33ble ./examples-stream/streams-generator-serial -> rc=0
14+
arduino:mbed_rp2040:pico ./examples-stream/streams-generator-serial -> rc=0

examples/build-arch.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,9 @@ compile_example "rp2040:rp2040:generic"
2929
compile_example "arduino:avr:nano"
3030
compile_example "arduino:samd:arduino_zero_native"
3131
compile_example "arduino:renesas_uno:unor4wifi"
32-
#compile_example "arduino:mbed_nano:nanorp2040connect"
33-
#compile_example "arduino:mbed_rp2040:pico"
32+
compile_example "arduino:mbed_nano:nano33ble"
33+
compile_example "arduino:zephyr:nano33ble"
34+
compile_example "arduino:mbed_rp2040:pico"
3435
#compile_example "STMicroelectronics:stm32:GenF4"
3536

3637
./cleanup.sh

src/AudioConfig.h

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,6 @@ typedef WiFiClient WiFiClientSecure;
286286
#endif
287287

288288
#define USE_TYPETRAITS
289-
#define USE_EFFECTS_SUITE
290289
#define USE_STREAM_WRITE_OVERRIDE
291290
#define USE_STREAM_READ_OVERRIDE
292291
#define USE_TOUCH_READ
@@ -356,7 +355,6 @@ typedef uint32_t eps32_i2s_sample_rate_type;
356355
#define USE_I2S
357356
#define USE_AUDIO_SERVER
358357
#define USE_TYPETRAITS
359-
#define USE_EFFECTS_SUITE
360358
#define USE_TIMER
361359
#define USE_STREAM_WRITE_OVERRIDE
362360
#define USE_STREAM_READ_OVERRIDE
@@ -413,7 +411,6 @@ typedef uint32_t eps32_i2s_sample_rate_type;
413411
#define USE_I2S
414412
#define USE_PDM
415413
#define USE_TYPETRAITS
416-
#define USE_EFFECTS_SUITE
417414
#define USE_TIMER
418415
#define USE_STREAM_WRITE_OVERRIDE
419416
#define USE_STREAM_READ_OVERRIDE
@@ -447,7 +444,6 @@ typedef uint32_t eps32_i2s_sample_rate_type;
447444
//#define USE_URL_ARDUINO // commented out because of compile errors
448445
#define USE_I2S
449446
#define USE_TYPETRAITS
450-
#define USE_EFFECTS_SUITE
451447
#define USE_TIMER
452448
#define USE_WIFI
453449
#define USE_AUDIO_SERVER
@@ -471,13 +467,12 @@ typedef uint32_t eps32_i2s_sample_rate_type;
471467
#endif
472468

473469
//------ NANO33BLE ----------
474-
#if defined(ARDUINO_SEEED_XIAO_NRF52840_SENSE) || defined(ARDUINO_ARDUINO_NANO33BLE)
470+
#if (defined(ARDUINO_SEEED_XIAO_NRF52840_SENSE) || defined(ARDUINO_ARDUINO_NANO33BLE) || defined(ARDUINO_ARCH_MBED_NANO)) && !defined(ARDUINO_ARCH_ZEPHYR)
475471
#define USE_NANO33BLE
476472
#define USE_INT24_FROM_INT
477473
#define USE_I2S
478474
#define USE_PWM
479475
#define USE_TYPETRAITS
480-
#define USE_EFFECTS_SUITE
481476
#define USE_TIMER
482477
//#define USE_INITIALIZER_LIST
483478
#define USE_ALT_PIN_SUPPORT
@@ -493,15 +488,14 @@ typedef uint32_t eps32_i2s_sample_rate_type;
493488
#define PIN_CS SS
494489
#endif
495490

496-
//----- MBED -----------
497-
#if defined(ARDUINO_ARCH_MBED_RP2040) || defined(ARDUINO_ARCH_MBED_NANO)
491+
//----- RP2040 MBED -----------
492+
#if defined(ARDUINO_ARCH_MBED_RP2040)
498493
// install https://github.com/pschatzmann/rp2040-i2s
499494
#define RP2040_MBED
500495
#define USE_I2S 1
501496
#define USE_PWM
502497
#define USE_ANALOG_ARDUINO
503498
#define USE_TYPETRAITS
504-
#define USE_EFFECTS_SUITE
505499
#define USE_TIMER
506500
#define USE_INT24_FROM_INT
507501

@@ -537,7 +531,6 @@ typedef uint32_t eps32_i2s_sample_rate_type;
537531
#define USE_PWM
538532
#define USE_ANALOG_ARDUINO
539533
#define USE_TYPETRAITS
540-
#define USE_EFFECTS_SUITE
541534
#define USE_TIMER
542535
#define USE_INT24_FROM_INT
543536

@@ -566,7 +559,7 @@ typedef uint32_t eps32_i2s_sample_rate_type;
566559
#define ANALOG_BUFFERS 100
567560
#endif
568561

569-
#define USE_CONCURRENCY
562+
//#define USE_CONCURRENCY
570563
#define USE_SD_SUPPORTS_SPI
571564

572565
// default pins for VS1053 shield
@@ -695,7 +688,6 @@ using WiFiServerSecure = BearSSL::WiFiServerSecure;
695688
#define IS_MBED
696689
#define USE_INT24_FROM_INT
697690
#define USE_TYPETRAITS
698-
#define USE_EFFECTS_SUITE
699691
#define USE_ANALOG
700692
#define USE_STREAM_WRITE_OVERRIDE
701693
#define ANALOG_BUFFER_SIZE 1024
@@ -717,7 +709,6 @@ using WiFiServerSecure = BearSSL::WiFiServerSecure;
717709
#define IS_MBED
718710
#define USE_INT24_FROM_INT
719711
#define USE_TYPETRAITS
720-
#define USE_EFFECTS_SUITE
721712
#define USE_ANALOG
722713
#define USE_TIMER
723714
#define USE_PWM
@@ -743,7 +734,6 @@ using WiFiServerSecure = BearSSL::WiFiServerSecure;
743734
#define USE_INT24_FROM_INT
744735
#define IS_RENESAS 1
745736
#define USE_TYPETRAITS
746-
#define USE_EFFECTS_SUITE
747737
#define USE_TIMER
748738
#define USE_PWM
749739
#define PIN_PWM_START D2
@@ -774,6 +764,13 @@ using WiFiServerSecure = BearSSL::WiFiServerSecure;
774764

775765
#endif
776766

767+
768+
// ------ Zephyr -------
769+
#ifdef ARDUINO_ARCH_ZEPHYR
770+
# define IS_ZEPHYR
771+
# define NO_INPLACE_INIT_SUPPORT
772+
#endif
773+
777774
//------ VS1053 ----------
778775
// see https://github.com/pschatzmann/arduino-vs1053/wiki/Pinouts-for-Processors-and-Tested-Boards#microcontrollers
779776
// Default Pins for VS1053
@@ -840,6 +837,7 @@ using WiFiServerSecure = BearSSL::WiFiServerSecure;
840837
#pragma GCC diagnostic ignored "-Wvla"
841838
#pragma GCC diagnostic ignored "-Wsign-compare"
842839
#pragma GCC diagnostic ignored "-Woverloaded-virtual"
840+
#pragma GCC diagnostic ignored "-Wdouble-promotion"
843841

844842
#ifdef USE_NO_MEMACCESS
845843
#pragma GCC diagnostic ignored "-Wclass-memaccess"

src/AudioTools/CoreAudio/AudioMetaData/MetaDataID3.h

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@
1111
#include <ctype.h>
1212
#include "AbstractMetaData.h"
1313

14-
#ifdef IS_RENESAS
15-
// This is needed for renesas
16-
int isascii(int c);
17-
#endif
1814

1915
/**
2016
* @defgroup metadata-id3 ID3
@@ -473,13 +469,15 @@ class MetaDataID3V2 : public MetaDataID3Base {
473469
total_len += len;
474470

475471
}
472+
473+
int isCharAscii(int ch) {return ch >= 0 && ch < 128; }
476474

477475
/// Make sure that the result is a valid ASCII string
478476
bool isAscii(int l){
479477
// check on first 10 characters
480478
int m = l < 5 ? l : 10;
481479
for (int j=0; j<m; j++){
482-
if (!isascii(result[j])) {
480+
if (!isCharAscii(result[j])) {
483481
return false;
484482
}
485483
}

0 commit comments

Comments
 (0)