summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSolomon Peachy <pizza@shaftnet.org>2019-02-01 16:42:19 -0500
committerSolomon Peachy <pizza@shaftnet.org>2019-02-01 16:42:19 -0500
commit3d07cdeb230601a4cb65ca3d9a48eafa1c470f0c (patch)
treefc6106bb3aec3dc7c060644d4233426da51fde12
parent4479ad454c28305040f0eb05bce332588efc547f (diff)
downloadaldl_pi-3d07cdeb230601a4cb65ca3d9a48eafa1c470f0c.tar.gz
aldl_pi-3d07cdeb230601a4cb65ca3d9a48eafa1c470f0c.tar.bz2
aldl_pi-3d07cdeb230601a4cb65ca3d9a48eafa1c470f0c.zip
Logic 0 is ALDL 1. Oops.
-rw-r--r--aldl_pi.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/aldl_pi.c b/aldl_pi.c
index 2a74809..bcf98a8 100644
--- a/aldl_pi.c
+++ b/aldl_pi.c
@@ -42,7 +42,7 @@ static char *datalog_fname = "DATALOG.csv";
int readbit(void)
{
- return digitalRead(ALDL_PIN_IN);
+ return !digitalRead(ALDL_PIN_IN); /* Logic low is ALDL '1' */
}
void delayfn(int ms)
{
@@ -54,9 +54,12 @@ int main (int argc, char **argv)
{
int run = 1;
- /* Set up RPi GPIO */
wiringPiSetup();
+ /* Set highest possible priority */
+ piHiPri(99);
+
+ /* Set up RPi GPIO */
pinMode(ALDL_PIN_IN, INPUT);
pullUpDnControl(ALDL_PIN_IN, PUD_DOWN);