From 5cf4ae5d3bbc96563dcaa86df79174632502ca06 Mon Sep 17 00:00:00 2001 From: Skot Date: Thu, 15 Aug 2024 17:40:36 -0400 Subject: [PATCH] fix chip die temp --- main/EMC2101.c | 2 ++ main/tasks/power_management_task.c | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/main/EMC2101.c b/main/EMC2101.c index 65a318048..8648fd290 100644 --- a/main/EMC2101.c +++ b/main/EMC2101.c @@ -57,6 +57,8 @@ float EMC2101_get_external_temp(void) ESP_ERROR_CHECK(i2c_master_register_read(EMC2101_I2CADDR_DEFAULT, EMC2101_EXTERNAL_TEMP_MSB, &temp_msb, 1)); ESP_ERROR_CHECK(i2c_master_register_read(EMC2101_I2CADDR_DEFAULT, EMC2101_EXTERNAL_TEMP_LSB, &temp_lsb, 1)); + + //ESP_LOGI(TAG, "Raw Temp = %02X %02X", temp_msb, temp_lsb); reading = temp_lsb | (temp_msb << 8); reading >>= 5; diff --git a/main/tasks/power_management_task.c b/main/tasks/power_management_task.c index 577f61b08..dfd301a3d 100644 --- a/main/tasks/power_management_task.c +++ b/main/tasks/power_management_task.c @@ -212,8 +212,7 @@ void POWER_MANAGEMENT_task(void * pvParameters) break; case DEVICE_GAMMA: - power_management->chip_temp_avg = EMC2101_get_internal_temp() + 5; - // power_management->chip_temp_avg = EMC2101_get_external_temp(); + power_management->chip_temp_avg = EMC2101_get_external_temp(); power_management->vr_temp = (float)TPS546_get_temperature(); // EMC2101 will give bad readings if the ASIC is turned off