From 77bec8ca2aa7d464cb5d3034a497e0ff8933864a Mon Sep 17 00:00:00 2001 From: "R. Steve McKown" Date: Sat, 10 Dec 2011 10:35:26 -0700 Subject: [PATCH] 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. --- btn.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 */ -- 2.39.2