Skip to content

Commit 8ca367a

Browse files
committed
Ping ESP is now compatible with newer Arduino SDK
1 parent d6de140 commit 8ca367a

File tree

3 files changed

+8
-10
lines changed

3 files changed

+8
-10
lines changed

library.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"type": "git",
77
"url": "https://github.com/sblantipodi/arduino_bootstrapper.git"
88
},
9-
"version": "1.12.5",
9+
"version": "1.12.6",
1010
"examples": "examples/*.cpp",
1111
"exclude": "tests",
1212
"frameworks": "arduino",

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=Bootstrapper
2-
version=1.12.5
2+
version=1.12.6
33
author=Davide Perini <[email protected]>
44
maintainer=Davide Perini <[email protected]>
55
sentence=A client library for MQTT messaging.

src/PingESP.cpp

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,15 @@ extern "C" void esp_schedule();
2727
extern "C" void esp_yield();
2828
extern "C" void __esp_suspend();
2929

30+
/**
31+
* Newer Arduino SDK than 3.0.2 does esp_schedule() inside esp_yield(), this break ping functions here.
32+
* Direct alternative would be to use new esp_suspend().
33+
* Continue to use esp_yield() implementation when there is no esp_suspend() function (<= 3.0.2),
34+
* use new esp_suspend() instead (> 3.0.2).
35+
*/
3036
extern "C" void suspend_or_yield() {
31-
Serial.printf("This is the default handler\n");
3237
esp_yield();
3338
}
34-
3539
void __esp_suspend(void) __attribute__((weak, alias("suspend_or_yield")));
3640

3741
PingESP::PingESP() {}
@@ -80,10 +84,4 @@ void PingESP::receivePingCallback(void *opt, void *resp) {
8084
esp_schedule();
8185
}
8286
}
83-
84-
///**
85-
// * Weak function, if there is some implementation of esp_suspend() elsewhere, use that implementation,
86-
// * use this implementation instead.
87-
// */
88-
8987
#endif

0 commit comments

Comments
 (0)