Private
Public Access
2
0

edison: fix SPI IO pointers usage

Check if SPI IO pointers are holding valid data before using them.

Signed-off-by: Jianxun Zhang <jianxun.zhang@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
Signed-off-by: Mihai Serban <mihai.serban@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
Mihai Serban
2015-11-16 19:10:12 +02:00
committed by Brendan Le Foll
parent ccafc77641
commit 759d387c5a
2 changed files with 36 additions and 29 deletions

View File

@@ -36,6 +36,13 @@
#define MRAA_MAIN_PLATFORM_OFFSET 0
#define MRAA_SUB_PLATFORM_OFFSET 1
/** Executes function func and returns its result in case of error
*/
#define MRAA_RETURN_FOR_ERROR(func) do { \
mraa_result_t res; \
res = func; \
if (res != MRAA_SUCCESS) \
return res;} while(0)
/** @file
*