Private
Public Access
2
0
Commit Graph

1753 Commits

Author SHA1 Message Date
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
Tapani Utriainen
818ae995c2 uart.c: fix return value for invalid baudrates in uint2speed
This patch probably changes no functionality.

Before this patch the return value 0 was used for invalid baudrates in
uint2speed, but this is not a proper speed_t constant.
Instead the constant B0 is returned now, since on x86 and arm linux
architectures B0 is defined as 0.

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
Alex Tereschenko
47c21e0b6c jsonplatform.c: fix automated and manual code analysis findings
Signed-off-by: Alex Tereschenko <alext.mkrs@gmail.com>
2017-05-18 20:42:32 +02:00
Alex Tereschenko
816be65ba0 gpio.c,aio.c,iio.c: misc fixes of static code analysis findings
SonarQube is awesome!

Signed-off-by: Alex Tereschenko <alext.mkrs@gmail.com>
2017-05-18 20:41:51 +02:00
Alex Tereschenko
b73fdff00d examples: be more defensive and replace strcmp() with strncmp()
Signed-off-by: Alex Tereschenko <alext.mkrs@gmail.com>
2017-05-17 19:45:05 +02:00
Alex Tereschenko
398b851144 mraa.c: be more defensive and replace strcmp() with strncmp()
Closes #731.

Signed-off-by: Alex Tereschenko <alext.mkrs@gmail.com>
2017-05-17 19:34:53 +02:00
Tapani Utriainen
5ef3f3ea29 mraa.c: add a by-name lookup function also for UARTs
Signed-off-by: Tapani Utriainen <tapani@technexion.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-05-16 17:14:30 +02:00
Tapani Utriainen
9479843cde mraa.c: make lookup functions more robust with null pointer checks
Signed-off-by: Tapani Utriainen <tapani@technexion.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-05-16 17:14:30 +02:00
Tapani Utriainen
dc1255ad75 mraa.c: fix style of lookup functions
This patch has no changes in function. It fixes three style issues
to be more readable and in line to the rest of the codebase:
- return types are declared on a separate line
- reversal of Yoda conditionals
- initialize for loop variable inside loop declaration
- Fix styling of pwm lookup doxygen

Signed-off-by: Tapani Utriainen <tapani@technexion.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-05-16 17:14:30 +02:00
Alex Tereschenko
9545a2e320 stability: replace strcpy with strncpy to avoid potential overflows
Signed-off-by: Alex Tereschenko <alext.mkrs@gmail.com>
2017-05-15 21:04:18 +02:00
Alex Tereschenko
0654183b9a stability: replace sprintf with snprintf to avoid potential overflows
Signed-off-by: Alex Tereschenko <alext.mkrs@gmail.com>
2017-05-15 21:04:18 +02:00
Alex Tereschenko
918e2b18e2 spi.c: fix potential null pointer dereference
Signed-off-by: Alex Tereschenko <alext.mkrs@gmail.com>
2017-05-15 21:02:50 +02:00
Tapani Utriainen
e7b0a3e809 uart: add a null pointer check before dereferencing plat->adv_func
Signed-off-by: Tapani Utriainen <tapani@technexion.com>
Signed-off-by: Alex Tereschenko <alext.mkrs@gmail.com>
2017-05-15 21:00:34 +02:00
Brendan Le Foll
8ddbcde84e mraa: Update to v.1.7.0
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-05-12 05:16:20 -07:00
Brendan Le Foll
a0332b14b5 Revert "x86.c: add NUC5i7RYB to the list of known NUC5 platforms"
This reverts commit 2f51627d18.

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-05-12 01:23:58 -07:00
Nicola Lunghi
def0a6aed1 up.c: Fixed pin name size on up board
Signed-off-by: Nicola Lunghi <nicola.lunghi@emutex.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-05-12 01:23:47 -07:00
Robert Wolff
9d65d6e0f0 master/README.md: Add 96Boards option/link to ARM supported boards.
Added 96Boards option to list of ARM supported boards
with relative link.

Signed-off-by: Robert Wolff <robert.wolff@linaro.org>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-05-09 08:41:41 +02:00
Mark van der Pol
4b08887c54 minnow_max.md: Added the Minnow Turbot, replaced broken links
MinnowMax is obsoleted, replaced with the Minnow Turbot - updated the web links
to point to the legacy board pages, and the new board where appropriate.  Pin
26 - Added a pin function for the I2S MCLK

