Skip to content

Commit 00a5cfc

Browse files
committed
Fixes
1 parent f8bfac1 commit 00a5cfc

File tree

5 files changed

+109
-9
lines changed

5 files changed

+109
-9
lines changed

CMakeLists.txt

+8-6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
set(CORE_SRCS
2-
cores/esp32/main.cpp
32
cores/esp32/Print.cpp
43
cores/esp32/stdlib_noniso.c
54
cores/esp32/Stream.cpp
6-
cores/esp32/StreamString.cpp
75
cores/esp32/WString.cpp
86
)
97

@@ -14,14 +12,18 @@ set(BLE_SRCS
1412
)
1513

1614
set(includedirs
17-
variants/${CONFIG_ARDUINO_VARIANT}/
1815
cores/esp32/
1916
)
2017

18+
set(requires
19+
esp_timer
20+
driver
21+
)
22+
2123
set(srcs ${CORE_SRCS} ${LIBRARY_SRCS} ${BLE_SRCS})
22-
//--//set(priv_includes cores/esp32/libb64)
23-
//--//set(requires spi_flash mbedtls mdns esp_adc_cal wifi_provisioning nghttp wpa_supplicant)
24-
//--//set(priv_requires fatfs nvs_flash app_update spiffs bootloader_support openssl bt esp_ipc esp_hid)
24+
##--##set(priv_includes cores/esp32/libb64)
25+
##--##set(requires spi_flash mbedtls mdns esp_adc_cal wifi_provisioning nghttp wpa_supplicant)
26+
##--##set(priv_requires fatfs nvs_flash app_update spiffs bootloader_support openssl bt esp_ipc esp_hid)
2527

2628
idf_component_register(INCLUDE_DIRS ${includedirs} PRIV_INCLUDE_DIRS ${priv_includes} SRCS ${srcs} REQUIRES ${requires} PRIV_REQUIRES ${priv_requires})
2729

cores/esp32/Arduino.h

+10-1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,15 @@
4040
#include "stdlib_noniso.h"
4141
//--//#include "binary.h"
4242

43+
#include "esp_log.h"
44+
45+
#define log_w(...) ESP_LOGW("Arduino", ##__VA_ARGS__)
46+
#define log_e(...) ESP_LOGE("Arduino", ##__VA_ARGS__)
47+
48+
#include "esp_timer.h"
49+
50+
#define millis() (esp_timer_get_time() / 1000ULL)
51+
4352
#define PI 3.1415926535897932384626433832795
4453
#define HALF_PI 1.5707963267948966192313216916398
4554
#define TWO_PI 6.283185307179586476925286766559
@@ -174,7 +183,7 @@ extern "C" {
174183

175184
//--//#include "WCharacter.h"
176185
//--//#include "WString.h"
177-
//--//#include "Stream.h"
186+
#include "Stream.h"
178187
//--//#include "Printable.h"
179188
//--//#include "Print.h"
180189
//--//#include "IPAddress.h"

cores/esp32/Stream.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
#include "Arduino.h"
2424
#include "Stream.h"
25-
#include "esp32-hal.h"
25+
//--//#include "esp32-hal.h"
2626

2727
#define PARSE_TIMEOUT 1000 // default number of milli-seconds to wait
2828
#define NO_SKIP_CHAR 1 // a magic char not found in a valid ASCII numeric field

cores/esp32/WString.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
#include "Arduino.h"
2525
#include "WString.h"
2626
#include "stdlib_noniso.h"
27-
#include "esp32-hal-log.h"
27+
//--//#include "esp32-hal-log.h"
2828

2929
/*********************************************/
3030
/* Constructors */

cores/esp32/pgmspace.h

+89
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
/*
2+
Copyright (c) 2015 Hristo Gochkov. All rights reserved.
3+
This file is part of the RaspberryPi core for Arduino environment.
4+
5+
This library is free software; you can redistribute it and/or
6+
modify it under the terms of the GNU Lesser General Public
7+
License as published by the Free Software Foundation; either
8+
version 2.1 of the License, or (at your option) any later version.
9+
10+
This library is distributed in the hope that it will be useful,
11+
but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13+
Lesser General Public License for more details.
14+
15+
You should have received a copy of the GNU Lesser General Public
16+
License along with this library; if not, write to the Free Software
17+
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18+
*/
19+
#ifndef PGMSPACE_INCLUDE
20+
#define PGMSPACE_INCLUDE
21+
22+
typedef void prog_void;
23+
typedef char prog_char;
24+
typedef unsigned char prog_uchar;
25+
typedef char prog_int8_t;
26+
typedef unsigned char prog_uint8_t;
27+
typedef short prog_int16_t;
28+
typedef unsigned short prog_uint16_t;
29+
typedef long prog_int32_t;
30+
typedef unsigned long prog_uint32_t;
31+
32+
#define PROGMEM
33+
#define PGM_P const char *
34+
#define PGM_VOID_P const void *
35+
#define PSTR(s) (s)
36+
#define _SFR_BYTE(n) (n)
37+
38+
#define pgm_read_byte(addr) (*(const unsigned char *)(addr))
39+
#define pgm_read_word(addr) ({ \
40+
typeof(addr) _addr = (addr); \
41+
*(const unsigned short *)(_addr); \
42+
})
43+
#define pgm_read_dword(addr) ({ \
44+
typeof(addr) _addr = (addr); \
45+
*(const unsigned long *)(_addr); \
46+
})
47+
#define pgm_read_float(addr) ({ \
48+
typeof(addr) _addr = (addr); \
49+
*(const float *)(_addr); \
50+
})
51+
#define pgm_read_ptr(addr) ({ \
52+
typeof(addr) _addr = (addr); \
53+
*(void * const *)(_addr); \
54+
})
55+
56+
#define pgm_get_far_address(x) ((uint32_t)(&(x)))
57+
58+
#define pgm_read_byte_near(addr) pgm_read_byte(addr)
59+
#define pgm_read_word_near(addr) pgm_read_word(addr)
60+
#define pgm_read_dword_near(addr) pgm_read_dword(addr)
61+
#define pgm_read_float_near(addr) pgm_read_float(addr)
62+
#define pgm_read_ptr_near(addr) pgm_read_ptr(addr)
63+
#define pgm_read_byte_far(addr) pgm_read_byte(addr)
64+
#define pgm_read_word_far(addr) pgm_read_word(addr)
65+
#define pgm_read_dword_far(addr) pgm_read_dword(addr)
66+
#define pgm_read_float_far(addr) pgm_read_float(addr)
67+
#define pgm_read_ptr_far(addr) pgm_read_ptr(addr)
68+
69+
#define memcmp_P memcmp
70+
#define memccpy_P memccpy
71+
#define memmem_P memmem
72+
#define memcpy_P memcpy
73+
#define strcpy_P strcpy
74+
#define strncpy_P strncpy
75+
#define strcat_P strcat
76+
#define strncat_P strncat
77+
#define strcmp_P strcmp
78+
#define strncmp_P strncmp
79+
#define strcasecmp_P strcasecmp
80+
#define strncasecmp_P strncasecmp
81+
#define strlen_P strlen
82+
#define strnlen_P strnlen
83+
#define strstr_P strstr
84+
#define printf_P printf
85+
#define sprintf_P sprintf
86+
#define snprintf_P snprintf
87+
#define vsnprintf_P vsnprintf
88+
89+
#endif

0 commit comments

Comments
 (0)