Private
Public Access
2
0

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 <henry.bruce@intel.com>
This commit is contained in:
Henry Bruce
2016-03-01 11:15:43 -08:00
committed by Brendan Le Foll
parent 53058d500b
commit a797003ec6

View File

@@ -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) {