Private
Public Access
2
0
Commit Graph

1583 Commits

Author SHA1 Message Date
spitfire88
14bf91af44 peripheralman: fix uart and add supported replace functions
Signed-off-by: Sanrio Alvares <sanrio.alvares@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-07-28 14:34:05 +02:00
Tapani Utriainen
f71b4be059 beaglebone.c: use the ret variable in i2c_init_pre also when successful
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-07-28 14:33:16 +02:00
Tapani Utriainen
0b1ccf526f beaglebone.c: check devpath only once in i2c_init_pre
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-07-28 14:33:16 +02:00
Tapani Utriainen
46e5aab56e beaglebone.c: let i2c_init_pre return an error if muxing fails
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-07-28 14:33:16 +02:00
Tapani Utriainen
8f57b21a26 beaglebone.c: use snprintf instead of sprintf in i2c_init_pre
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-07-28 14:33:16 +02:00
Abhishek Malik
808d314043 firmata_mraa.c: Handling PWM period
Signed-off-by: Abhishek Malik <abhishek.malik@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-07-22 07:33:09 +02:00
Nicolas Oliver
95068c4259 docs: Add documentation for building mraa with docker
Signed-off-by: Nicolas Oliver <dario.n.oliver@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-07-21 08:46:45 +02:00
Nicolas Oliver
189b959012 sonar: modify sonar-scan.sh script
Prevent execution on non configured env & add sonar target to allowed failures
in travis

Signed-off-by: Nicolas Oliver <dario.n.oliver@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-07-21 08:46:45 +02:00
Nicolas Oliver
4bedd68c4e travis: improve docker images generation for building
Make a build heriarchy to reduce images size.
Add Android Thing Build.

Signed-off-by: Nicolas Oliver <dario.n.oliver@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-07-21 08:46:45 +02:00
Sanrio Alvares
3d77c86634 peripheralman: implement gpio interrupt
Add gpio interrupt support for peripheral manager based on the
existing implementation in gpio.c.
Rewrite steps by using a global reference to lookup java isr
routine using JNI methods and add exception check after every call.
Free local reference class since it's not garbage collected and will
lead to a memory leak.

Signed-off-by: Sanrio Alvares <sanrio.alvares@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-07-21 08:09:37 +02:00
Sanrio Alvares
5bbea8010e peripheralman: fix return values
Be consistent with the return values from MRAA and propagate the
errors received from PIO in case of failure. PIO returns 0 on success
and negative errno on failure. Handle APIs that must return length of
read/written data if PIO returns success.

Signed-off-by: Sanrio Alvares <sanrio.alvares@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-07-21 08:08:56 +02:00
Martino Facchin
86e7ece2f6 pwm.c: Fix crash if pin == phy_pin_count
Signed-off-by: Martino Facchin <m.facchin@arduino.cc>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-07-20 11:27:30 +02:00
Noel Eck
08c7c0215e changelog.md: Small fix to typo in changelog
Changed Documentnatino - > Documentation

Signed-off-by: Noel Eck <noel.eck@intel.com>
2017-07-13 09:43:38 -07:00
Mihai Tudor Panu
4f3eae90e8 sonar-scan: disable code scans for mraa clones as they require setup
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2017-07-12 20:28:59 -07:00
Nicola Ponte
7d6164c136 gpio: Add support for push-pull/open-drain output mode
This attribute is not part of gpio standard attributes
so it's necessary to implement a custom version of this function

Signed-off-by: Nicola Ponte <nicola.ponte@u-blox.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-07-04 10:12:03 +02:00
Alex Tereschenko
be9fcf2b2d .gitignore: add Sonar and VSCode dirs
Signed-off-by: Alex Tereschenko <alext.mkrs@gmail.com>
2017-07-03 20:23:10 +02:00
Alex Tereschenko
fc00fa20d2 static code analysis: introduce automated scans via SonarCloud
This adds Travis and Docker configurations for automated scans,
both for master branch and internal PRs.

External PRs won't be checked due to security concerns
(and Travis limitation related to that) - GH and SonarCloud tokens
are not propagated to those.

An organization and project must be created in SonarCloud for reporting,
as well as a technical GH user with mraa repo commit permission, to set
PR statuses in the "checks" section.

Signed-off-by: Alex Tereschenko <alext.mkrs@gmail.com>
2017-07-03 20:23:10 +02:00
Alex Tereschenko
caf75a68c0 jsonplatform.c: properly reallocate memory for platform name
Fixes #761.

