Update reportedLevels prior to monitoring bits
authorGuy McSwain <guy.mcswain@gmail.com>
Mon, 17 Sep 2018 18:32:43 +0000 (13:32 -0500)
committerGuy McSwain <guy.mcswain@gmail.com>
Mon, 17 Sep 2018 18:32:43 +0000 (13:32 -0500)
pigpio.c

index 68dab59b56157c1b19a6f7a971bbef2e96bc194e..427f31aa767241b5ebb76eac9696cc715f3e99dc 100644 (file)
--- a/pigpio.c
+++ b/pigpio.c
@@ -6371,6 +6371,7 @@ static void * pthAlertThread(void *x)
       }
 
       alertEmit(sample, reports, changedBits, sTick);
+      reportedLevel = sample[numSamples -1].level;
 
       if (totalSamples > gpioStats.maxSamples)
          gpioStats.maxSamples = numSamples;