Skip to content

Commit

Permalink
bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
lloydroc committed Jul 11, 2022
1 parent 599c93b commit e8d1e49
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ We have the typical Autotools installation flow. We will compile the code from s
Firstly, if we're running as non-root the user running the program will need access to SPI and GPIO. Use `raspi-config` to enable SPI. Then add the user to the following groups:

```
$ usermod -a -G gpio spi pi # assumes the pi user
$ usermod -a -G gpio -G spi pi # assumes the pi user
$ sudo chown root:spi /dev/spidev*
$ sudo chmod g+rw /dev/spidev*
```

Note, this command will not take effect until the user logs in and out again. You can verify using the `groups` command.
Expand Down
22 changes: 11 additions & 11 deletions src/lsm9ds1.c
Original file line number Diff line number Diff line change
Expand Up @@ -511,17 +511,17 @@ lsm9ds1_ag_write_socket_udp(struct LSM9DS1 *dev, struct options *opts)
socklen_t servsock_len;
servsock_len = sizeof(opts->socket_udp_dest);

datagram.secs = htonl(dev->tv.tv_sec);
datagram.usecs = htonl(dev->tv.tv_usec);
datagram.g_x = htons(dev->g.x);
datagram.g_y = htons(dev->g.y);
datagram.g_z = htons(dev->g.z);
datagram.xl_x = htons(dev->xl.x);
datagram.xl_y = htons(dev->xl.y);
datagram.xl_z = htons(dev->xl.z);
datagram.m_x = htons(dev->m.x);
datagram.m_y = htons(dev->m.y);
datagram.m_z = htons(dev->m.z);
datagram.secs = dev->tv.tv_sec;
datagram.usecs = dev->tv.tv_usec;
datagram.g_x = dev->g.x;
datagram.g_y = dev->g.y;
datagram.g_z = dev->g.z;
datagram.xl_x = dev->xl.x;
datagram.xl_y = dev->xl.y;
datagram.xl_z = dev->xl.z;
datagram.m_x = dev->m.x;
datagram.m_y = dev->m.y;
datagram.m_z = dev->m.z;

buffrx = sendto(opts->fd_socket_udp, &datagram, sizeof(datagram), 0, (struct sockaddr *)&opts->socket_udp_dest, servsock_len);

Expand Down

0 comments on commit e8d1e49

Please sign in to comment.