Private
Public Access
2
0

python: Throw exception if mraa_init() fails

Signed-off-by: Henry Bruce <henry.bruce@intel.com>
This commit is contained in:
Henry Bruce
2016-03-01 13:34:28 -08:00
committed by Brendan Le Foll
parent 51c60a0ac4
commit 076a648ef9

View File

@@ -158,8 +158,10 @@ class Spi;
PyEval_InitThreads();
// Add mraa_init() to the module initialisation process and set isr function
mraa_result_t res = mraa_init();
if (res == MRAA_SUCCESS || res == MRAA_ERROR_PLATFORM_ALREADY_INITIALISED) {
if (res == MRAA_SUCCESS) {
lang_func->python_isr = &mraa_python_isr;
}
else
SWIG_Error(SWIG_RuntimeError, "mraa_init() failed");
%}