Update Processor.c

This commit is contained in:
microDev 2020-09-08 15:13:48 +05:30 committed by GitHub
parent 540e6d4285
commit c68723db3c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -34,8 +34,15 @@
#include "soc/efuse_reg.h"
#include "esp-idf/components/driver/esp32s2/include/driver/temp_sensor.h"
float common_hal_mcu_processor_get_temperature(void) {
return NAN;
float tsens_out;
temp_sensor_config_t temp_sensor = TSENS_CONFIG_DEFAULT(); // DEFAULT: range:-10℃ ~ 80℃, error < 1℃.
temp_sensor_set_config(temp_sensor);
temp_sensor_start();
temp_sensor_read_celsius(&tsens_out);
return tsens_out;
}
float common_hal_mcu_processor_get_voltage(void) {