Skip to content

Commit e8d1e49

Browse files
committed
bugfix
1 parent 599c93b commit e8d1e49

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,9 @@ We have the typical Autotools installation flow. We will compile the code from s
6363
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:
6464

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

6971
Note, this command will not take effect until the user logs in and out again. You can verify using the `groups` command.

src/lsm9ds1.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -511,17 +511,17 @@ lsm9ds1_ag_write_socket_udp(struct LSM9DS1 *dev, struct options *opts)
511511
socklen_t servsock_len;
512512
servsock_len = sizeof(opts->socket_udp_dest);
513513

514-
datagram.secs = htonl(dev->tv.tv_sec);
515-
datagram.usecs = htonl(dev->tv.tv_usec);
516-
datagram.g_x = htons(dev->g.x);
517-
datagram.g_y = htons(dev->g.y);
518-
datagram.g_z = htons(dev->g.z);
519-
datagram.xl_x = htons(dev->xl.x);
520-
datagram.xl_y = htons(dev->xl.y);
521-
datagram.xl_z = htons(dev->xl.z);
522-
datagram.m_x = htons(dev->m.x);
523-
datagram.m_y = htons(dev->m.y);
524-
datagram.m_z = htons(dev->m.z);
514+
datagram.secs = dev->tv.tv_sec;
515+
datagram.usecs = dev->tv.tv_usec;
516+
datagram.g_x = dev->g.x;
517+
datagram.g_y = dev->g.y;
518+
datagram.g_z = dev->g.z;
519+
datagram.xl_x = dev->xl.x;
520+
datagram.xl_y = dev->xl.y;
521+
datagram.xl_z = dev->xl.z;
522+
datagram.m_x = dev->m.x;
523+
datagram.m_y = dev->m.y;
524+
datagram.m_z = dev->m.z;
525525

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

0 commit comments

Comments
 (0)