Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
weixin_43676597
arduino-esp32
提交
1c77790a
A
arduino-esp32
项目概览
weixin_43676597
/
arduino-esp32
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
A
arduino-esp32
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
1c77790a
编写于
9月 29, 2019
作者:
M
Me No Dev
提交者:
GitHub
9月 29, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
allow the examples to build in a more strict env (#3299)
上级
5bff89f0
变更
15
隐藏空白更改
内联
并排
Showing
15 changed file
with
31 addition
and
36 deletion
+31
-36
libraries/BLE/examples/BLE_client/BLE_client.ino
libraries/BLE/examples/BLE_client/BLE_client.ino
+1
-0
libraries/BLE/src/BLECharacteristic.cpp
libraries/BLE/src/BLECharacteristic.cpp
+4
-6
libraries/BLE/src/GeneralUtils.cpp
libraries/BLE/src/GeneralUtils.cpp
+1
-2
libraries/EEPROM/examples/eeprom_class/eeprom_class.ino
libraries/EEPROM/examples/eeprom_class/eeprom_class.ino
+4
-3
libraries/EEPROM/examples/eeprom_extra/eeprom_extra.ino
libraries/EEPROM/examples/eeprom_extra/eeprom_extra.ino
+2
-2
libraries/ESP32/examples/DeepSleep/TouchWakeUp/TouchWakeUp.ino
...ries/ESP32/examples/DeepSleep/TouchWakeUp/TouchWakeUp.ino
+0
-2
libraries/ESP32/examples/ESPNow/Basic/Master/Master.ino
libraries/ESP32/examples/ESPNow/Basic/Master/Master.ino
+4
-8
libraries/ESP32/examples/ESPNow/Multi-Slave/Master/Master.ino
...aries/ESP32/examples/ESPNow/Multi-Slave/Master/Master.ino
+3
-5
libraries/ESP32/examples/RMT/RMTLoopback/RMTLoopback.ino
libraries/ESP32/examples/RMT/RMTLoopback/RMTLoopback.ino
+1
-1
libraries/ESP32/examples/RMT/RMTReadXJT/RMTReadXJT.ino
libraries/ESP32/examples/RMT/RMTReadXJT/RMTReadXJT.ino
+0
-1
libraries/FFat/examples/FFat_Test/FFat_Test.ino
libraries/FFat/examples/FFat_Test/FFat_Test.ino
+3
-3
libraries/WiFi/examples/ETH_LAN8720_internal_clock/ETH_LAN8720_internal_clock.ino
...ETH_LAN8720_internal_clock/ETH_LAN8720_internal_clock.ino
+3
-0
libraries/WiFi/examples/WiFiClientEvents/WiFiClientEvents.ino
...aries/WiFi/examples/WiFiClientEvents/WiFiClientEvents.ino
+1
-0
libraries/WiFi/examples/WiFiUDPClient/WiFiUDPClient.ino
libraries/WiFi/examples/WiFiUDPClient/WiFiUDPClient.ino
+2
-1
platform.txt
platform.txt
+2
-2
未找到文件。
libraries/BLE/examples/BLE_client/BLE_client.ino
浏览文件 @
1c77790a
...
...
@@ -87,6 +87,7 @@ bool connectToServer() {
pRemoteCharacteristic
->
registerForNotify
(
notifyCallback
);
connected
=
true
;
return
true
;
}
/**
* Scan for BLE servers and find the first one that advertises the service we are looking for.
...
...
libraries/BLE/src/BLECharacteristic.cpp
浏览文件 @
1c77790a
...
...
@@ -693,15 +693,13 @@ void BLECharacteristic::setValue(int& data32) {
}
// setValue
void
BLECharacteristic
::
setValue
(
float
&
data32
)
{
uint8_t
temp
[
4
];
*
((
float
*
)
temp
)
=
data32
;
setValue
(
temp
,
4
);
float
temp
=
data32
;
setValue
((
uint8_t
*
)
&
temp
,
4
);
}
// setValue
void
BLECharacteristic
::
setValue
(
double
&
data64
)
{
uint8_t
temp
[
8
];
*
((
double
*
)
temp
)
=
data64
;
setValue
(
temp
,
8
);
double
temp
=
data64
;
setValue
((
uint8_t
*
)
&
temp
,
8
);
}
// setValue
...
...
libraries/BLE/src/GeneralUtils.cpp
浏览文件 @
1c77790a
...
...
@@ -104,11 +104,10 @@ bool GeneralUtils::base64Encode(const std::string& in, std::string* out) {
* * Amount of free RAM
*/
void
GeneralUtils
::
dumpInfo
()
{
size_t
freeHeap
=
heap_caps_get_free_size
(
MALLOC_CAP_8BIT
);
esp_chip_info_t
chipInfo
;
esp_chip_info
(
&
chipInfo
);
log_v
(
"--- dumpInfo ---"
);
log_v
(
"Free heap: %d"
,
freeHeap
);
log_v
(
"Free heap: %d"
,
heap_caps_get_free_size
(
MALLOC_CAP_8BIT
)
);
log_v
(
"Chip Info: Model: %d, cores: %d, revision: %d"
,
chipInfo
.
model
,
chipInfo
.
cores
,
chipInfo
.
revision
);
log_v
(
"ESP-IDF version: %s"
,
esp_get_idf_version
());
log_v
(
"---"
);
...
...
libraries/EEPROM/examples/eeprom_class/eeprom_class.ino
浏览文件 @
1c77790a
...
...
@@ -37,7 +37,8 @@ void setup() {
ESP
.
restart
();
}
char
*
name
=
"Teo Swee Ann"
;
const
char
*
name
=
"Teo Swee Ann"
;
char
rname
[
32
];
double
height
=
5.8
;
uint32_t
age
=
47
;
...
...
@@ -60,10 +61,10 @@ void setup() {
Serial
.
println
(
"------------------------------------
\n
"
);
// Read: Variables <--- EEPROM stores
NAMES
.
get
(
0
,
name
);
NAMES
.
get
(
0
,
r
name
);
HEIGHT
.
get
(
0
,
height
);
AGE
.
get
(
0
,
age
);
Serial
.
print
(
"name: "
);
Serial
.
println
(
name
);
Serial
.
print
(
"name: "
);
Serial
.
println
(
r
name
);
Serial
.
print
(
"height: "
);
Serial
.
println
(
height
);
Serial
.
print
(
"age: "
);
Serial
.
println
(
age
);
...
...
libraries/EEPROM/examples/eeprom_extra/eeprom_extra.ino
浏览文件 @
1c77790a
...
...
@@ -49,11 +49,11 @@ void setup() {
EEPROM
.
writeULong
(
address
,
4294967295
);
// Same as writeUInt and readUInt
address
+=
sizeof
(
unsigned
long
);
int64_t
value
=
-
9223372036854775808
;
// -2^63
int64_t
value
=
-
1223372036854775808LL
;
// -2^63
EEPROM
.
writeLong64
(
address
,
value
);
address
+=
sizeof
(
int64_t
);
uint64_t
Value
=
18446744073709551615
;
// 2^64 - 1
uint64_t
Value
=
18446744073709551615
ULL
;
// 2^64 - 1
EEPROM
.
writeULong64
(
address
,
Value
);
address
+=
sizeof
(
uint64_t
);
...
...
libraries/ESP32/examples/DeepSleep/TouchWakeUp/TouchWakeUp.ino
浏览文件 @
1c77790a
...
...
@@ -40,8 +40,6 @@ Method to print the touchpad by which ESP32
has been awaken from sleep
*/
void
print_wakeup_touchpad
(){
touch_pad_t
pin
;
touchPin
=
esp_sleep_get_touchpad_wakeup_status
();
switch
(
touchPin
)
...
...
libraries/ESP32/examples/ESPNow/Basic/Master/Master.ino
浏览文件 @
1c77790a
...
...
@@ -88,7 +88,7 @@ void ScanForSlave() {
Serial
.
print
(
i
+
1
);
Serial
.
print
(
": "
);
Serial
.
print
(
SSID
);
Serial
.
print
(
" ["
);
Serial
.
print
(
BSSIDstr
);
Serial
.
print
(
"]"
);
Serial
.
print
(
" ("
);
Serial
.
print
(
RSSI
);
Serial
.
print
(
")"
);
Serial
.
println
(
""
);
// Get BSSID => Mac Address of the Slave
int
mac
[
6
];
if
(
6
==
sscanf
(
BSSIDstr
.
c_str
(),
"%x:%x:%x:%x:%x:%x
%c
"
,
&
mac
[
0
],
&
mac
[
1
],
&
mac
[
2
],
&
mac
[
3
],
&
mac
[
4
],
&
mac
[
5
]
)
)
{
if
(
6
==
sscanf
(
BSSIDstr
.
c_str
(),
"%x:%x:%x:%x:%x:%x"
,
&
mac
[
0
],
&
mac
[
1
],
&
mac
[
2
],
&
mac
[
3
],
&
mac
[
4
],
&
mac
[
5
]
)
)
{
for
(
int
ii
=
0
;
ii
<
6
;
++
ii
)
{
slave
.
peer_addr
[
ii
]
=
(
uint8_t
)
mac
[
ii
];
}
...
...
@@ -124,17 +124,15 @@ bool manageSlave() {
}
Serial
.
print
(
"Slave Status: "
);
const
esp_now_peer_info_t
*
peer
=
&
slave
;
const
uint8_t
*
peer_addr
=
slave
.
peer_addr
;
// check if the peer exists
bool
exists
=
esp_now_is_peer_exist
(
peer_addr
);
bool
exists
=
esp_now_is_peer_exist
(
slave
.
peer_addr
);
if
(
exists
)
{
// Slave already paired.
Serial
.
println
(
"Already Paired"
);
return
true
;
}
else
{
// Slave not paired, attempt pair
esp_err_t
addStatus
=
esp_now_add_peer
(
peer
);
esp_err_t
addStatus
=
esp_now_add_peer
(
&
slave
);
if
(
addStatus
==
ESP_OK
)
{
// Pair success
Serial
.
println
(
"Pair success"
);
...
...
@@ -168,9 +166,7 @@ bool manageSlave() {
}
void
deletePeer
()
{
const
esp_now_peer_info_t
*
peer
=
&
slave
;
const
uint8_t
*
peer_addr
=
slave
.
peer_addr
;
esp_err_t
delStatus
=
esp_now_del_peer
(
peer_addr
);
esp_err_t
delStatus
=
esp_now_del_peer
(
slave
.
peer_addr
);
Serial
.
print
(
"Slave Delete Status: "
);
if
(
delStatus
==
ESP_OK
)
{
// Delete success
...
...
libraries/ESP32/examples/ESPNow/Multi-Slave/Master/Master.ino
浏览文件 @
1c77790a
...
...
@@ -100,7 +100,7 @@ void ScanForSlave() {
// Get BSSID => Mac Address of the Slave
int
mac
[
6
];
if
(
6
==
sscanf
(
BSSIDstr
.
c_str
(),
"%x:%x:%x:%x:%x:%x
%c
"
,
&
mac
[
0
],
&
mac
[
1
],
&
mac
[
2
],
&
mac
[
3
],
&
mac
[
4
],
&
mac
[
5
]
)
)
{
if
(
6
==
sscanf
(
BSSIDstr
.
c_str
(),
"%x:%x:%x:%x:%x:%x"
,
&
mac
[
0
],
&
mac
[
1
],
&
mac
[
2
],
&
mac
[
3
],
&
mac
[
4
],
&
mac
[
5
]
)
)
{
for
(
int
ii
=
0
;
ii
<
6
;
++
ii
)
{
slaves
[
SlaveCnt
].
peer_addr
[
ii
]
=
(
uint8_t
)
mac
[
ii
];
}
...
...
@@ -127,8 +127,6 @@ void ScanForSlave() {
void
manageSlave
()
{
if
(
SlaveCnt
>
0
)
{
for
(
int
i
=
0
;
i
<
SlaveCnt
;
i
++
)
{
const
esp_now_peer_info_t
*
peer
=
&
slaves
[
i
];
const
uint8_t
*
peer_addr
=
slaves
[
i
].
peer_addr
;
Serial
.
print
(
"Processing: "
);
for
(
int
ii
=
0
;
ii
<
6
;
++
ii
)
{
Serial
.
print
((
uint8_t
)
slaves
[
i
].
peer_addr
[
ii
],
HEX
);
...
...
@@ -136,13 +134,13 @@ void manageSlave() {
}
Serial
.
print
(
" Status: "
);
// check if the peer exists
bool
exists
=
esp_now_is_peer_exist
(
peer_addr
);
bool
exists
=
esp_now_is_peer_exist
(
slaves
[
i
].
peer_addr
);
if
(
exists
)
{
// Slave already paired.
Serial
.
println
(
"Already Paired"
);
}
else
{
// Slave not paired, attempt pair
esp_err_t
addStatus
=
esp_now_add_peer
(
peer
);
esp_err_t
addStatus
=
esp_now_add_peer
(
&
slaves
[
i
]
);
if
(
addStatus
==
ESP_OK
)
{
// Pair success
Serial
.
println
(
"Pair success"
);
...
...
libraries/ESP32/examples/RMT/RMTLoopback/RMTLoopback.ino
浏览文件 @
1c77790a
...
...
@@ -52,7 +52,7 @@ void loop()
// Printout the received data plus the original values
for
(
i
=
0
;
i
<
60
;
i
++
)
{
Serial
.
printf
(
"%08x=%08x "
,
my_data
[
i
]
,
data
[
i
]
);
Serial
.
printf
(
"%08x=%08x "
,
my_data
[
i
]
.
val
,
data
[
i
].
val
);
if
(
!
((
i
+
1
)
%
4
))
Serial
.
println
(
"
\n
"
);
}
Serial
.
println
(
"
\n
"
);
...
...
libraries/ESP32/examples/RMT/RMTReadXJT/RMTReadXJT.ino
浏览文件 @
1c77790a
...
...
@@ -141,7 +141,6 @@ static bool xjtReceiveBit(size_t index, bool bit){
}
void
parseRmt
(
rmt_data_t
*
items
,
size_t
len
,
uint32_t
*
channels
){
size_t
chan
=
0
;
bool
valid
=
true
;
rmt_data_t
*
it
=
NULL
;
...
...
libraries/FFat/examples/FFat_Test/FFat_Test.ino
浏览文件 @
1c77790a
...
...
@@ -165,8 +165,8 @@ void setup(){
return
;
}
Serial
.
printf
(
"Total space: %10
l
u
\n
"
,
FFat
.
totalBytes
());
Serial
.
printf
(
"Free space: %10
l
u
\n
"
,
FFat
.
freeBytes
());
Serial
.
printf
(
"Total space: %10u
\n
"
,
FFat
.
totalBytes
());
Serial
.
printf
(
"Free space: %10u
\n
"
,
FFat
.
freeBytes
());
listDir
(
FFat
,
"/"
,
0
);
writeFile
(
FFat
,
"/hello.txt"
,
"Hello "
);
appendFile
(
FFat
,
"/hello.txt"
,
"World!
\r\n
"
);
...
...
@@ -175,7 +175,7 @@ void setup(){
readFile
(
FFat
,
"/foo.txt"
);
deleteFile
(
FFat
,
"/foo.txt"
);
testFileIO
(
FFat
,
"/test.txt"
);
Serial
.
printf
(
"Free space: %10
l
u
\n
"
,
FFat
.
freeBytes
());
Serial
.
printf
(
"Free space: %10u
\n
"
,
FFat
.
freeBytes
());
deleteFile
(
FFat
,
"/test.txt"
);
Serial
.
println
(
"Test complete"
);
}
...
...
libraries/WiFi/examples/ETH_LAN8720_internal_clock/ETH_LAN8720_internal_clock.ino
浏览文件 @
1c77790a
...
...
@@ -10,6 +10,9 @@
* ETH_CLOCK_GPIO16_OUT - 50MHz clock from internal APLL output on GPIO16 - possibly an inverter is needed for LAN8720
* ETH_CLOCK_GPIO17_OUT - 50MHz clock from internal APLL inverted output on GPIO17 - tested with LAN8720
*/
#ifdef ETH_CLK_MODE
#undef ETH_CLK_MODE
#endif
#define ETH_CLK_MODE ETH_CLOCK_GPIO17_OUT
// Pin# of the enable signal for the external crystal oscillator (-1 to disable for internal APLL source)
...
...
libraries/WiFi/examples/WiFiClientEvents/WiFiClientEvents.ino
浏览文件 @
1c77790a
...
...
@@ -121,6 +121,7 @@ void WiFiEvent(WiFiEvent_t event)
case
SYSTEM_EVENT_ETH_GOT_IP
:
Serial
.
println
(
"Obtained IP address"
);
break
;
default:
break
;
}}
void
WiFiGotIP
(
WiFiEvent_t
event
,
WiFiEventInfo_t
info
)
...
...
libraries/WiFi/examples/WiFiUDPClient/WiFiUDPClient.ino
浏览文件 @
1c77790a
...
...
@@ -34,7 +34,7 @@ void loop(){
if
(
connected
){
//Send a packet
udp
.
beginPacket
(
udpAddress
,
udpPort
);
udp
.
printf
(
"Seconds since boot: %u"
,
millis
()
/
1000
);
udp
.
printf
(
"Seconds since boot: %
l
u"
,
millis
()
/
1000
);
udp
.
endPacket
();
}
//Wait for 1 second
...
...
@@ -71,5 +71,6 @@ void WiFiEvent(WiFiEvent_t event){
Serial
.
println
(
"WiFi lost connection"
);
connected
=
false
;
break
;
default:
break
;
}
}
platform.txt
浏览文件 @
1c77790a
...
...
@@ -25,10 +25,10 @@ compiler.sdk.path={runtime.platform.path}/tools/sdk
compiler.cpreprocessor.flags=-DESP_PLATFORM -DMBEDTLS_CONFIG_FILE="mbedtls/esp_config.h" -DHAVE_CONFIG_H "-I{compiler.sdk.path}/include/config" "-I{compiler.sdk.path}/include/app_trace" "-I{compiler.sdk.path}/include/app_update" "-I{compiler.sdk.path}/include/asio" "-I{compiler.sdk.path}/include/bootloader_support" "-I{compiler.sdk.path}/include/bt" "-I{compiler.sdk.path}/include/coap" "-I{compiler.sdk.path}/include/console" "-I{compiler.sdk.path}/include/driver" "-I{compiler.sdk.path}/include/esp-tls" "-I{compiler.sdk.path}/include/esp32" "-I{compiler.sdk.path}/include/esp_adc_cal" "-I{compiler.sdk.path}/include/esp_event" "-I{compiler.sdk.path}/include/esp_http_client" "-I{compiler.sdk.path}/include/esp_http_server" "-I{compiler.sdk.path}/include/esp_https_ota" "-I{compiler.sdk.path}/include/esp_ringbuf" "-I{compiler.sdk.path}/include/ethernet" "-I{compiler.sdk.path}/include/expat" "-I{compiler.sdk.path}/include/fatfs" "-I{compiler.sdk.path}/include/freemodbus" "-I{compiler.sdk.path}/include/freertos" "-I{compiler.sdk.path}/include/heap" "-I{compiler.sdk.path}/include/idf_test" "-I{compiler.sdk.path}/include/jsmn" "-I{compiler.sdk.path}/include/json" "-I{compiler.sdk.path}/include/libsodium" "-I{compiler.sdk.path}/include/log" "-I{compiler.sdk.path}/include/lwip" "-I{compiler.sdk.path}/include/mbedtls" "-I{compiler.sdk.path}/include/mdns" "-I{compiler.sdk.path}/include/micro-ecc" "-I{compiler.sdk.path}/include/mqtt" "-I{compiler.sdk.path}/include/newlib" "-I{compiler.sdk.path}/include/nghttp" "-I{compiler.sdk.path}/include/nvs_flash" "-I{compiler.sdk.path}/include/openssl" "-I{compiler.sdk.path}/include/protobuf-c" "-I{compiler.sdk.path}/include/protocomm" "-I{compiler.sdk.path}/include/pthread" "-I{compiler.sdk.path}/include/sdmmc" "-I{compiler.sdk.path}/include/smartconfig_ack" "-I{compiler.sdk.path}/include/soc" "-I{compiler.sdk.path}/include/spi_flash" "-I{compiler.sdk.path}/include/spiffs" "-I{compiler.sdk.path}/include/tcp_transport" "-I{compiler.sdk.path}/include/tcpip_adapter" "-I{compiler.sdk.path}/include/ulp" "-I{compiler.sdk.path}/include/vfs" "-I{compiler.sdk.path}/include/wear_levelling" "-I{compiler.sdk.path}/include/wifi_provisioning" "-I{compiler.sdk.path}/include/wpa_supplicant" "-I{compiler.sdk.path}/include/xtensa-debug-module" "-I{compiler.sdk.path}/include/esp-face" "-I{compiler.sdk.path}/include/esp32-camera" "-I{compiler.sdk.path}/include/esp-face" "-I{compiler.sdk.path}/include/fb_gfx"
compiler.c.cmd=xtensa-esp32-elf-gcc
compiler.c.flags=-std=gnu99 -Os -g3 -fstack-protector -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -mlongcalls -nostdlib -Wpointer-arith {compiler.warning_flags} -Wno-
error=unused-function -Wno-error=unused-but-set-variable -Wno-error=unused-variable -Wno-error=
deprecated-declarations -Wno-unused-parameter -Wno-sign-compare -Wno-old-style-declaration -MMD -c
compiler.c.flags=-std=gnu99 -Os -g3 -fstack-protector -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -mlongcalls -nostdlib -Wpointer-arith {compiler.warning_flags} -Wno-
maybe-uninitialized -Wno-unused-function -Wno-unused-but-set-variable -Wno-unused-variable -Wno-
deprecated-declarations -Wno-unused-parameter -Wno-sign-compare -Wno-old-style-declaration -MMD -c
compiler.cpp.cmd=xtensa-esp32-elf-g++
compiler.cpp.flags=-std=gnu++11 -
fno-exceptions -Os -g3 -Wpointer-arith -fexceptions -fstack-protector -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -mlongcalls -nostdlib {compiler.warning_flags} -Wno-error=unused-function -Wno-error=unused-but-set-variable -Wno-error=unused-variable -Wno-error=deprecated-declarations -Wno-unused-parameter
-Wno-sign-compare -fno-rtti -MMD -c
compiler.cpp.flags=-std=gnu++11 -
Os -g3 -Wpointer-arith -fexceptions -fstack-protector -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -mlongcalls -nostdlib {compiler.warning_flags} -Wno-error=maybe-uninitialized -Wno-error=unused-function -Wno-error=unused-but-set-variable -Wno-error=unused-variable -Wno-error=deprecated-declarations -Wno-unused-parameter -Wno-unused-but-set-parameter -Wno-missing-field-initializers
-Wno-sign-compare -fno-rtti -MMD -c
compiler.S.cmd=xtensa-esp32-elf-gcc
compiler.S.flags=-c -g3 -x assembler-with-cpp -MMD -mlongcalls
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录