1698 Commits

Author SHA1 Message Date
Noel Eck
585f2eb331 cmake: Added return/clear variable to function
Made sure output_variable gets cleared for case where
target compiler is not supported.

Signed-off-by: Noel Eck <noel.eck@intel.com>
2016-10-26 11:42:20 -07:00
Noel Eck
e21e05a039 tests: Default ctest option to off
The UPM ctests require python which will fail cmake configure if not
available.  Defaulting to OFF for now.

Signed-off-by: Noel Eck <noel.eck@intel.com>
2016-10-26 11:32:57 -07:00
Jon Trulson
8820fd159a gp2y0a: fix context allocation error message
Signed-off-by: Jon Trulson <jtrulson@ics.com>
2016-10-25 17:21:26 -06:00
Jon Trulson
99abe95a97 lm35: fix potential reference of uninitialized memory
Signed-off-by: Jon Trulson <jtrulson@ics.com>
2016-10-25 17:05:16 -06:00
Jon Trulson
bfe64789b6 lcm1602: fix potential reference of uninitialized memory
Signed-off-by: Jon Trulson <jtrulson@ics.com>
2016-10-25 17:05:16 -06:00
Jon Trulson
654c3be71e jhd1313m1: fix potential reference of uninitialized memory
Signed-off-by: Jon Trulson <jtrulson@ics.com>
2016-10-25 17:05:16 -06:00
Jon Trulson
370d43d1b3 gp2y0a: test for NULL alloc and clear allocated memory
Signed-off-by: Jon Trulson <jtrulson@ics.com>
2016-10-25 17:05:16 -06:00
Jon Trulson
1483ab6a88 ds18b20: add additional check for no devices found
Signed-off-by: Jon Trulson <jtrulson@ics.com>
2016-10-25 17:05:16 -06:00
Jon Trulson
092f84437f apa102: fix potential reference of uninitialized memory
Signed-off-by: Jon Trulson <jtrulson@ics.com>
2016-10-25 17:05:16 -06:00
Jon Trulson
d9850cf0f6 nrf8001: fix potential reference of uninitialized memory
Signed-off-by: Jon Trulson <jtrulson@ics.com>
2016-10-25 17:05:16 -06:00
Jon Trulson
df0a23f702 CMakeLists.txt: make sure compiler standards extensions are disabled.
Signed-off-by: Jon Trulson <jtrulson@ics.com>
2016-10-25 16:13:41 -06:00
Noel Eck
6be7012987 Werror: Enable warnings as errors
Added C/CXX warning messages similar to MRAA (w/ -Werror).

    * Added syslog warning for missing switch cases
    * Cleaned up uint vs int usage
    * Fixed redifinition errors for C structs
    * Added virtual destructors for base classes
    * Removed redundant CMAKE_CXX_FLAGS from COMPILE_FLAGS for all three
      wrapper languages.  The CMAKE_CXX_FLAGS were showing up twice in
      the compile commands for the wrappers.
    * Added CMake WERROR option to enable/disable warnings as errors for
      all targets.
    * Disable a handful of compiler warnings for the wrapper cxx files,
      this minimizes the number of warnings from auto-generated code).

Signed-off-by: Noel Eck <noel.eck@intel.com>
2016-10-25 13:25:32 -07:00
Jon Trulson
58dfa9d95a uln200xa: C implementation and examples
Signed-off-by: Jon Trulson <jtrulson@ics.com>
2016-10-24 16:05:39 -06:00
Noel Eck
7e0862cecc cmake: Fix for cmake < 3.0.0 swig python bindings.
There is a bug in the UseSWIG.cmake file for cmake < 3.0.0
where it does not use the SWIG outdir correctly.

This fix instead sets the CMAKE_CURRENT_BINARY_DIR which is used
by UseSWIG.cmake to place the wrapper file (and other collateral).

Before (w/cmake < 3):

    build/src/dfrph/pyupm_dfrphPYTHON_wrap.cxx

