max31855 driver fix from Alan Carvalho de Assis
This commit is contained in:
parent
bca2b2c07c
commit
3a8b00f09f
@ -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 */
|
||||||
|
Loading…
Reference in New Issue
Block a user