From: R. Steve McKown Date: Sat, 10 Dec 2011 17:35:26 +0000 (-0700) Subject: Rocker switch off condition is both inputs high X-Git-Tag: 1.0~17 X-Git-Url: https://oss.titaniummirror.com/gitweb?p=rgblamp.git;a=commitdiff_plain;h=77bec8ca2aa7d464cb5d3034a497e0ff8933864a Rocker switch off condition is both inputs high 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. --- diff --git a/btn.h b/btn.h index 093298b..8f0e3c1 100644 --- 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 */