xiaoxiang781216 commented on code in PR #15605: URL: https://github.com/apache/nuttx/pull/15605#discussion_r1921688289
########## include/nuttx/sensors/ioctl.h: ########## @@ -466,4 +466,31 @@ #define SNIOC_GET_EVENTS _SNIOC(0x009E) +/* Command: SNIOC_SET_THERMO + * Description: Set the thermocouple type. + * Argument: An option from `enum sensor_thermo_type_e` + */ + +#define SNIOC_SET_THERMO _SNIOC(0x009E) Review Comment: 0x009F ########## drivers/sensors/mcp9600_uorb.c: ########## @@ -246,15 +294,60 @@ static int mcp9600_read_temp(FAR struct mcp9600_dev_s *priv, uint8_t reg, /* Positive temperature */ - *temp = (raw[0] * 16 + raw[1] / 16); + raw_temp = (raw[0] * 16 + raw[1] / 16); /* Negative temperature */ if (raw[0] & 0x80) { - *temp -= 4096; + raw_temp -= 4096; } + temp->temperature = (float)(raw_temp)*g_resolutions[priv->conf.resolution]; + temp->timestamp = sensor_get_timestamp(); + + return err; +} + +/**************************************************************************** + * Name: mcp9600_read + * + * Description: + * Reads all thermocouple values in degrees Celsius. + * + ****************************************************************************/ + +static int mcp9600_read(FAR struct mcp9600_dev_s *priv, + FAR struct sensor_temp *hot, + FAR struct sensor_temp *cold, + FAR struct sensor_temp *delta) +{ + int err; + + /* Exclusive access */ + + err = nxmutex_unlock(&priv->devlock); Review Comment: nxmutex_lock -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org