Am 17.11.2015 um 15:42 schrieb Matthias Urlichs: >>>> /* 2409 switch -- branch status -- note that bit value is reversed */ >>>> static ZERO_OR_ERROR FS_r_branch(struct one_wire_query *owq) >>>> { >>>> BYTE data = 0 ; >>>> >>>> OWQ_U(owq) = (((data) & 0x01) | ((data >> 1) & 0x02)) ^ 0x03; >>>> return GB_to_Z_OR_E(OW_r_control(&data, PN(owq))) ; >>>> } >>>> >>>> Wouldn't it make slightly more sense to *first* read data and *then* set >>>> the return value? :-P >>>> >> Wait, wait. What do you object here exactly? >> >> > I admit that I had problems with this code myself. However … > > * set data to zero > * set output value to 3 ('data' is zero) > * read 'data' from bus > * … but don't use it in any way. > Yeah, see it now. The other read functions are broken the same way.
Kind regards Jan ------------------------------------------------------------------------------ _______________________________________________ Owfs-developers mailing list Owfs-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/owfs-developers