Skip to content

Commit

Permalink
Enable force platform minnowboard turbot
Browse files Browse the repository at this point in the history
Compile error would result if force minnowboard max. This is
because mraa_intel_minnowboard_byt_compatible signature requires
bool option for max or turbot board variations. This patch allows
user to force platform for either max or turbot without compile
error.
  • Loading branch information
tripzero committed Sep 27, 2017
1 parent 1a4ba6a commit f55646c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions api/mraa/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ typedef enum {
MRAA_PHYBOARD_WEGA = 14, /**< The phyBOARD-Wega */
MRAA_DE_NANO_SOC = 15, /**< Terasic DE-Nano-SoC Board */
MRAA_UP2 = 16, /**< The UP^2 Board */
MRAA_INTEL_MINNOWBOARD_TURBOT = 17, /**< The Intel Minnow Board Max */

// USB platform extenders start at 256
MRAA_FTDI_FT4222 = 256, /**< FTDI FT4222 USB to i2c bridge */
Expand Down
2 changes: 2 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ if (NOT ${MRAAPLATFORMFORCE} STREQUAL "ALL")
set (mraa_LIB_X86_SRCS_NOAUTO ${PROJECT_SOURCE_DIR}/src/x86/x86.c ${PROJECT_SOURCE_DIR}/src/x86/intel_edison_fab_c.c)
elseif (${MRAAPLATFORMFORCE} STREQUAL "MRAA_INTEL_MINNOWBOARD_MAX")
set (mraa_LIB_X86_SRCS_NOAUTO ${PROJECT_SOURCE_DIR}/src/x86/x86.c ${PROJECT_SOURCE_DIR}/src/x86/intel_minnow_byt_compatible.c)
elseif (${MRAAPLATFORMFORCE} STREQUAL "MRAA_INTEL_MINNOWBOARD_TURBOT")
set (mraa_LIB_X86_SRCS_NOAUTO ${PROJECT_SOURCE_DIR}/src/x86/x86.c ${PROJECT_SOURCE_DIR}/src/x86/intel_minnow_byt_compatible.c)
elseif (${MRAAPLATFORMFORCE} STREQUAL "MRAA_INTEL_NUC5")
set (mraa_LIB_X86_SRCS_NOAUTO ${PROJECT_SOURCE_DIR}/src/x86/x86.c ${PROJECT_SOURCE_DIR}/src/x86/intel_nuc5.c)
elseif (${MRAAPLATFORMFORCE} STREQUAL "MRAA_INTEL_SOFIA_3GR")
Expand Down
8 changes: 6 additions & 2 deletions src/x86/x86.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,14 +124,18 @@ mraa_x86_platform()
}
return platform_type;
#else
mraa_platform_t platform_type = MRAA_PLATFORM_FORCE;

#if defined(xMRAA_INTEL_GALILEO_GEN2)
plat = mraa_intel_galileo_gen2();
#elif defined(xMRAA_INTEL_EDISON_FAB_C)
plat = mraa_intel_edison_fab_c();
#elif defined(xMRAA_INTEL_DE3815)
plat = mraa_intel_de3815();
#elif defined(xMRAA_INTEL_MINNOWBOARD_MAX)
plat = mraa_intel_minnowboard_byt_compatible();
plat = mraa_intel_minnowboard_byt_compatible(0);
#elif defined(xMRAA_INTEL_MINNOWBOARD_TURBOT)
plat = mraa_intel_minnowboard_byt_compatible(1);
#elif defined(xMRAA_INTEL_GALILEO_GEN1)
plat = mraa_intel_galileo_rev_d();
#elif defined(xMRAA_INTEL_NUC5)
Expand All @@ -149,6 +153,6 @@ mraa_x86_platform()
#else
#error "Not using a valid platform value from mraa_platform_t - cannot compile"
#endif
return MRAA_PLATFORM_FORCE;
return platform_type;
#endif
}

0 comments on commit f55646c

Please sign in to comment.