We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents bbd8029 + 14af8e4 commit 66cf6c4Copy full SHA for 66cf6c4
ports/esp32s2/common-hal/microcontroller/Processor.c
@@ -34,8 +34,16 @@
34
35
#include "soc/efuse_reg.h"
36
37
+#include "esp-idf/components/driver/esp32s2/include/driver/temp_sensor.h"
38
+
39
float common_hal_mcu_processor_get_temperature(void) {
- return NAN;
40
+ float tsens_out;
41
+ temp_sensor_config_t temp_sensor = TSENS_CONFIG_DEFAULT(); // DEFAULT: range:-10℃ ~ 80℃, error < 1℃.
42
+ temp_sensor_set_config(temp_sensor);
43
+ temp_sensor_start();
44
+ temp_sensor_read_celsius(&tsens_out);
45
+ temp_sensor_stop();
46
+ return tsens_out;
47
}
48
49
float common_hal_mcu_processor_get_voltage(void) {
0 commit comments