After:

    build/src/dfrph/python2.7/pyupm_dfrphPYTHON_wrap.cxx

Signed-off-by: Noel Eck <noel.eck@intel.com>
2016-10-21 16:22:50 -07:00
Jon Trulson
3cec185d91 swig python: build with CMAKE_CXX_FLAGS, not CMAKE_C_FLAGS
Signed-off-by: Jon Trulson <jtrulson@ics.com>
2016-10-21 16:16:17 -06:00
Jon Trulson
ec36a8f519 M_PI define in upm_math.h and remove from rotary_fti.c
Signed-off-by: Jon Trulson <jtrulson@ics.com>
2016-10-21 15:24:46 -06:00
Jon Trulson
1a7fbe37b1 bacnetmstp: C11 conformance; needs XOPEN for timezone
Signed-off-by: Jon Trulson <jtrulson@ics.com>
2016-10-21 15:24:46 -06:00
Jon Trulson
1ae4119925 c11: enable C11 standards conformance unconditionally
Signed-off-by: Jon Trulson <jtrulson@ics.com>
2016-10-21 15:24:46 -06:00
Jon Trulson
f101db2af1 linefinder: C implementation; FTI; C++ wraps C
Signed-off-by: Jon Trulson <jtrulson@ics.com>
2016-10-21 14:22:54 -06:00
Noel Eck
b5a33f6ee3 cmake: Cleanup of src CMakeLists.txt description field
Removed 'upm' string, capitalized first character, added descriptions
where necessary.

Signed-off-by: Noel Eck <noel.eck@intel.com>
2016-10-20 16:19:59 -07:00
Jon Trulson
94cd7f185f c++11: enable c++11 compliance unconditionally.
Signed-off-by: Jon Trulson <jtrulson@ics.com>
2016-10-20 14:22:02 -06:00
Jon Trulson
dd3e5290b2 src/CMakeLists.txt: Always install .jar files in <prefix>/lib/java/
In certain cases (debian/ubuntu multi-arch machines) the jar files
were bing installed in <prefix>/lib/lib/java/.

Regardless of platform or architecture, these files need to be in
<prefix>/lib/java/ .

Signed-off-by: Jon Trulson <jtrulson@ics.com>
2016-10-20 14:21:55 -06:00
Noel Eck
dc48698d86 a110x: Updated description
Updated CMakeListst.txt DESCRIPTION field to better represent the library.

Signed-off-by: Noel Eck <noel.eck@intel.com>
2016-10-19 13:12:43 -07:00
Noel Eck
497a7dbd55 descriptions: Updated cmake DESCRIPTION field
This commit touches a subset of UPM sensors which contain C source.
Cleaned up the CMakeLists.txt DESCRIPTION field to better represent
the library.

Signed-off-by: Noel Eck <noel.eck@intel.com>
2016-10-19 12:18:02 -07:00
Jon Trulson
8ac8be9e0a md: C implementation; C++ wraps C
Signed-off-by: Jon Trulson <jtrulson@ics.com>
2016-10-18 17:04:50 -06:00
Noel Eck
df5b3805c5 cmake: If git-describe failes with *-NOTFOUND, tag version dirty
There is a case where git_describe was returning 'HEAD-HASH-NOTFOUND'
which missed the STREQUAL check and VERSION was set incorrectly.

Changed the STREQUAL to a MATCH on -NOTFOUND.  In this way, any of the
-NOTFOUND returns change the version to dirty.

Signed-off-by: Noel Eck <noel.eck@intel.com>
2016-10-17 15:29:42 -07:00
Jon Trulson
758fa32b75 .gitignore: add wildcard so all build*/ dirs are ignored
Signed-off-by: Jon Trulson <jtrulson@ics.com>
2016-10-17 13:59:05 -06:00
Jon Trulson
770e43c627 rpr220: add C driver and examples; FTI; C++ wraps C
Signed-off-by: Jon Trulson <jtrulson@ics.com>
2016-10-14 13:53:34 -06:00
Jon Trulson
78904ef2b8 rotaryencoder: make sure mraa contexts are NULL after context creation
Signed-off-by: Jon Trulson <jtrulson@ics.com>
2016-10-14 12:09:05 -06:00
Jon Trulson
07d0168a96 rotaryencoder: add C driver and example; FTI; C++ wraps C
Signed-off-by: Jon Trulson <jtrulson@ics.com>
2016-10-13 16:00:04 -06:00
Noel Eck
6ce4b2dcca changelog: Added entries for recent python modules changes
Updated the changelog.md to reflect the recent python modules changes.
Added a vnext which can be replaced with the next UPM release version
number.

Signed-off-by: Noel Eck <noel.eck@intel.com>
2016-10-13 10:23:17 -07:00
Noel Eck
bf425014ab python: Added upm directory for python modules
* Grouped UPM python modules into upm directory, for example:
      /usr/local/lib/python2.7/dist-packages/upm
    * Updated UPM example import statements
    * Removed unused RPATH statements from UPM src CMakeLists.txt,
      currently build collateral contains an explicit RPATH which
      is stripped from the install collateral.
    * Converted python examples to work on both python2 AND python3
    * Added ctest for loading examples w/python3
    * Removed returns from swig macros
    * UPM python module use will change...
        Before:
            import pyupm_dfrph
        After:
            from upm import pyupm_dfrph
            or
            import upm.pyupm_dfrph
            etc...
    * This commit fixes #468

Signed-off-by: Noel Eck <noel.eck@intel.com>
2016-10-13 08:22:40 -07:00
Jon Trulson
8624a07b77 lm35: add C driver and example; FTI; C++ wraps C
Signed-off-by: Jon Trulson <jtrulson@ics.com>
2016-10-12 16:37:59 -06:00
Jon Trulson
cbf94414e2 jhd1313m1/lcm1602: update doxygen headers
Signed-off-by: Jon Trulson <jtrulson@ics.com>
2016-10-11 13:20:54 -06:00
Jon Trulson
758234f887 jhd1313m1: Add C++ wrapper
Signed-off-by: Jon Trulson <jtrulson@ics.com>
2016-10-11 13:20:45 -06:00
Jon Trulson
643d262fef lcm1602: Add C++ wrapper
Signed-off-by: Jon Trulson <jtrulson@ics.com>
2016-10-11 13:20:41 -06:00
Jon Trulson
0c0ad04cf9 lcm1602/jhd1313m1: use correct library names in interface files
Signed-off-by: Jon Trulson <jtrulson@ics.com>
2016-10-07 18:55:18 -06:00
Jon Trulson
7e64848146 bacnetmstp: fix compiler warnings when building python wrappers
Signed-off-by: Jon Trulson <jtrulson@ics.com>
2016-10-07 16:04:44 -06:00
Jon Trulson
64b142ecf3 jhd1313m1: Initial C implementation
Signed-off-by: Jon Trulson <jtrulson@ics.com>
2016-10-07 15:42:16 -06:00
Jon Trulson
7fe6f856a1 lcm1602: Initial C implementation
Signed-off-by: Jon Trulson <jtrulson@ics.com>
2016-10-07 15:42:12 -06:00
Mihai Tudor Panu
255d6139ee mlx90614: patched i2c reads from temperature registers
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2016-10-06 17:31:13 -07:00
Mihai Tudor Panu
94de822499 docs: added STMicro manufacturer and updated corresponding sensors
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2016-10-06 16:44:22 -07:00
Mihai Tudor Panu
bb1155700d docs: minor updates to C driver sensor descriptions
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2016-10-06 15:59:23 -07:00
Noel Eck
c6610bdf46 tests: Switch from PYTHON_EXECUTABLE to PYTHON_DEFAULT_EXECUTABLE
The DetectPython cmake script now outputs a default python executable.
Updated other cmake scripts to use this concept.  Used default where
python2/3 will work, use explicit PYTHON2/3_EXECUTABLE where an
explicit version is needed.  Also, fail if python is required and NO
version of python was found.

Signed-off-by: Noel Eck <noel.eck@intel.com>
2016-10-05 17:12:02 -07:00
Noel Eck
edd8df4c50 encodings: Added check for non-8bit encodings in src tree.
This commit sanitizes source files for unicode encodings which
cause failures in downstream flows (docgen, python2 module loading,
etc...).

    * Removed explicit encodings from src files
    * Replaced 2 byte character encodings with ascii encodies:
        ± -> +/-
        ° -> deg
        “ -> "
        etc...
    * Added ctest to check src tree files for non-8bit encodings

Signed-off-by: Noel Eck <noel.eck@intel.com>
2016-10-05 14:39:30 -07:00
Noel Eck
131947dc74 check_pythonload: Updated assert print.
Print out failing files in order in a python3-friendly way.

Signed-off-by: Noel Eck <noel.eck@intel.com>
2016-10-05 11:54:21 -07:00
Noel Eck
2f78d9f62b python_examples: Reformatted, self-checking, executable
* Moved body of each python example to main.  This allows for basic
      load module testing for CI
    * General cleanup of python modules (crlf/tabs/prints/etc)
    * Chmod'ed to 755 to allow running examples without specifying the
      python interpreter
    * Added ctest for loading python2/3 modules
    * Added jniclasscode pragma for java swig interface files.
    * Updated check_examplenames.py module to check all languages vs. a
      cxx example name
    * Added tests for checking python module and test loading
    * Added 'make test' to travis-ci run (run ctests)
    * Print a more meaningful message when not building cxx docs into
      python modules
    * Updated check_clean.py to only check java wrapper files
    * ENABLED ctests for UPM
    * Deleted using_carrays.py python example - this is covered by other
      examples

Signed-off-by: Noel Eck <noel.eck@intel.com>
2016-10-04 16:10:17 -07:00
Noel Eck
62718daf0b python: Build both python2 and python3 modules
Updated UPM cmake to build both python2/3 modules if the necessary
python libs are available.

    * Removed BUILDPYTHON3 cmake option in favor of building both
      versions
    * Added cmake module to find both python2 and python3
    * Added macro which can be called from per-sensor cmake files
      to add dependency libraries via target_link_libraries as well
      as swig_link_libraries (for java, nodejs, and python)
    * Python2 is required for python documentation builds
    * Cleanup of python usage throughout UPM cmakelists.
    * Make find_package for Node required.  Removed check for NODE_FOUND
      (which should have been NODEJS_FOUND) in favor of REQUIRED.
    * The cxx and .py wrapper files get generated in python2/3 (instead
      of the same directory).  It appears these files are identical,
      however since the targets can be built in parallel it's safer to split
      them out.
    * Updated all cmake dependencies related to building documentation.
    * Removed unused classname from cmake files

Signed-off-by: Noel Eck <noel.eck@intel.com>
2016-09-30 17:01:41 -07:00
Jon Trulson
f0fa6f7b68 utilities/101: Add 1 tick offset to nanotimer
In certain cases with the Arduino 101/Zephyr, using the upm_delay*()
functions can cause hangs and/or exceptions.  Adding a single tick to
the generated offset resolves these issues.

The documentation warns that this is a good idea to ensure that a
timer does not expire early.  Adding this made the random hangs and
CPU exceptions go away.

Signed-off-by: Jon Trulson <jtrulson@ics.com>
2016-09-30 17:05:15 -06:00
Jon Trulson
4b149313e6 bmi160: remove leftover debugging
Signed-off-by: Jon Trulson <jtrulson@ics.com>
2016-09-30 17:02:10 -06:00