The memory mapped GPIO function calls have been deprecated and in turn removed from the UPM libraries. MRAA now provides the best/fastest GPIO access possible based on the selected platform/pin automatically.
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
Fixes below issues:
tm1637.cxx:69:29: error: "%2d%02d" directive output may be truncated writing between 5 and 15 bytes into a destination of size 5 [-Werror=format-truncation=]
snprintf(myTime, 5, "%2d%02d", (hour + timezone + 24) % 24, min);
jhd1313m1.c:65:49: error: '%d' directive output may be truncated writing between 1 and 10 bytes into a region of size 8 [-Werror=format-truncation=]
snprintf(str, sizeof(str), "Hello World %d", ndx);
Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
This removes unnecessary uint8 types from C driver structs that prevented some sensors from being initialized when connected to a MRAA subplatform.
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
* Examples for C/C++/Python/Java/JavaScript
* Add Java example to CMakeLists
Signed-off-by: Assam Boudjelthia <assam.boudjelthia@fi.rohmeurope.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
* Main C implementation
* C++ wrapper on C implementation
Signed-off-by: Assam Boudjelthia <assam.boudjelthia@fi.rohmeurope.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
- Examples for C/C++/Python/Java/JavaScript
- Add build line for java BH1792_Example
Signed-off-by: Assam Boudjelthia <assam.boudjelthia@fi.rohmeurope.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
- Base C implementation, with all features and measurement modes (interrupts uses ISR)
- C++ wrapper around C implementation
Signed-off-by: Assam Boudjelthia <assam.boudjelthia@fi.rohmeurope.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
Default to MONOTONIC clock for timer methods to avoid falling victim to
clock corrections. Changed signatures from accepting pointers since
this is not needed an complicates calls and Java/JS/Python bindings.
* Switched from nanosleep to clock_nanosleep to allow developers to
provide a clock for LINUX
* Default upm_clock_init to CLOCK_MONOTONIC
* Updated logic to calculating delay and elapsed to be more readable
* Added ns flavors for completeness
* Refactored all upm_* delay/timer methods
* Added #else for preprocessor cases w/o an #else
* Added test for AQI
* Added test fixture with logic to identify a minimum delay time
which is used as a metric for testing all delay methods
* Much more lenient unit testing of delays to minimize false CI
failures
Signed-off-by: Noel Eck <noel.eck@intel.com>
gcc8 detects that strncpy is overwiritng the null terminating character
the source strings are already initialized to 0 so memcpy would do the same
job
Fixes
rn2903.c:153:5: error: 'strncpy' output may be truncated copying 16 bytes from a string of length 511 [-Werror=stringop-truncation]
strncpy(dev->hardware_eui, dev->resp_data, RN2903_MAX_HEX_EUI64);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include sys/types.h for uint definition
uint is defined in sys/types.h, therefore this
header needs to be included, it gets exposed with
musl where this header is not getting included indirectly
as it is happening when building on glibc
Fixes build errors on musl e.g.
upm/src/kx122/kx122.hpp:456:31: error: 'uint' has not been declared
| void setBufferThreshold(uint samples);
| ^~~~
Signed-off-by: Khem Raj <raj.khem@gmail.com>
* Java/Python/Javascript examples
* change usleep to upm_delay_us in C++ example
* Add Java example to CMakeLists
Signed-off-by: Assam Boudjelthia <assam.boudjelthia@fi.rohmeurope.com>
Signed-off-by: Noel Eck <noel.eck@intel.com>
Since UPM Travis-CI runs ctests (one of which loads python examples),
the added lines would fail if the RSC_DATA_RATE and RSC_MODE have not
been included in the python rsc module.)
Signed-off-by: Noel Eck <noel.eck@intel.com>
A few small changes to the nrf8001 which exposes a bit more via SWIG.
Also removed a method which had no implementation.
Signed-off-by: Noel Eck <noel.eck@intel.com>
Some of the UPM libraries have a common C header with types used in both
the C and C++ source. This commit adds these common header files to the
SWIG modules.
Signed-off-by: Noel Eck <noel.eck@intel.com>
Added code to parse GPTXT nmea sentences. Added methods to calculate
sentences/second and raw bytes/second.
Signed-off-by: Noel Eck <noel.eck@intel.com>
Small fixes for new nmea_gps code. Fixed an iterator which could get
dereferenced incorrectly, and changed an auto to an explicit type.
Signed-off-by: Noel Eck <noel.eck@intel.com>
NMEA GPS class now uses threads to handle parsing NMEA sentences.
Currently only handles GGA, GSV, and GLL types. Added queues for
holding parsed data.
* Parsing thread
* Parse GPS Fix from GGA and GLL
* Parse satellite info from GSV
* Provide a queue for GPS fix data as well as raw sentences
(for debugging)
* Target structures and NMEAGPS class have a __str__() method
which summarizes the objects into a std::string. These are
tied to the __str__ method in python
* Added google unit test for the above functionality
Signed-off-by: Noel Eck <noel.eck@intel.com>
Allow targets to specify a CMake build type but do not set a default
(removed 'Release'). The CXX flags for Release slow the builds down
significantly on Travis-CI (which can hit the time limit for jobs).
Signed-off-by: Noel Eck <noel.eck@intel.com>
Removed the 'return false;' lines after throws since these are not
needed and are generally flagged by static analysis tools. Also removed
a EOL spaces and added initializers for member variables at declaration
(since more than one constructor exists).
Signed-off-by: Noel Eck <noel.eck@intel.com>
This commit adds an additional constructor to the MHZ16 which takes a
path (string reference) to a UART device on the filesystem.
Example: MHZ16("/dev/ttyS0");
* Added constructor for device path w/default
* Removed unused global consts from header
Signed-off-by: g-vidal <gerard.vidal@ens-lyon.fr>
Signed-off-by: Noel Eck <noel.eck@intel.com>
While a 'make install' under a target library directory (build/src/lcd)
will build all dependencies required to make the target, it will NOT
install those dependencies. This can cause confusion for developers.
Adding a note to the build docs to clarify this case.
Signed-off-by: Noel Eck <noel.eck@intel.com>
This commit removes the double-backslash when installing the examples.
Before:
.../upm//examples/...
Before:
.../upm/examples/...
Signed-off-by: Noel Eck <noel.eck@intel.com>
Updated the API documentation with changes to the kx122. Removed a few
extra EOL spaces.
Signed-off-by: Antoine W. Campagna <AntoineW@Campagna.org>
Signed-off-by: Noel Eck <noel.eck@intel.com>
Renamed find module from FindCordova to FindUpmCordovaGenerator to be
more descriptive with the intent of the find module. Updated the find
module to use find_package_handle_standard_args so a version can be
specified and handle REQUIRED keyword.
Signed-off-by: Noel Eck <noel.eck@intel.com>
The UPM Cordova binding generator creates Cordova plugs for each Java
package when BUILDCORDOVA=ON and BUILDSWIGJAVA=ON. This requires an NPM
install of the UPM Cordova plugin generator. Cordova bindings are built
under <build-dir>/cordova.
Signed-off-by: Noel Eck <noel.eck@intel.com>
The hardcoded frequency of 10kHz was much slower than the capacity of the device
Signed-off-by: Antoine W. Campagna <AntoineW@Campagna.org>
Signed-off-by: Noel Eck <noel.eck@intel.com>
It appears that an additional tsl2561 Java example existed.
Removed the *newer* Tsl2561_Example.java in favor of the original
example. Updated all corresponding collateral which references the
Tsl2561_Example.java file (CMake and library descriptor file).
Signed-off-by: Noel Eck <noel.eck@intel.com>
Be a bit more lenient with the acceptable range for the microsecond
flavor of upm_delay (+/- 150us instead of +/- 100us).
Signed-off-by: Noel Eck <noel.eck@intel.com>
Added an additional job to the CI matrix which does a minimal UPM
build (only C, C++, and unit tests) which can run and pass/fail quickly.
Signed-off-by: Noel Eck <noel.eck@intel.com>