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