File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ def read(sensor, pin):
31
31
# Signal no result could be obtained, but the caller can retry.
32
32
return (None , None )
33
33
elif result == common .DHT_ERROR_GPIO :
34
- raise RuntimeError ('Error accessing GPIO. Make sure program is run as root with sudo! ' )
34
+ raise RuntimeError ('Error accessing GPIO.' )
35
35
elif result != common .DHT_SUCCESS :
36
36
# Some kind of error occured.
37
37
raise RuntimeError ('Error calling DHT test driver read: {0}' .format (result ))
Original file line number Diff line number Diff line change @@ -37,9 +37,9 @@ volatile uint32_t* pi_mmio_gpio = NULL;
37
37
38
38
int pi_mmio_init (void ) {
39
39
if (pi_mmio_gpio == NULL ) {
40
- int fd = open ("/dev/mem " , O_RDWR | O_SYNC );
40
+ int fd = open ("/dev/gpiomem " , O_RDWR | O_SYNC );
41
41
if (fd == -1 ) {
42
- // Error opening /dev/mem. Probably not running as root .
42
+ // Error opening /dev/gpiomem .
43
43
return MMIO_ERROR_DEVMEM ;
44
44
}
45
45
// Map GPIO memory to location in process space.
You can’t perform that action at this time.
0 commit comments