Skip to content

Commit

Permalink
rockpi4: fixed the issuse 'No Pins'
Browse files Browse the repository at this point in the history
Signed-off-by: nascs <nascs@radxa.com>
  • Loading branch information
nascs authored and tingleby committed Jun 7, 2023
1 parent 8b1c549 commit 749f958
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/arm/arm.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ mraa_arm_platform()
else if (mraa_file_contains("/proc/device-tree/model", "Avnet Ultra96 Rev1"))
platform_type = MRAA_96BOARDS;
else if (mraa_file_contains("/proc/device-tree/model", "ROCK Pi 4") ||
mraa_file_contains("/proc/device-tree/model", "ROCK PI 4")
mraa_file_contains("/proc/device-tree/model", "ROCK PI 4") ||
mraa_file_contains("/proc/device-tree/model", "ROCK 4")
)
platform_type = MRAA_ROCKPI4;
else if (mraa_file_contains("/proc/device-tree/compatible", "raspberrypi,"))
Expand Down
4 changes: 3 additions & 1 deletion src/arm/rockpi4.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
*/
#define PLATFORM_NAME_ROCK_PI4 "ROCK Pi 4"
#define PLATFORM_NAME_ROCK_PI4_2 "ROCK PI 4"
#define PLATFORM_NAME_ROCK_PI4_3 "ROCK 4"
#define MAX_SIZE 64

const char* rockpi4_serialdev[MRAA_ROCKPI4_UART_COUNT] = { "/dev/ttyS2", "/dev/ttyS4" };
Expand Down Expand Up @@ -70,7 +71,8 @@ mraa_rockpi4()
if (mraa_file_exist(DT_BASE "/model")) {
// We are on a modern kernel, great!!!!
if (mraa_file_contains(DT_BASE "/model", PLATFORM_NAME_ROCK_PI4) ||
mraa_file_contains(DT_BASE "/model", PLATFORM_NAME_ROCK_PI4_2)
mraa_file_contains(DT_BASE "/model", PLATFORM_NAME_ROCK_PI4_2) ||
mraa_file_contains(DT_BASE "/model", PLATFORM_NAME_ROCK_PI4_3)
) {
b->platform_name = PLATFORM_NAME_ROCK_PI4;
b->uart_dev[0].device_path = (char*) rockpi4_serialdev[0];
Expand Down

0 comments on commit 749f958

Please sign in to comment.