Private
Public Access
2
0

arm.c: fix conditionals instead of checking all possibilities

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
Brendan Le Foll
2016-02-08 12:03:24 +00:00
parent 14960c4190
commit 51340c6289

View File

@@ -47,24 +47,24 @@ mraa_arm_platform()
if (strstr(line, "BCM2708")) { if (strstr(line, "BCM2708")) {
platform_type = MRAA_RASPBERRY_PI; platform_type = MRAA_RASPBERRY_PI;
} }
if (strstr(line, "BCM2709")) { else if (strstr(line, "BCM2709")) {
platform_type = MRAA_RASPBERRY_PI; platform_type = MRAA_RASPBERRY_PI;
} }
if (strstr(line, "Generic AM33XX")) { else if (strstr(line, "Generic AM33XX")) {
platform_type = MRAA_BEAGLEBONE; platform_type = MRAA_BEAGLEBONE;
} }
if (strstr(line, "HiKey Development Board")) { else if (strstr(line, "HiKey Development Board")) {
platform_type = MRAA_96BOARDS; platform_type = MRAA_96BOARDS;
} }
if (strstr(line, "sun7i")) { else if (strstr(line, "sun7i")) {
if (mraa_file_contains("/sys/firmware/devicetree/base/model", "Banana Pro")) { if (mraa_file_contains("/sys/firmware/devicetree/base/model", "Banana Pro")) {
platform_type = MRAA_BANANA; platform_type = MRAA_BANANA;
} }
if (mraa_file_contains("/sys/firmware/devicetree/base/model", "Banana Pi")) { else if (mraa_file_contains("/sys/firmware/devicetree/base/model", "Banana Pi")) {
platform_type = MRAA_BANANA; platform_type = MRAA_BANANA;
} }
// For old kernels // For old kernels
if (mraa_file_exist("/sys/class/leds/green:ph24:led1")) { else if (mraa_file_exist("/sys/class/leds/green:ph24:led1")) {
platform_type = MRAA_BANANA; platform_type = MRAA_BANANA;
} }
} }
@@ -79,7 +79,7 @@ mraa_arm_platform()
if (platform_type == MRAA_UNKNOWN_PLATFORM) { if (platform_type == MRAA_UNKNOWN_PLATFORM) {
if (mraa_file_contains("/sys/firmware/devicetree/base/compatible", "qcom,apq8016-sbc")) if (mraa_file_contains("/sys/firmware/devicetree/base/compatible", "qcom,apq8016-sbc"))
platform_type = MRAA_96BOARDS; platform_type = MRAA_96BOARDS;
if (mraa_file_contains("/sys/firmware/devicetree/base/model", "HiKey Development Board")) else if (mraa_file_contains("/sys/firmware/devicetree/base/model", "HiKey Development Board"))
platform_type = MRAA_96BOARDS; platform_type = MRAA_96BOARDS;
} }