]> oss.titaniummirror.com Git - rgblamp.git/commitdiff
Rocker switch off condition is both inputs high
authorR. Steve McKown <rsmckown@gmail.com>
Sat, 10 Dec 2011 17:35:26 +0000 (10:35 -0700)
committerR. Steve McKown <rsmckown@gmail.com>
Sat, 10 Dec 2011 17:35:26 +0000 (10:35 -0700)
Before 09441b496c6b40be151e4e655572cb37518e7225, the logic used "% 3",
which effectively converted 0b11 input to 0.  Since the mod operation
is slow and code expensive, it was removed.  Therefore the off condition
state has changed to 0b11.

btn.h

diff --git a/btn.h b/btn.h
index 093298bb86c66b0134bf63396e62bf2fe0b31652..8f0e3c18cea895d3c09ceb1448477a3b4a662a1d 100644 (file)
--- a/btn.h
+++ b/btn.h
@@ -21,9 +21,10 @@ enum {
   BTN_PB_DOWN = 0,
   BTN_PB_UP,
 
-  BTN_RS_OFF = 0,
+  BTN_RS_NONE = 0,
   BTN_RS_LEFT,
   BTN_RS_RIGHT,
+  BTN_RS_OFF,
 };
 
 /* Read the current state of the pushbutton */