Skip to content

Commit 1b17baf

Browse files
committed
Add support for DxCore (resolves #34)
1 parent 8859ec0 commit 1b17baf

7 files changed

Lines changed: 41 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
StreamUtils - Change log
22
========================
33

4+
HEAD
5+
----
6+
7+
* Add support for DxCore (issue #34)
8+
49
1.7.3 (2023/03/08)
510
-----
611

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,9 +379,11 @@ This library relies on `Client`, `Print`, and `Stream` definitions, which unfort
379379
It has been tested on the following cores:
380380
381381
* [AVR](https://github.com/arduino/ArduinoCore-avr)
382+
* [DxCore](https://github.com/SpenceKonde/DxCore)
382383
* [ESP32](https://github.com/espressif/arduino-esp32)
383384
* [ESP8266](https://github.com/esp8266/Arduino)
384385
* [mbed](https://github.com/arduino/ArduinoCore-mbed)
386+
* [megaAVR](https://github.com/arduino/ArduinoCore-avr)
385387
* [nRF52](https://github.com/adafruit/Adafruit_nRF52_Arduino)
386388
* [RP2040](https://github.com/earlephilhower/arduino-pico)
387389
* [SAMD](https://github.com/arduino/ArduinoCore-samd)

extras/test/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ function(add_streamutils_test EXECUTABLE CORE)
1818
endfunction()
1919

2020
add_subdirectory(cores/avr)
21+
add_subdirectory(cores/dxcore)
2122
add_subdirectory(cores/esp32)
2223
add_subdirectory(cores/esp8266)
2324
add_subdirectory(cores/mbed)
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# StreamUtils - github.com/bblanchon/ArduinoStreamUtils
2+
# Copyright Benoit Blanchon 2019-2023
3+
# MIT License
4+
5+
add_library(DxCore
6+
EEPROM.cpp
7+
EEPROM.h
8+
)
9+
10+
target_include_directories(DxCore
11+
INTERFACE
12+
${CMAKE_CURRENT_SOURCE_DIR}
13+
${CMAKE_CURRENT_SOURCE_DIR}/../avr
14+
)
15+
16+
target_compile_definitions(DxCore
17+
PUBLIC
18+
ARDUINO_avrda
19+
ARDUINO_ARCH_MEGAAVR
20+
DXCORE=\"$\"
21+
DXCORE_MAJOR=1UL
22+
DXCORE_MINOR=5UL
23+
DXCORE_PATCH=11UL
24+
DXCORE_RELEASED=1
25+
)
26+
27+
add_streamutils_test(StreamUtilsTestDxCore DxCore)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
#include "../avr/EEPROM.cpp"

extras/test/cores/dxcore/EEPROM.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
#include "../avr/EEPROM.h"

src/StreamUtils/Configuration.hpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@
3636
#ifndef STREAMUTILS_ENABLE_EEPROM
3737
#if defined(ARDUINO_ARCH_AVR) || defined(ARDUINO_ARCH_ESP8266) || \
3838
defined(ARDUINO_ARCH_ESP32) || defined(ARDUINO_PICO_MAJOR) || \
39-
defined(ARDUINO_ARCH_STM32) || defined(CORE_TEENSY)
39+
defined(ARDUINO_ARCH_STM32) || defined(CORE_TEENSY) || \
40+
defined(ARDUINO_ARCH_MEGAAVR)
4041
#define STREAMUTILS_ENABLE_EEPROM 1
4142
#else
4243
#define STREAMUTILS_ENABLE_EEPROM 0
@@ -53,7 +54,8 @@
5354
#endif
5455

5556
#ifndef STREAMUTILS_USE_EEPROM_UPDATE
56-
#if defined(ARDUINO_ARCH_AVR) || defined(CORE_TEENSY)
57+
#if defined(ARDUINO_ARCH_AVR) || defined(CORE_TEENSY) || \
58+
defined(ARDUINO_ARCH_MEGAAVR)
5759
#define STREAMUTILS_USE_EEPROM_UPDATE 1
5860
#else
5961
#define STREAMUTILS_USE_EEPROM_UPDATE 0

0 commit comments

Comments
 (0)