Signed-off-by: Alex Tereschenko <alext.mkrs@gmail.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-07-01 18:06:33 +02:00
Manivannan Sadhasivam
bd3d9d8cab gpio : Add support for input pull up/down modes
Make use of 'active_low' interface in sysfs for configuring input pin
in pull up / pull down mode. C++ binding also has been added.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-06-28 12:14:50 +02:00
Alex Tereschenko
3f932ac952 x86.c: sanitize data read from sysfs during board detection
Fixes #771.

Signed-off-by: Alex Tereschenko <alext.mkrs@gmail.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-06-24 12:26:46 +02:00
Alex Tereschenko
d544e3c2f6 jsonplatform.c: fix potential segfault at pin label processing
Also update docs to reflect the max label length.

Fixes #738.

Signed-off-by: Alex Tereschenko <alext.mkrs@gmail.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-06-21 14:12:34 +02:00
Alex Tereschenko
30bbb88685 mraa.c/x86.c: use exact match in strncmp() to avoid surprises
Closes #736.

Signed-off-by: Alex Tereschenko <alext.mkrs@gmail.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-06-21 14:12:30 +02:00
Alex Tereschenko
e0052acfa7 mock tests cmake cfg: use PYTHON_DEFAULT_INTERP instead of _EXECUTABLE
Signed-off-by: Alex Tereschenko <alext.mkrs@gmail.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-06-19 20:48:29 +02:00
Alex Tereschenko
3731f88c4f python3 cmake cfg: correct typo in defines
Signed-off-by: Alex Tereschenko <alext.mkrs@gmail.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-06-19 20:48:29 +02:00
Brendan Le Foll
869f76c5c5 python: only add python dir if we have the prerequisites
This means we can depend on the directory existing to check if the
prerequisites are met in the tests/ section

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-06-19 20:48:29 +02:00
Brendan Le Foll
e1778c811d tests: add USEPYTHON3TESTS to explicitly use python3 for tests
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-06-19 20:48:29 +02:00
Brendan Le Foll
09f8b3ac7b tests: Remove checks for mraa.py python module
As commented by @alext-mkrs - When cmake runs through these lines, the
make naturally hasn't run yet, so there are no such files, so it doesn't
set the PYTHON_DEFAULT_INTERP variable and that causes it not to add
tests to the list later on

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-06-19 20:46:18 +02:00
Alex Tereschenko
32196d10e9 joule: align SPI bus numbering with reality
Also update docs to make the numbering and pins used crystal clear.

Closes #758.

Signed-off-by: Alex Tereschenko <alext.mkrs@gmail.com>
2017-06-15 20:49:18 +02:00
Nicolas Oliver
000746c20d build config: fix parameter configuration for docker-compose
We were incorrectly using clang all the time, overriding gcc.
This also brings newer version of docker-compose.

Signed-off-by: Nicolas Oliver <dario.n.oliver@intel.com>
Signed-off-by: Alex Tereschenko <alext.mkrs@gmail.com>
2017-06-10 18:15:09 +02:00
Brendan Le Foll
4109b8b454 aio: Update documentation to mention 0 indexed
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-06-06 15:56:14 +02:00
Alex Tereschenko
c36e4add5a examples: make main loops finite to ensure proper cleanup
Signed-off-by: Alex Tereschenko <alext.mkrs@gmail.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-06-06 15:52:48 +02:00
Alex Tereschenko
32340f6819 examples: misc static code analysis fixes
Signed-off-by: Alex Tereschenko <alext.mkrs@gmail.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-06-06 15:52:48 +02:00
Nick Crast
bb3584fcdb mraa_internal_types.h, aio.c, beaglebone.c:
Beaglebone AIO pins seem to be a little different than most boards, so
this is my attempt to work with that without impacting other boards. I
added a new flag in mraa_board_t to indicate whether or not the aio pins
are sequential. One the beaglebone, they are not. To go along with this,
I added a new device mraa_aio_dev_t, that will map each aio to a
physical pin.

In the main aio logic, if aio_non_seq is true for the board, the manual
mapping is used, otherwise the old mathematical mapping is used.

