Skip to content

Commit 4f3f0db

Browse files
authored
Merge pull request #90 from bxparks/develop
merge 1.6.0 into master
2 parents e84a534 + 36acb15 commit 4f3f0db

File tree

7 files changed

+58
-30
lines changed

7 files changed

+58
-30
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
# Changelog
22

33
* Unreleased
4+
* 1.6.0 (2024-07-25)
5+
* Add `strncat_P()` to `pgmspace.h`.
6+
* Add `ESP.restart()` and `ESP.getChipId()`. See
7+
[PR#84](https://github.com/bxparks/EpoxyDuino/pull/84).
8+
* Support files located in the `utility` subdirectory for libraries using
9+
the old v1.0 format. Fixes
10+
[Issue#89](https://github.com/bxparks/EpoxyDuino/issues/89).
411
* 1.5.0 (2022-12-08)
512
* Support compiling plain `*.c` files in libraries and in the application.
613
* The C files are assumed to be written in C11.

EpoxyDuino.mk

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,10 +152,12 @@ CPPFLAGS += $(EXTRA_CPPFLAGS)
152152
CPPFLAGS += -D ARDUINO=100 -D UNIX_HOST_DUINO -D EPOXY_DUINO -D $(EPOXY_CORE)
153153
# Add the header files for the Core files.
154154
CPPFLAGS += -I$(EPOXY_CORE_PATH)
155-
# Add the header files for libraries. Old Arduino libraries place the header
156-
# and source files right at the top. New Arduino libraries tend to use the
157-
# ./src/ subdirectory. We need to support both.
158-
CPPFLAGS_EXPANSION = -I$(module) -I$(module)/src
155+
# Add the header files for libraries. Old Arduino libraries (v1.0) place the
156+
# header and source files right at the top, or in a subdirectory named
157+
# 'utility'. New Arduino libraries (v1.5) place all their files recursively
158+
# under the ./src/ subdirectory. We need to support both. See details at:
159+
# https://arduino.github.io/arduino-cli/1.0/library-specification/ .
160+
CPPFLAGS_EXPANSION = -I$(module) -I$(module)/src -I$(module)/utility
159161
CPPFLAGS += $(foreach module,$(EPOXY_MODULES),$(CPPFLAGS_EXPANSION))
160162

161163
# Linker settings (e.g. -lm).
@@ -176,11 +178,13 @@ EPOXY_SRCS := $(wildcard $(EPOXY_CORE_PATH)/*.cpp) \
176178
# Later Arduino libraries put the source files under the src/ directory. Also
177179
# support 3 levels of subdirectories. Support both C and C++ libraries files.
178180
MODULE_EXPANSION_CPP = $(wildcard $(module)/*.cpp) \
181+
$(wildcard $(module)/utility/*.cpp) \
179182
$(wildcard $(module)/src/*.cpp) \
180183
$(wildcard $(module)/src/*/*.cpp) \
181184
$(wildcard $(module)/src/*/*/*.cpp) \
182185
$(wildcard $(module)/src/*/*/*/*.cpp)
183186
MODULE_EXPANSION_C = $(wildcard $(module)/*.c) \
187+
$(wildcard $(module)/utility/*.c) \
184188
$(wildcard $(module)/src/*.c) \
185189
$(wildcard $(module)/src/*/*.c) \
186190
$(wildcard $(module)/src/*/*/*.c) \

README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ The disadvantages are:
7171
environments (e.g. 16-bit `int` versus 32-bit `int`, or 32-bit `long` versus
7272
64-bit `long`).
7373

74-
**Version**: 1.5.0 (2022-12-08)
74+
**Version**: 1.6.0 (2024-07-25)
7575

7676
**Changelog**: See [CHANGELOG.md](CHANGELOG.md)
7777

@@ -1311,6 +1311,16 @@ EpoxyDuino release because I no longer use these older environments.
13111311
* I am not sure that I have migrated all the relevant and important compiler
13121312
flags from the microcontroller environment (AVR, ESP8266, etc.) to
13131313
the EpoxyDuino environment.
1314+
* The `sizeof(int)` is `4` on EpoxyDuino as defined by C++ compilers on
1315+
Unix environments.
1316+
* This may cause problems with non-portable Arduino code that assumes that
1317+
`sizeof(int) == 2` which is true only on 8-bit AVR processors used by
1318+
older Arduino boards. All other Arduino-compatible microcontrollers (e.g.
1319+
ESP8266, ESP32, SAMD21, SAMD51) use 32-bit processors whose C++ compilers
1320+
define `sizeof(int) == 4`.
1321+
* Non-portable code can be converted into portable code by changing the
1322+
`short`, `int`, and `long` types into types with explicit sizes such as
1323+
`int16_t`, `uint16_t`, `int32_t`, `uint32_t`, and so on.
13141324

13151325
<a name="FeedbackAndSupport"></a>
13161326
## Feedback and Support
@@ -1355,3 +1365,5 @@ people ask similar questions later.
13551365
[PR#68](https://github.com/bxparks/EpoxyDuino/pull/68).
13561366
* Add `memcmp_P()` by @dawidchyrzynski in
13571367
[PR#71](https://github.com/bxparks/EpoxyDuino/pull/71).
1368+
* Add additional ESP functions by @EricLauber in
1369+
[PR#71](https://github.com/bxparks/EpoxyDuino/pull/84).

cores/epoxy/Arduino.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
#define EPOXY_DUINO_EPOXY_ARDUINO_H
1515

1616
// xx.yy.zz => xxyyzz (without leading 0)
17-
#define EPOXY_DUINO_VERSION 10500
18-
#define EPOXY_DUINO_VERSION_STRING "1.5.0"
17+
#define EPOXY_DUINO_VERSION 10600
18+
#define EPOXY_DUINO_VERSION_STRING "1.6.0"
1919

2020
#include <algorithm> // min(), max()
2121
#include <cmath> // abs()

cores/epoxy/Esp.h

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,31 +8,35 @@
88

99
class EspClass
1010
{
11-
public:
12-
EspClass() {
11+
public:
12+
EspClass() {
1313
gettimeofday(&start, NULL);
1414
}
1515

16-
void reset() {};
16+
void reset() {}
1717

18-
// Very ugly approximation, this is freeStack
19-
unsigned long getFreeHeap() {
18+
void restart() {}
19+
20+
// Very ugly approximation, this is freeStack
21+
unsigned long getFreeHeap() {
2022
int i;
2123
static int* h=40000+&i;
2224
return h-&i;
2325
}
2426

25-
uint32_t getCpuFreqMHZ() { return 80; }
27+
uint32_t getCpuFreqMHZ() { return 80; }
28+
29+
uint32_t getChipId() { return 0; }
2630

27-
uint32_t getCycleCount() {
28-
struct timeval now;
29-
gettimeofday(&now, NULL);
30-
return getCpuFreqMHZ()
31+
uint32_t getCycleCount() {
32+
struct timeval now;
33+
gettimeofday(&now, NULL);
34+
return getCpuFreqMHZ()
3135
* ((now.tv_sec-start.tv_sec)*1000000+(now.tv_usec-start.tv_usec));
32-
}
36+
}
3337

34-
private:
35-
struct timeval start;
38+
private:
39+
struct timeval start;
3640
};
3741

3842
class Serial_ : public Stream

cores/epoxy/pgmspace.h

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,20 +39,21 @@
3939
#define pgm_read_float_far(addr) pgm_read_float(addr)
4040
#define pgm_read_ptr_far(addr) pgm_read_ptr(addr)
4141

42-
#define strlen_P strlen
42+
#define memcmp_P memcmp
43+
#define memcpy_P memcpy
44+
#define snprintf_P snprintf
45+
#define strcasecmp_P strcasecmp
4346
#define strcat_P strcat
44-
#define strcpy_P strcpy
45-
#define strncpy_P strncpy
47+
#define strchr_P strchr
4648
#define strcmp_P strcmp
47-
#define strncmp_P strncmp
48-
#define strcasecmp_P strcasecmp
49+
#define strcpy_P strcpy
50+
#define strlen_P strlen
4951
#define strncasecmp_P strncasecmp
50-
#define strchr_P strchr
52+
#define strncat_P strncat
53+
#define strncmp_P strncmp
54+
#define strncpy_P strncpy
5155
#define strrchr_P strrchr
5256
#define strstr_P strstr
53-
#define memcpy_P memcpy
54-
#define memcmp_P memcmp
55-
#define snprintf_P snprintf
5657
#define vsnprintf_P vsnprintf
5758

5859
#endif

library.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "EpoxyDuino",
3-
"version": "1.5.0",
3+
"version": "1.6.0",
44
"description": "Compile and run Arduino programs natively on Linux, MacOS and FreeBSD.",
55
"keywords": [
66
"unit-test",

0 commit comments

Comments
 (0)