1. 23 1月, 2008 2 次提交
    • D
      W1: w1_therm.c is flagging 0C etc as invalid · 80c002dd
      David Fries 提交于
      The extra rom[0] check is flagging valid temperatures as invalid when
      there is already a CRC data transmission check.
      
      w1_therm_read_bin()
      	if (rom[8] == crc && rom[0])
      		verdict = 1;
      
      Requiring rom[0] to be non-zero will flag as invalid temperature
      conversions when the low byte is zero, specifically the temperatures 0C,
      16C, 32C, 48C, -16C, -32C, and -48C.
      
      The CRC check is produced on the device for the previous 8 bytes and is
      required to ensure the data integrity in transmission.  I don't see why the
      extra check for rom[0] being non-zero is in there.  Evgeniy Polyakov didn't
      know either.  Just for a check I unplugged the sensor, executed a
      temperature conversion, and read the results.  The read was all ff's, which
      also failed the CRC, so it doesn't need to protect against a disconnected
      sensor.
      
      I have more extensive patches in the work, but these two trivial ones will
      do for today.  I would like to hear from people who use the ds2490 USB to
      one wire dongle.  1 if you would be willing to test the patches as I
      currently only have the one sensor on a short parisite powered wire, 2 if
      there is any cheap sources for the ds2490.
      Signed-off-by: NDavid Fries <david@fries.net>
      Acked-by: NEvgeniy Polyakov <johnpol@2ka.mipt.ru>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      80c002dd
    • D
      W1: w1_therm.c ds18b20 decode freezing temperatures correctly · 941ed3b5
      David Fries 提交于
      Correct the decoding of negative C temperatures.  The code did a binary OR
      of two bytes to make a 16 bit value, but assignd it to an integer.  This
      caused the value to not be sign extended and to loose that it was a
      negative number in the assignment.
      
      Before the patch (in my freezer),
      	w1_slave
      	ed fe 4b 46 7f ff 03 10 e4 : crc=e4 YES
      	ed fe 4b 46 7f ff 03 10 e4 t=4078
      With the patch,
      	e3 fe 4b 46 7f ff 0d 10 81 : crc=81 YES
      	e3 fe 4b 46 7f ff 0d 10 81 t=-17
      Signed-off-by: NDavid Fries <david@fries.net>
      Acked-by: NEvgeniy Polyakov <johnpol@2ka.mipt.ru>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      941ed3b5
  2. 22 1月, 2008 14 次提交
  3. 21 1月, 2008 17 次提交
  4. 20 1月, 2008 7 次提交