common: add C++ init() call and explain reason to call again
authorBrendan Le Foll <brendan.le.foll@intel.com>
Wed, 25 Feb 2015 15:43:38 +0000 (15:43 +0000)
committerBrendan Le Foll <brendan.le.foll@intel.com>
Wed, 25 Feb 2015 15:44:06 +0000 (15:44 +0000)
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
api/mraa/common.h
api/mraa/common.hpp

index 0b641cc..b4c0839 100644 (file)
@@ -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
  */
index a144b13..7c9fe12 100644 (file)
@@ -40,6 +40,20 @@ namespace mraa {
  */
 
 /**
+ * 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.
  *
  * @return libmraa version (e.g. v0.4.0-20-gb408207)