Signed-off-by: Nick Crast  <nrcrast@gmail.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-06-06 15:51:30 +02:00
Nick Crast
ff03b2de1d beaglebone.c Beaglebone should now work with newer kernels
Made the pin declarations a little nicer to look at. Found a bug with
the I2C. The higher layers were passing the bus ID itself, not the index
of the device in the i2c_bus array.

Signed-off-by: Nick Crast <nrcrast@gmail.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-06-06 15:47:50 +02:00
Nicolas Oliver
79da382832 travis: migrate travis plans to run in a Docker container
Add Dockerfile to create build environment for mraa
Add docker-compose.yaml file to easily execute build tasks
Add .dockerignore file
Modify .travis.yaml file to use docker and docker-compose for building
Modify package.json.cmake to run a simple load test for node.js

Signed-off-by: Nicolas Oliver <dario.n.oliver@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-05-31 17:17:39 +02:00
Brendan Le Foll
131ff46a0d tests/CMakeLists.txt: Fix trying to run tests even if no python interpreter is available
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-05-31 17:17:39 +02:00
Brendan Le Foll
f927bffb16 tests/mock: make all mock tests executable
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-05-31 17:17:39 +02:00
Brendan Le Foll
8133de0cc0 mraa-uart.c: Remove impossible condition with a fprintf
Thanks to @pylbert for the spot

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-05-31 12:12:18 +02:00
Brendan Le Foll
ecb53c8501 raspberry_pi.c: Remove max spi freq by adding replace func
Closes #255

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-05-31 12:01:04 +02:00
Brendan Le Foll
1d37d3b162 tests/CMakeLists.txt: Clean up cmake tests to work with python 2&3
Adds additional checks and PYTHON_DEFAULT_INTERP var that is used to
find the correct python binary as well as checks to see if the
_python2-mraa or _python3-mraa targets have been built by checking
mraa.py. This does assume that this is all that is needed as checking
for TARGET() is not enough as the target is always 'valid'. We prefer
python2 and will only run the java tests if we can find python2

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-05-30 19:31:34 +02:00
Alex Tereschenko
722b83b95c intel_edison_fab_c.c: fix unused variables
Signed-off-by: Alex Tereschenko <alext.mkrs@gmail.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-05-29 18:47:45 +02:00
Alex Tereschenko
822160b7de uart.c: fix potential use of uninitialized variable
Signed-off-by: Alex Tereschenko <alext.mkrs@gmail.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-05-29 18:47:45 +02:00
Alex Tereschenko
98e755d147 pwm.c: remove surplus variable assignment
Signed-off-by: Alex Tereschenko <alext.mkrs@gmail.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-05-29 18:47:45 +02:00
Alex Tereschenko
2980e211db doxy2swig.py: remove/explain 'do-nothing' blocks
Signed-off-by: Alex Tereschenko <alext.mkrs@gmail.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-05-29 18:47:45 +02:00
Alex Tereschenko
69f7d09103 mraa.c: remove surplus variables, correct memory allocations
Signed-off-by: Alex Tereschenko <alext.mkrs@gmail.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-05-29 18:47:45 +02:00
Tapani Utriainen
56d5666ae9 mraa-uart: add a tool for testing, using and debugging UARTs using MRAA
This patch introduces examples/mraa-uart that can be used as a general tool
for UART communication and UART settings.

The syntax mimics the one used for mraa-gpio.

This is an initial version, beware of insects.

Signed-off-by: Tapani Utriainen <tapani@technexion.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-05-28 08:12:18 +02:00
Tapani Utriainen
a6f2464bb1 uart: add a function to query current UART settings
This patch adds a function to query UART settings in an unintrusive way.
It can be used using a uart index or a devpath and it strives to just
read out the settings without affecting the state of the UART.

Signed-off-by: Tapani Utriainen <tapani@technexion.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-05-28 08:11:21 +02:00
Tapani Utriainen
d6edf76680 mraa: add accessor functions to return counts of spi, pwm, gpio and adcs
Signed-off-by: Tapani Utriainen <tapani@technexion.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-05-28 08:11:21 +02:00
Tapani Utriainen
b7e8d96945 mraa: add a function that returns the number of uarts available
Signed-off-by: Tapani Utriainen <tapani@technexion.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-05-28 08:11:21 +02:00
Tapani Utriainen
04c5593cef uart.c: add function to return baudrate as an integer from a speed_t
Signed-off-by: Tapani Utriainen <tapani@technexion.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-05-28 08:11:21 +02:00