There is more work to do to capture and document all the changes.

Signed-off-by: |\/|ark van der Pol <markx.van.der.pol@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-05-09 08:41:02 +02:00
Jon Trulson
e0a0dac47b uart: add tcsendbreak support
Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Alex Tereschenko <alext.mkrs@gmail.com>
2017-05-08 21:15:33 +02:00
Alex Tereschenko
6d5b2c0642 .travis.yml: remove Node.js 0.10 and 0.12 - no longer supported
Signed-off-by: Alex Tereschenko <alext.mkrs@gmail.com>
2017-05-06 14:44:48 +02:00
Kas Perch
075a7b1225 JS examples: refactor for clarity and consistent style
Signed-off-by: Kassandra Perch <the@nodebotani.st>
Signed-off-by: Alex Tereschenko <alext.mkrs@gmail.com>
2017-05-06 14:38:54 +02:00
Mihai Tudor Panu
43d9f6c400 readme.md: minor formatting and content changes
Clarified the need for explicit call to addSubplatform when libmraa is installed from NPM, fixed heading, added link to Firmata subplatforms.

Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2017-05-05 16:52:44 -07:00
Noel Eck
1379c1fe33 types.hpp: Added Platform type for PIO
MRAA C++ getPlatformType casts the return from mraa_get_platform_type()
to a Platform enum (which did not exist in C++ for AT).  Added enum type
to types.hpp which corresponds to the C enum type.

Signed-off-by: Noel Eck <noel.eck@intel.com>
2017-05-04 11:10:08 -07:00
Sanrio Alvares
80335b18b6 peripheralman: i2c_read_bytes_data returns length of read bytes
Return length of read bytes rather than 0 on success.
MRAA calls I2C_RDWR ioctl which returns number of bytes read.
PIO is yet to implement that API so currently does I2C_SMBUS
ioctl instead, which returns 0 in case of success.

Signed-off-by: Sanrio Alvares <sanrio.alvares@intel.com>
2017-05-04 02:29:34 -07:00
Robert Wolff
be2bd63223 docs/96Boards.md: Created and populate 96boards.md
First submission for 96Boards markdown in docs folder. Currently
hosts information and resources for three Consumer Edition
96Boards including DragonBoard 410c, HiKey, and Bubblegum-96.
Plans to expand on this doc as more boards are enabled. Will also
highlight any notes as things come up.

Signed-off-by: Robert Wolff <robert.wolff@linaro.org>
2017-05-04 17:10:49 +02:00
Sanrio Alvares
35e17ee25a periphmraa: fix pwm calls to PIO
Signed-off-by: Sanrio Alvares <sanrio.alvares@intel.com>
Signed-off-by: Noel Eck <noel.eck@intel.com>
2017-04-30 16:39:22 -07:00
Sanrio Alvares
ef2fddc1e1 periphmraa: fix pwm init sequence
Signed-off-by: Sanrio Alvares <sanrio.alvares@intel.com>
Signed-off-by: Noel Eck <noel.eck@intel.com>
2017-04-28 10:54:58 -07:00
Sanrio Alvares
ce0edf0f62 periphmraa: set pin capabilities
Peripheral Manager provides mutual exclusion between pins
multiple functionalities. This feature in MRAA is redundant for
this platform.

Once the API to retrieve pin functionality from PIO is available
use it to update each pins capabilities.

Signed-off-by: Sanrio Alvares <sanrio.alvares@intel.com>
Signed-off-by: Noel Eck <noel.eck@intel.com>
2017-04-26 14:43:26 -07:00
Noel Eck
038a7c542a building.md: Small updates to format for AT
Added a bit of formatting to the AT peripheral manager instructions.

Signed-off-by: Noel Eck <noel.eck@intel.com>
2017-04-24 16:24:18 -07:00
Noel Eck
aeb293a163 Peripheralman: Update peripheralman API docs
* Update documentation for C methods
    * Update documentation for CXX methods
    * Update build instructions for building on AT Peripheral Manager Client

Signed-off-by: Noel Eck <noel.eck@intel.com>
2017-04-24 16:04:33 -07:00
Noel Eck
87fda62759 peripheralman.c: Allocate pwm context for spi
Updated the mraa_pman_pwm_init_replace method to allocate heap space for the
mraa_pwm_context (returned by this method.

Signed-off-by: Noel Eck <noel.eck@intel.com>
2017-04-24 14:42:55 -07:00