Commit 14b64e2b authored by Jeroen Vreeken's avatar Jeroen Vreeken
Browse files

Small fixes in vesp code.

parent 11523659
......@@ -58,6 +58,8 @@ struct tx_packet {
#define VESP_SENSOR_CO_CMD_CONTROL 4
#define VESP_SENSOR_CO_CTRL_ENABLE 1
#define VESP_SENSOR_CO_CTRL_RAW 2
static void calculate(struct controller_block *sensor)
{
......@@ -66,9 +68,10 @@ static void calculate(struct controller_block *sensor)
struct tx_packet *packet_tx = priv->data_tx;
/* no calibration yet, just a direct conversion */
priv->ppm = le16toh(packet_rx->vdiv);
priv->ppm = be16toh(packet_rx->vdiv);
packet_tx->control = VESP_SENSOR_CO_CTRL_ENABLE;
packet_tx->control =
VESP_SENSOR_CO_CTRL_ENABLE | VESP_SENSOR_CO_CTRL_RAW;
}
static void rx_callback(struct controller_block *block, void *data)
......
......@@ -234,6 +234,7 @@ static int vesp_dev_open(struct controller_block *block)
goto err;
}
#if defined(__linux__)
struct serial_rs485 rs485conf = { 0 };
......@@ -267,6 +268,7 @@ static int vesp_dev_open(struct controller_block *block)
log_send(LOG_T_WARNING, "%s: ioctl(TIOCSRS485): %s",
block->name, strerror(errno));
}
#endif
log_send(LOG_T_INFO, "%s: Opened %s", block->name, priv->devname);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment