Skip to content
Permalink
Browse files
examples: cleanup examples directory
Following changes are done as a part of cleanup:

1. Moved the platform specific `C` examples from top level examples/
directory to platform/ subdirectory and renamed helloedison.c to
gpio_edison.c

2. C specific examples are moved to a new c/ subdirectory. As a part
of this process, examples are modified to follow same standards
and few new examples are also added.

3. Include the newly added C examples to relevant API documentation

4. Ran clang-format for all source files in c/, c++/, platform/
subdirectories

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
  • Loading branch information
Mani-Sadhasivam authored and arfoll committed Jan 18, 2018
1 parent 3fb65de commit e562c774cf980a4cc52359edeba37cc64b0dc2e9
Show file tree
Hide file tree
Showing 46 changed files with 1,539 additions and 1,022 deletions.
@@ -866,7 +866,9 @@ EXCLUDE_SYMBOLS =
# command).

EXAMPLE_PATH = @CMAKE_CURRENT_SOURCE_DIR@/examples/ \
@CMAKE_CURRENT_SOURCE_DIR@/examples/c \
@CMAKE_CURRENT_SOURCE_DIR@/examples/c++/ \
@CMAKE_CURRENT_SOURCE_DIR@/examples/platform/ \
@CMAKE_CURRENT_SOURCE_DIR@/docs/

# If the value of the EXAMPLE_PATH tag contains directories, you can use the
@@ -30,7 +30,7 @@
* AIO is the anlog input & output interface to libmraa. It is used to read or
* set the voltage applied to an AIO pin.
*
* @snippet analogin_a0.c Interesting
* @snippet aio.c Interesting
*/

#ifdef __cplusplus
@@ -33,7 +33,7 @@
* through sysfs), or memory mapped IO via a /dev/uio device or /dev/mem
* depending again on the board configuration.
*
* @snippet gpio_read6.c Interesting
* @snippet gpio.c Interesting
*/

#ifdef __cplusplus
@@ -32,7 +32,7 @@
* communicate to multiple i2c slaves by configuring the address.
* @htmlinclude i2c.txt
*
* @snippet i2c_HMC5883L.c Interesting
* @snippet i2c_hmc5883l.c Interesting
*/

#ifdef __cplusplus
@@ -67,7 +67,7 @@ typedef struct {
*
* An iio context represents an IIO device
*
* @snippet iio_driver.c Interesting
* @snippet iio.c Interesting
*/

#ifdef __cplusplus
@@ -31,6 +31,7 @@
* LED is the Light Emitting Diode interface to libmraa. It is used to
* access the on board LED's via sysfs.
*
* @snippet led.c Interesting
*/

#ifdef __cplusplus
@@ -33,7 +33,7 @@
* of resolution so make sure you check the board & pin you are using before
* hand.
*
* @snippet cycle-pwm3.c Interesting
* @snippet pwm.c Interesting
*/

#ifdef __cplusplus
@@ -34,7 +34,7 @@
* more information on spidev devices is available
* [here](https://www.kernel.org/doc/Documentation/spi/spidev).
*
* @snippet spi_mcp4261.c Interesting
* @snippet spi.c Interesting
*/

#ifdef __cplusplus
@@ -1,48 +1,5 @@
add_executable (i2c_HMC5883L i2c_HMC5883L.c)
add_executable (hellomraa hellomraa.c)
add_executable (cycle-pwm3 cycle-pwm3.c)
add_executable (blink-io blink-io.c)
add_executable (analogin_a0 analogin_a0.c)
add_executable (isr_pin6 isr_pin6.c)
add_executable (gpio_read6 gpio_read6.c)
add_executable (spi_mcp4261 spi_mcp4261.c)
add_executable (mmap-io2 mmap-io2.c)
add_executable (blink_onboard blink_onboard.c)
add_executable (uart uart.c)
add_executable (spi_max7219 spi_max7219.c)
if (NOT ANDROID_TOOLCHAIN)
add_executable (iio_driver iio_driver.c)
endif ()

include_directories(${PROJECT_SOURCE_DIR}/api)
include_directories(${PROJECT_SOURCE_DIR}/api/mraa)

target_link_libraries (hellomraa mraa)
target_link_libraries (i2c_HMC5883L mraa m)
target_link_libraries (cycle-pwm3 mraa)
target_link_libraries (blink-io mraa)
target_link_libraries (analogin_a0 mraa)
target_link_libraries (isr_pin6 mraa)
target_link_libraries (gpio_read6 mraa)
target_link_libraries (spi_mcp4261 mraa)
target_link_libraries (mmap-io2 mraa)
target_link_libraries (blink_onboard mraa)
target_link_libraries (uart mraa)
target_link_libraries (spi_max7219 mraa)
if (NOT ANDROID_TOOLCHAIN)
target_link_libraries (iio_driver mraa)
endif ()
if (ONEWIRE)
add_executable (uart_ow uart_ow.c)
target_link_libraries (uart_ow mraa)
endif ()

if (FIRMATA)
add_executable (firmata_curie_imu firmata_curie_imu.c)
add_executable (i2c_firmata i2c_firmata.c)
target_link_libraries (firmata_curie_imu mraa)
target_link_libraries (i2c_firmata mraa)
endif ()
add_subdirectory (c)
add_subdirectory (platform)

if (NOT ANDROID_TOOLCHAIN)
add_subdirectory (c++)

This file was deleted.

This file was deleted.

0 comments on commit e562c77

Please sign in to comment.