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:
@@ -47,24 +47,24 @@ mraa_arm_platform()
|
||||
if (strstr(line, "BCM2708")) {
|
||||
platform_type = MRAA_RASPBERRY_PI;
|
||||
}
|
||||
if (strstr(line, "BCM2709")) {
|
||||
else if (strstr(line, "BCM2709")) {
|
||||
platform_type = MRAA_RASPBERRY_PI;
|
||||
}
|
||||
if (strstr(line, "Generic AM33XX")) {
|
||||
else if (strstr(line, "Generic AM33XX")) {
|
||||
platform_type = MRAA_BEAGLEBONE;
|
||||
}
|
||||
if (strstr(line, "HiKey Development Board")) {
|
||||
else if (strstr(line, "HiKey Development Board")) {
|
||||
platform_type = MRAA_96BOARDS;
|
||||
}
|
||||
if (strstr(line, "sun7i")) {
|
||||
else if (strstr(line, "sun7i")) {
|
||||
if (mraa_file_contains("/sys/firmware/devicetree/base/model", "Banana Pro")) {
|
||||
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;
|
||||
}
|
||||
// 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;
|
||||
}
|
||||
}
|
||||
@@ -79,7 +79,7 @@ mraa_arm_platform()
|
||||
if (platform_type == MRAA_UNKNOWN_PLATFORM) {
|
||||
if (mraa_file_contains("/sys/firmware/devicetree/base/compatible", "qcom,apq8016-sbc"))
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user