From a797003ec6ea3a9e38abff9b523a391ed8bd8d9f Mon Sep 17 00:00:00 2001 From: Henry Bruce Date: Tue, 1 Mar 2016 11:15:43 -0800 Subject: [PATCH] mraa.c: Create null platform if a known platform is not detected. This is a partial replication of firmata branch commit 2f25468 as that patch would not apply to the javacheck2 branch Signed-off-by: Henry Bruce --- src/mraa.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/mraa.c b/src/mraa.c index 9ff9afc..b2307ea 100644 --- a/src/mraa.c +++ b/src/mraa.c @@ -116,8 +116,7 @@ mraa_init() platform_name = NULL; } -#if defined(USBPLAT) - // This is a platform extender so create null base platform if one doesn't already exist + // Create null base platform if one doesn't already exist if (plat == NULL) { plat = (mraa_board_t*) calloc(1, sizeof(mraa_board_t)); if (plat != NULL) { @@ -125,6 +124,8 @@ mraa_init() plat->platform_name = "Unknown platform"; } } + +#if defined(USBPLAT) // Now detect sub platform, note this is not an else since we could be in // an error case and fall through to MRAA_ERROR_PLATFORM_NOT_INITIALISED if (plat != NULL) {