Merge pull request #7199 from MicroDev1/espressif

Enable `microcontroller.cpu.temperature` on esp32s3
This commit is contained in:
Dan Halbert 2022-11-12 11:16:45 -05:00 committed by GitHub
commit c96208902f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -40,13 +40,13 @@
#include "soc/efuse_reg.h"
#if !defined(CONFIG_IDF_TARGET_ESP32) && !defined(CONFIG_IDF_TARGET_ESP32S3)
#if !defined(CONFIG_IDF_TARGET_ESP32)
#include "driver/temp_sensor.h"
#endif
float common_hal_mcu_processor_get_temperature(void) {
float tsens_out;
#if defined(CONFIG_IDF_TARGET_ESP32S3) || defined(CONFIG_IDF_TARGET_ESP32)
#if defined(CONFIG_IDF_TARGET_ESP32)
mp_raise_NotImplementedError(NULL);
#else
temp_sensor_config_t temp_sensor = TSENS_CONFIG_DEFAULT(); // DEFAULT: range:-10℃ ~ 80℃, error < 1℃.