Am 30.11.2016 um 22:25 schrieb John Bass:
> Hello Jan,
> 
> Found it a while back, and yep it works :-) 
> 
I've found time do develop a more generic approach to add support for
"secondary" family codes. Could you try the appended patch? Of course,
you had to remove your patch first.

Kind regards

        Jan




diff --git a/module/owlib/src/c/ow_2438.c b/module/owlib/src/c/ow_2438.c
index f14d5e0f..9e7efa33 100644
--- a/module/owlib/src/c/ow_2438.c
+++ b/module/owlib/src/c/ow_2438.c
@@ -171,6 +171,7 @@ static struct filetype DS2438[] = {
 };
 
 DeviceEntryExtended(26, DS2438, DEV_temp | DEV_volt, NO_GENERIC_READ, NO_GENERIC_WRITE);
+DeviceEntryExtendedSecondary(A6, DS2438, DEV_temp | DEV_volt, NO_GENERIC_READ, NO_GENERIC_WRITE);
 
 #define _1W_WRITE_SCRATCHPAD 0x4E
 #define _1W_READ_SCRATCHPAD 0xBE
diff --git a/module/owlib/src/c/ow_tree.c b/module/owlib/src/c/ow_tree.c
index ca013d75..5bbb9788 100644
--- a/module/owlib/src/c/ow_tree.c
+++ b/module/owlib/src/c/ow_tree.c
@@ -144,6 +144,7 @@ void DeviceSort(void)
 	Device2Tree( & d_DS2436,         ePN_real);
 	Device2Tree( & d_DS2437,         ePN_real);
 	Device2Tree( & d_DS2438,         ePN_real);
+	Device2Tree( & d_DS2438_A6,      ePN_real);
 	Device2Tree( & d_DS2450,         ePN_real);
 	Device2Tree( & d_DS2502,         ePN_real);
 	Device2Tree( & d_DS2505,         ePN_real);
diff --git a/module/owlib/src/include/ow_2438.h b/module/owlib/src/include/ow_2438.h
index d03aef6b..cb3ab284 100644
--- a/module/owlib/src/include/ow_2438.h
+++ b/module/owlib/src/include/ow_2438.h
@@ -20,5 +20,6 @@
 
 DeviceHeader(DS2437);
 DeviceHeader(DS2438);
+DeviceHeader(DS2438_A6);
 
 #endif
diff --git a/module/owlib/src/include/ow_device.h b/module/owlib/src/include/ow_device.h
index dd39f5c3..16a54fc9 100644
--- a/module/owlib/src/include/ow_device.h
+++ b/module/owlib/src/include/ow_device.h
@@ -93,6 +93,7 @@ struct device {
 #define COUNT_OF_FILETYPES(filetype_array) ((int)(sizeof(filetype_array)/sizeof(struct filetype)))
 
 #define DeviceEntryExtended( code , chip , flags, gread, gwrite )  struct device d_##chip = {#code,#chip,flags,COUNT_OF_FILETYPES(chip),chip,gread,gwrite}
+#define DeviceEntryExtendedSecondary( code , chip , flags, gread, gwrite )  struct device d_##chip##_##code = {#code,#chip,flags,COUNT_OF_FILETYPES(chip),chip,gread,gwrite}
 
 #define DeviceEntry( code , chip, gread, gwrite )  DeviceEntryExtended( code, chip, 0, gread, gwrite )
 
------------------------------------------------------------------------------
Announcing the Oxford Dictionaries API! The API offers world-renowned
dictionary content that is easy and intuitive to access. Sign up for an
account today to start using our lexical data to power your apps and
projects. Get started today and enter our developer competition.
http://sdm.link/oxford
_______________________________________________
Owfs-developers mailing list
Owfs-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/owfs-developers

Reply via email to