Extract RESET_BUTTON_IS_PRESSED
This commit is contained in:
@@ -14,6 +14,8 @@
|
||||
#define RESET_BUTTON_IRQ PORTB_IRQn
|
||||
#define RESET_BUTTON_IRQ_HANDLER PORTB_IRQHandler
|
||||
|
||||
#define RESET_BUTTON_IS_PRESSED !GPIO_ReadPinInput(RESET_BUTTON_GPIO, RESET_BUTTON_PIN)
|
||||
|
||||
// Functions:
|
||||
|
||||
extern void InitResetButton();
|
||||
|
||||
@@ -47,7 +47,7 @@ static volatile usb_status_t UsbMouseAction(void)
|
||||
UsbMouseReport.wheelX = 0;
|
||||
UsbMouseReport.wheelY = 0;
|
||||
|
||||
if (!GPIO_ReadPinInput(RESET_BUTTON_GPIO, RESET_BUTTON_PIN)) {
|
||||
if (RESET_BUTTON_IS_PRESSED) {
|
||||
if (!(scrollCounter % 10)) {
|
||||
UsbMouseReport.wheelX = -1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user