Skip to content

Commit

Permalink
temp sensor small refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
mvladic committed Sep 13, 2019
1 parent 90e14ec commit 590aa2a
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/eez/apps/psu/temp_sensor.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* EEZ PSU Firmware
* EEZ Modular Firmware
* Copyright (C) 2015-present, Envox d.o.o.
*
* This program is free software: you can redistribute it and/or modify
Expand Down Expand Up @@ -87,13 +87,12 @@ float TempSensor::doRead() {
#if defined(EEZ_PLATFORM_STM32)
if (type >= CH1 && type <= CH6) {
int slotIndex = type - CH1;
if (g_slots[slotIndex].moduleType == MODULE_TYPE_DCP405) {
if (Channel::get(slotIndex).boardRevision == CH_BOARD_REVISION_DCP405_R2B5) {
return drivers::tc77::readTemperature(slotIndex);
} else {
return drivers::tmp1075::readTemperature(slotIndex);
}
} else if (g_slots[slotIndex].moduleType == MODULE_TYPE_DCP505) {
if (g_slots[slotIndex].moduleType == MODULE_TYPE_DCP405 && Channel::get(slotIndex).boardRevision == CH_BOARD_REVISION_DCP405_R2B5) {
return drivers::tc77::readTemperature(slotIndex);
}

if (g_slots[slotIndex].moduleType == MODULE_TYPE_DCP405 && Channel::get(slotIndex).boardRevision == CH_BOARD_REVISION_DCP405_R1B1 ||
g_slots[slotIndex].moduleType == MODULE_TYPE_DCP505) {
return drivers::tmp1075::readTemperature(slotIndex);
}
}
Expand Down

0 comments on commit 590aa2a

Please sign in to comment.