X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/f201f6697b7f99b63389509b42112026b8f6f76f..40e1caa2da06d6d4699d5dc3dafb3d34b81f23f7:/LUFA/Drivers/Board/AVR8/USBKEY/Joystick.h?ds=inline diff --git a/LUFA/Drivers/Board/AVR8/USBKEY/Joystick.h b/LUFA/Drivers/Board/AVR8/USBKEY/Joystick.h index 5e80a5368..36a4936e2 100644 --- a/LUFA/Drivers/Board/AVR8/USBKEY/Joystick.h +++ b/LUFA/Drivers/Board/AVR8/USBKEY/Joystick.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2011. + Copyright (C) Dean Camera, 2015. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2011 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2015 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted @@ -18,7 +18,7 @@ advertising or publicity pertaining to distribution of the software without specific, written prior permission. - The author disclaim all warranties with regard to this + The author disclaims all warranties with regard to this software, including all implied warranties of merchantability and fitness. In no event shall the author be liable for any special, indirect or consequential damages or any damages @@ -42,6 +42,11 @@ * * Board specific joystick driver header for the Atmel USBKEY. * + * + * + * + *
Left Port PinUp Port PinRight Port PinDown Port PinPress Port Pin
PORTB.6PORTB.7PORTE.4PORTE.5PORTB.5
+ * * @{ */ @@ -91,11 +96,20 @@ #if !defined(__DOXYGEN__) static inline void Joystick_Init(void) { - DDRB &= ~(JOY_BMASK); - DDRE &= ~(JOY_EMASK); + DDRB &= ~JOY_BMASK; + DDRE &= ~JOY_EMASK; + + PORTB |= JOY_BMASK; + PORTE |= JOY_EMASK; + } + + static inline void Joystick_Disable(void) + { + DDRB &= ~JOY_BMASK; + DDRE &= ~JOY_EMASK; - PORTB |= JOY_BMASK; - PORTE |= JOY_EMASK; + PORTB &= ~JOY_BMASK; + PORTE &= ~JOY_EMASK; } static inline uint8_t Joystick_GetStatus(void) ATTR_WARN_UNUSED_RESULT;