committed by
Henrik Ekblad
parent
fa673bdb3e
commit
95f719b604
@@ -117,7 +117,7 @@ function detect_rpi_revision {
|
||||
|
||||
function detect_machine {
|
||||
local cpu=$(eval "uname -m 2>/dev/null")
|
||||
local machine=$(eval "cat /sys/firmware/devicetree/base/model |tr -d '\0' 2>/dev/null")
|
||||
local machine=$(eval "cat /sys/firmware/devicetree/base/model 2>/dev/null |tr -d '\0'")
|
||||
local hardware=$(eval "grep sunxi_platform /sys/class/sunxi_info/sys_info 2>/dev/null | sed 's/^.*: \(.*\)$/\1/'")
|
||||
if [ -z "$hardware" ]; then
|
||||
local hardware=$(eval "grep Hardware /proc/cpuinfo 2>/dev/null | sed 's/^.*: \(.*\)$/\1/'")
|
||||
|
||||
@@ -92,7 +92,7 @@ void *interruptHandler(void *args)
|
||||
|
||||
// Setup poll structure
|
||||
polls.fd = fd;
|
||||
polls.events = POLLPRI;
|
||||
polls.events = POLLPRI | POLLERR;
|
||||
|
||||
while (1) {
|
||||
// Wait for it ...
|
||||
@@ -103,12 +103,11 @@ void *interruptHandler(void *args)
|
||||
}
|
||||
// Do a dummy read to clear the interrupt
|
||||
// A one character read appars to be enough.
|
||||
// Followed by a seek to reset it.
|
||||
if (read (fd, &c, 1) < 0) {
|
||||
if (lseek (fd, 0, SEEK_SET) < 0) {
|
||||
logError("Interrupt handler error: %s\n", strerror(errno));
|
||||
break;
|
||||
}
|
||||
if (lseek (fd, 0, SEEK_SET) < 0) {
|
||||
if (read (fd, &c, 1) < 0) {
|
||||
logError("Interrupt handler error: %s\n", strerror(errno));
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user