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:
committed by
Brendan Le Foll
parent
ccafc77641
commit
759d387c5a
@@ -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
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user