Skip to content

Commit

Permalink
close #14, #15
Browse files Browse the repository at this point in the history
  • Loading branch information
thortex committed Sep 14, 2016
1 parent f7445dc commit 22be047
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion webiopi_0.7.1/python/native/cpuinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ int get_rpi_revision(void)
ret = get_rpi_info(&info);

if (0 == ret) {
return info->p1_revision;
return info.p1_revision;
} else {
return -1;
}
Expand Down
7 changes: 4 additions & 3 deletions webiopi_0.7.1/python/native/gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ int setup(void)
{
int mem_fd;
uint8_t *gpio_mem;
uint32_t peri_base;
uint32_t peri_base = BCM2709_PERI_BASE_DEFAULT;
uint32_t gpio_base;
unsigned char buf[4];
FILE *fp;
Expand Down Expand Up @@ -143,8 +143,9 @@ int setup(void)
return SETUP_CPUINFO_FAIL;

while(!feof(fp) && !found) {
fgets(buffer, sizeof(buffer), fp);
sscanf(buffer, "Hardware : %s", hardware);
if (fgets(buffer, sizeof(buffer), fp)) {
sscanf(buffer, "Hardware : %s", hardware);
}
if (strcmp(hardware, "BCM2708") == 0 || strcmp(hardware, "BCM2835") == 0) {
// pi 1 hardware
peri_base = BCM2708_PERI_BASE_DEFAULT;
Expand Down
2 changes: 2 additions & 0 deletions webiopi_0.7.1/python/native/gpio.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ SOFTWARE.
#define SETUP_DEVMEM_FAIL 1
#define SETUP_MALLOC_FAIL 2
#define SETUP_MMAP_FAIL 3
#define SETUP_CPUINFO_FAIL 4
#define SETUP_NOT_RPI_FAIL 5

#define GPIO_COUNT 54

Expand Down

0 comments on commit 22be047

Please sign in to comment.