Skip to content

Commit

Permalink
Allow some usbconfig.h overrides at the keyboard level (qmk#8647)
Browse files Browse the repository at this point in the history
  • Loading branch information
zvecr authored and drashna committed May 24, 2020
1 parent 2a2124c commit e51db58
Showing 1 changed file with 24 additions and 8 deletions.
32 changes: 24 additions & 8 deletions quantum/template/ps2avrgb/usbconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,21 @@ section at the end of this file).

/* ---------------------------- Hardware Config ---------------------------- */

#define USB_CFG_IOPORTNAME D
#ifndef USB_CFG_IOPORTNAME
#define USB_CFG_IOPORTNAME D
#endif
/* This is the port where the USB bus is connected. When you configure it to
* "B", the registers PORTB, PINB and DDRB will be used.
*/
#define USB_CFG_DMINUS_BIT 3
#ifndef USB_CFG_DMINUS_BIT
#define USB_CFG_DMINUS_BIT 3
#endif
/* This is the bit number in USB_CFG_IOPORT where the USB D- line is connected.
* This may be any bit in the port.
*/
#define USB_CFG_DPLUS_BIT 2
#ifndef USB_CFG_DPLUS_BIT
#define USB_CFG_DPLUS_BIT 2
#endif
/* This is the bit number in USB_CFG_IOPORT where the USB D+ line is connected.
* This may be any bit in the port. Please note that D+ must also be connected
* to interrupt pin INT0! [You can also use other interrupts, see section
Expand Down Expand Up @@ -141,7 +147,9 @@ section at the end of this file).
/* This macro (if defined) is executed when a USB SET_ADDRESS request was
* received.
*/
#define USB_COUNT_SOF 1
#ifndef USB_COUNT_SOF
#define USB_COUNT_SOF 1
#endif
/* define this macro to 1 if you need the global variable "usbSofCount" which
* counts SOF packets. This feature requires that the hardware interrupt is
* connected to D- instead of D+.
Expand Down Expand Up @@ -311,10 +319,18 @@ section at the end of this file).

/* Set INT1 for D- falling edge to count SOF */
/* #define USB_INTR_CFG EICRA */
#define USB_INTR_CFG_SET ((1 << ISC11) | (0 << ISC10))
#ifndef USB_INTR_CFG_SET
#define USB_INTR_CFG_SET ((1 << ISC11) | (0 << ISC10))
#endif
/* #define USB_INTR_CFG_CLR 0 */
/* #define USB_INTR_ENABLE EIMSK */
#define USB_INTR_ENABLE_BIT INT1
#ifndef USB_INTR_ENABLE_BIT
#define USB_INTR_ENABLE_BIT INT1
#endif
/* #define USB_INTR_PENDING EIFR */
#define USB_INTR_PENDING_BIT INTF1
#define USB_INTR_VECTOR INT1_vect
#ifndef USB_INTR_PENDING_BIT
#define USB_INTR_PENDING_BIT INTF1
#endif
#ifndef USB_INTR_VECTOR
#define USB_INTR_VECTOR INT1_vect
#endif

0 comments on commit e51db58

Please sign in to comment.