Skip to content

Commit 5a344f1

Browse files
committed
esp32cpu: Internal temperature
1 parent d993232 commit 5a344f1

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

docs/docs.pug

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,7 @@ body(class="bg-primary text-white")
326326
li SDK version
327327
li Sketch MD5
328328
li Sketch size
329+
li Internal temperature
329330
br
330331

331332
div(class="card bg-primary text-white border")

src/jessy_terminal.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,18 @@
3232
#include <SD.h>
3333
#include <WiFi.h>
3434

35+
#ifdef __cplusplus
36+
extern "C" {
37+
#endif
38+
39+
uint8_t temprature_sens_read();
40+
41+
#ifdef __cplusplus
42+
}
43+
#endif
44+
45+
uint8_t temprature_sens_read();
46+
3547
static void printCommandError(String cmd, String message) {
3648
JessyUtility::log(JSY_LOG_ERROR, cmd + F(": ") + message);
3749
}
@@ -558,6 +570,9 @@ void JessyTerminal::esp32cpu(JessyAgent &agent, String arguments[], uint8_t argc
558570
JessyIO::println(String(F("SDK version:\t\t")) + ESP.getSdkVersion());
559571
JessyIO::println(String(F("Sketch MD5:\t\t")) + ESP.getSketchMD5());
560572
JessyIO::println(String(F("Sketch size:\t\t")) + ESP.getSketchSize());
573+
JessyIO::println(String(F("Internal temperature:\t")) +
574+
String((temprature_sens_read() - 32) / 1.8) + " C"
575+
);
561576
}
562577

563578
void JessyTerminal::reboot(JessyAgent &agent, String arguments[], uint8_t argc) {

0 commit comments

Comments
 (0)