max31855 driver fix from Alan Carvalho de Assis

This commit is contained in:
Alan Carvalho de Assis 2015-09-14 07:47:21 -06:00 committed by Gregory Nutt
parent bca2b2c07c
commit 3a8b00f09f

View File

@ -147,7 +147,8 @@ static ssize_t max31855_read(FAR struct file *filep, FAR char *buffer, size_t bu
FAR struct max31855_dev_s *priv = inode->i_private; FAR struct max31855_dev_s *priv = inode->i_private;
FAR uint16_t *temp = (FAR uint16_t *) buffer; FAR uint16_t *temp = (FAR uint16_t *) buffer;
int ret = 2; int ret = 2;
int32_t regmsb, regval; int32_t regmsb;
int32_t regval;
/* Check for issues */ /* Check for issues */
@ -186,11 +187,11 @@ static ssize_t max31855_read(FAR struct file *filep, FAR char *buffer, size_t bu
if (regval & 0x80000000) if (regval & 0x80000000)
{ {
temp = 0xFFFFC000 | (regval >> 18); *temp = 0xc000 | (regval >> 18);
} }
else else
{ {
temp = (regval >> 18); *temp = (regval >> 18);
} }
/* Detect any fault */ /* Detect any fault */