Skip to content

Commit

Permalink
fix chip die temp
Browse files Browse the repository at this point in the history
  • Loading branch information
skot committed Aug 15, 2024
1 parent 503d9e6 commit 5cf4ae5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 2 additions & 0 deletions main/EMC2101.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 1 addition & 2 deletions main/tasks/power_management_task.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5cf4ae5

Please sign in to comment.