From efdbf4b0a87e25f64c6d4b0f2eab6c3d37079e4c Mon Sep 17 00:00:00 2001 From: Brendan Le Foll Date: Wed, 25 Feb 2015 15:43:38 +0000 Subject: [PATCH] common: add C++ init() call and explain reason to call again Signed-off-by: Brendan Le Foll --- api/mraa/common.h | 4 +++- api/mraa/common.hpp | 14 ++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/api/mraa/common.h b/api/mraa/common.h index 0b641cc..b4c0839 100644 --- a/api/mraa/common.h +++ b/api/mraa/common.h @@ -46,7 +46,9 @@ typedef unsigned int mraa_boolean_t; /** * Initialise MRAA * - * Detects running platform and attempts to use included pinmap + * Detects running platform and attempts to use included pinmap, this is run on + * module/library init/load but is handy to rerun to check board initialised + * correctly. Anything but MRAA_SUCCESS should be considered a critical failure * * @return Result of operation */ diff --git a/api/mraa/common.hpp b/api/mraa/common.hpp index a144b13..7c9fe12 100644 --- a/api/mraa/common.hpp +++ b/api/mraa/common.hpp @@ -39,6 +39,20 @@ namespace mraa { * This file defines the interface for libmraa common functions */ +/** + * Initialise MRAA + * + * Detects running platform and attempts to use included pinmap, this is run on + * module/library init/load but is handy to rerun to check board initialised + * correctly. Anything but MRAA_SUCCESS should be considered a critical failure + * + * @return Result of operation + */ +inline mraa_result_t init() +{ + return mraa_init(); +} + /** * Get libmraa version. *