Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added support for DS18S20 (ass opposed to DS18B20) for cold junction #94

Merged
merged 1 commit into from
Feb 4, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/onewire.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ static inline uint32_t resetbus(void) {
#define OW_READ_SCRATCHPAD (0xbe)
#define OW_FAMILY_TEMP1 (0x22) // DS1822
#define OW_FAMILY_TEMP2 (0x28) // DS18B20
#define OW_FAMILY_TEMP3 (0x10) // DS18S20
#define OW_FAMILY_TC (0x3b)

#define MAX_OW_DEVICES (5)
Expand Down Expand Up @@ -348,12 +349,14 @@ uint32_t OneWire_Init(void) {
printf("%02x", owdeviceids[iter][idloop]);
}
uint8_t family = owdeviceids[iter][0];
if (family == OW_FAMILY_TEMP1 || family == OW_FAMILY_TEMP2) {
if (family == OW_FAMILY_TEMP1 || family == OW_FAMILY_TEMP2 || family == OW_FAMILY_TEMP3)) {
const char* sensorname = "UNKNOWN";
if (family == OW_FAMILY_TEMP1) {
sensorname = "DS1822";
} else if (family == OW_FAMILY_TEMP2) {
sensorname = "DS18B20";
} else if (family == OW_FAMILY_TEMP3) {
sensorname = "DS18S20";
}
save = VIC_DisableIRQ();
selectdevbyidx(iter);
Expand Down