I will correct this, thanks. I frequently forget that shell commands
are not const. I was too lazy to make them a linker section and const
them, which I really should have done.
Sterling
On 17 Dec 2016, at 2:52, Kevin Townsend wrote:
Hmm, this must be a GCC issue on Linux ... I forgot to make this
change and it ran find on OS X and I think Sterling uses OS X as well
which is probably why he didn't see this. Thanks for mentionning it on
the dev list, though! Even if it runs (???) it seems to be a mistake
to have const, yes.
Also ... I did a pull to get `sensors_branch' manually. My output is
different than yours, though ... did you make any local changes?
?
1749:Commands:
1749: echo ? prompt ticks tasks mempools
1751: date sensor
tasks
2163:Tasks:
2163: task pri tid runtime csw stksz stkuse lcheck
ncheck flg
2167: idle 255 0 2167 1779 16384 350 0
0 0
2169:uartpoll 0 1 0 1781 16384 366 0
0 0
2173: socket 2 2 0 108 4096 398 0
0 0
2175: sysevq 10 3 0 27 8192 548 0
0 0
sensor
2641:Possible commands for sensor are:
2642: list
sensor list
2869:sensor dev = accel, type = 1
sensor
3379:Possible commands for sensor are:
3380: list
sensor read
3717:Three arguments required for read: device name, sensor type
and
number of samples, only 0 provided.
sensor read accel 1 1
5230:x = 0, y = 0, z = 0
5230:x = 0, y = 0, z = 0
5231:x = 0, y = 0, z = 0
5232:x = 0, y = 0, z = 0
5234:x = 0, y = 0, z = 0
5235:x = 0, y = 0, z = 0
5236:x = 0, y = 0, z = 0
5236:x = 0, y = 0, z = 0
5237:x = 0, y = 0, z = 0
5239:x = 0, y = 0, z = 0
K.
On 17/12/16 10:08, hathach wrote:
Hi,
I am testing out the new sensor API. Just want to say that 'const'
need to be dropped since we did modify the cmd variable
https://github.com/apache/incubator-mynewt-core/blob/sensors_branch/hw/sensor/src/sensor_shell.c#L38
I got into "Segmentation Fault" when running it with simulation
(native pc).
On 13/12/2016 12:51, Sterling Hughes wrote:
Hi,
I’ve added initial support for a sensors API to mynewt in a branch
off develop called “sensors_branch.” You can find a full diff
here, or pull the source code directly:
https://github.com/apache/incubator-mynewt-core/compare/develop...sensors_branch
I’ll caveat that this API needs work, and further implementation
with real sensors, however, I thought I’d send it to the list for:
- early comments
- if other people are playing with sensors and want to join the
cause on the branch, I think now is a decent time.
I have a couple of adafruit sensors locally, and so I plan on adding
support for the tsl2561 and lis3dh next. Although, if someone wants
to beat me to it - by all means.
The interface is defined in this file:
https://github.com/apache/incubator-mynewt-core/compare/develop...sensors_branch#diff-ec052d973c26072d9ac2e198f16e764a
An example implementation of a sensor driver can be found here:
https://github.com/apache/incubator-mynewt-core/compare/develop...sensors_branch#diff-1c17a623363565318dfefdb8891c0376
And calling the API for basic shell functionality (usage), can be
found here:
https://github.com/apache/incubator-mynewt-core/compare/develop...sensors_branch#diff-d90d3b58f5055894b546a7eff86ba20c
Again, I’ll caveat that this is a WIP, so feedback is welcome
(don’t be shy!), and patches / co-development is even more so!
This is a holiday project for me, so I plan on having something pull
worthy in early January, although no promises.
Cheers,
Sterling