Skip to content

Commit

Permalink
Merge pull request #1690 from elovalvo/master
Browse files Browse the repository at this point in the history
Update for new version of RPi400
  • Loading branch information
andypugh authored Mar 30, 2022
2 parents d8ef751 + ba42462 commit ddec773
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/hal/drivers/cpuinfo.c
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/*
Copyright (c) 2012 Ben Croston
Revised by Ernesto Lo Valvo (ernesto.lovalvo@unipa.it) (12/01/2021)
Revised by Ernesto Lo Valvo (ernesto.lovalvo@unipa.it) (19/03/2022)
Added new version of Raspberry Pi4 and Raspberry Pi 400
Revised for version 3B (15/01/2021)
https://www.raspberrypi.org/documentation/hardware/raspberrypi/revision-codes/README.md
https://www.raspberrypi.com/documentation/computers/raspberry-pi.html#raspberry-pi-revision-codes
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
Expand Down Expand Up @@ -100,7 +100,8 @@ int get_rpi_revision(void)
(strcmp(revision, "c03114") == 0) ||
(strcmp(revision, "d03114") == 0))
return 5;
else if (strcmp(revision, "c03130") == 0) /* Raspberry Pi 400 */
else if ((strcmp(revision, "c03130") == 0) || /* Raspberry Pi 400 */
(strcmp(revision, "c03131") == 0))
return 6;
else /* assume rev 7 */
return 7;
Expand Down
7 changes: 7 additions & 0 deletions src/hal/drivers/hal_pi_gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*
* made work for Raspberry2 9/2015 Michael Haberler
* Last change: Modify for Pi5 10/2019 andypugh
* Last change: Modify for Pi400 3/2022 elovalvo
s********************************************************************/


Expand Down Expand Up @@ -236,6 +237,12 @@ int rtapi_app_main(void)
rtapi_print_msg(RTAPI_MSG_INFO, "%d cores rev %d", ncores, rev);

switch (rev) {
case 6:
rtapi_print_msg(RTAPI_MSG_INFO, "RaspberryPi400\n");
pins = rpi2_pins;
gpios = rpi2_gpios;
npins = sizeof(rpi2_pins);
break;
case 5:
rtapi_print_msg(RTAPI_MSG_INFO, "Raspberry4\n");
pins = rpi2_pins;
Expand Down

0 comments on commit ddec773

Please sign in to comment.