]> git.donarmstrong.com Git - qmk_firmware.git/commitdiff
Make `readPin` output a 0 or 1 when using AVR to match ChibiOS's version of `readPin`
authorDanny Nguyen <danny@keeb.io>
Tue, 18 Dec 2018 21:17:29 +0000 (16:17 -0500)
committerDrashna Jaelre <drashna@live.com>
Wed, 19 Dec 2018 16:37:44 +0000 (08:37 -0800)
quantum/quantum.h

index 0faf1af29c876da170b4ad4713cfd95441bad23a..f78915fdfbc0376b77d7e5473badf28b65322da8 100644 (file)
@@ -161,7 +161,7 @@ extern uint32_t default_layer_state;
         }
     }
 
-    #define readPin(pin) (PIN_ADDRESS(pin, 0) & _BV(pin & 0xF))
+    #define readPin(pin) ((bool)(PIN_ADDRESS(pin, 0) & _BV(pin & 0xF)))
 #elif defined(PROTOCOL_CHIBIOS)
     #define pin_t ioline_t
     #define setPinInput(pin) palSetLineMode(pin, PAL_MODE_INPUT)