chiark / gitweb /
Updated the Debian build system thanks to Ian Jackson for the
[wiringPi.git] / gpio / gpio.c
index 6dc6113af67794ee2adc362d0a4796fe7d860f02..a25f45432d94b5f3c1db9d5e6eeba5cc246a1f5d 100644 (file)
@@ -1194,6 +1194,17 @@ int main (int argc, char *argv [])
       printf ("Raspberry Pi Details:\n") ;
       printf ("  Type: %s, Revision: %s, Memory: %dMB, Maker: %s %s\n", 
          piModelNames [model], piRevisionNames [rev], mem, piMakerNames [maker], overVolted ? "[OV]" : "") ;
+
+// Quick check for /dev/gpiomem
+
+      if ((i = open ("/dev/gpiomem", O_RDWR | O_SYNC | O_CLOEXEC) ) >= 0)
+       printf ("  This Raspberry Pi supports user-level GPIO access via /dev/gpiomem.\n") ;
+      else
+      {
+       printf ("  You need to run your programs as root for GPIO access\n") ;
+       printf ("  (Old /dev/mem method - consider upgrading)\n") ;
+      }
+      
     }
     return 0 ;
   }