edison: add edison detection
* Will look for BODEGA BAY or SALT BAY Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
This commit is contained in:
committed by
Brendan Le Foll
parent
c9c1735e42
commit
cb63c2782e
@@ -39,6 +39,7 @@ extern "C" {
|
|||||||
typedef enum {
|
typedef enum {
|
||||||
MRAA_INTEL_GALILEO_GEN1 = 0, /**< The Generation 1 Galileo platform (RevD) */
|
MRAA_INTEL_GALILEO_GEN1 = 0, /**< The Generation 1 Galileo platform (RevD) */
|
||||||
MRAA_INTEL_GALILEO_GEN2 = 1, /**< The Generation 2 Galileo platform (RevG/H) */
|
MRAA_INTEL_GALILEO_GEN2 = 1, /**< The Generation 2 Galileo platform (RevG/H) */
|
||||||
|
MRAA_INTEL_EDISON_FAB_B = 2, /**< The Intel Edison (FAB B) */
|
||||||
|
|
||||||
MRAA_UNKNOWN_PLATFORM = 99 /**< An unknown platform type, typically will load INTEL_GALILEO_GEN1 */
|
MRAA_UNKNOWN_PLATFORM = 99 /**< An unknown platform type, typically will load INTEL_GALILEO_GEN1 */
|
||||||
} mraa_platform_t;
|
} mraa_platform_t;
|
||||||
|
|||||||
@@ -31,6 +31,7 @@
|
|||||||
#include "mraa_internal.h"
|
#include "mraa_internal.h"
|
||||||
#include "intel_galileo_rev_d.h"
|
#include "intel_galileo_rev_d.h"
|
||||||
#include "intel_galileo_rev_g.h"
|
#include "intel_galileo_rev_g.h"
|
||||||
|
#include "intel_edison_fab_b.h"
|
||||||
#include "gpio.h"
|
#include "gpio.h"
|
||||||
#include "version.h"
|
#include "version.h"
|
||||||
|
|
||||||
@@ -68,6 +69,10 @@ mraa_init()
|
|||||||
if (getline(&line, &len, fh) != -1) {
|
if (getline(&line, &len, fh) != -1) {
|
||||||
if (strncmp(line, "GalileoGen2", 10) == 0) {
|
if (strncmp(line, "GalileoGen2", 10) == 0) {
|
||||||
platform_type = MRAA_INTEL_GALILEO_GEN2;
|
platform_type = MRAA_INTEL_GALILEO_GEN2;
|
||||||
|
} else if (strncmp(line, "BODEGA BAY", 10) == 0) {
|
||||||
|
platform_type = MRAA_INTEL_EDISON_FAB_B;
|
||||||
|
} else if (strncmp(line, "SALT BAY", 7) == 0) {
|
||||||
|
platform_type = MRAA_INTEL_EDISON_FAB_B;
|
||||||
} else {
|
} else {
|
||||||
platform_type = MRAA_INTEL_GALILEO_GEN1;
|
platform_type = MRAA_INTEL_GALILEO_GEN1;
|
||||||
}
|
}
|
||||||
@@ -86,6 +91,9 @@ mraa_init()
|
|||||||
case MRAA_INTEL_GALILEO_GEN1:
|
case MRAA_INTEL_GALILEO_GEN1:
|
||||||
plat = mraa_intel_galileo_rev_d();
|
plat = mraa_intel_galileo_rev_d();
|
||||||
break;
|
break;
|
||||||
|
case MRAA_INTEL_EDISON_FAB_B:
|
||||||
|
plat = mraa_intel_edison_fab_b(&advance_func);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
plat = mraa_intel_galileo_rev_d();
|
plat = mraa_intel_galileo_rev_d();
|
||||||
fprintf(stderr, "Platform not found, initialising MRAA_INTEL_GALILEO_GEN1\n");
|
fprintf(stderr, "Platform not found, initialising MRAA_INTEL_GALILEO_GEN1\n");
|
||||||
|
|||||||
Reference in New Issue
Block a user