diff options
| author | Jack Humbert <jack.humb@gmail.com> | 2017-11-14 16:11:29 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-11-14 16:11:29 -0500 |
| commit | ec3e065f0d2c65175384699cb11fa388250fa914 (patch) | |
| tree | e66837d6af1a30b739303bfa06043edf12f9fcc1 /lib | |
| parent | 3c15c48e6a5c584d225d369ea458f9a3f9cd3d57 (diff) | |
| download | qmk_firmware-ec3e065f0d2c65175384699cb11fa388250fa914.tar.gz qmk_firmware-ec3e065f0d2c65175384699cb11fa388250fa914.zip | |
QMK DFU bootloader generation (#2009)
* adds :bootloader target
* update planck and preonic revisions
* remove references to .h files for planck
* update preonic keymap
* only add keyboard.h files that exist
* add production target
* hook things up with the new lufa variables
* update rules for planck/preonic
* back backlight key turn of status led when pressed
* add manufacturer/product strings to bootloader
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/lufa/.gitignore | 1 | ||||
| -rw-r--r-- | lib/lufa/Bootloaders/DFU/BootloaderDFU.c | 14 | ||||
| -rw-r--r-- | lib/lufa/Bootloaders/DFU/Descriptors.c | 12 | ||||
| -rw-r--r-- | lib/lufa/Bootloaders/DFU/Descriptors.h | 8 | ||||
| -rw-r--r-- | lib/lufa/LUFA/Drivers/Board/AVR8/QMK/LEDs.h | 18 |
5 files changed, 39 insertions, 14 deletions
diff --git a/lib/lufa/.gitignore b/lib/lufa/.gitignore index 9f9d39491..1cd1dccf8 100644 --- a/lib/lufa/.gitignore +++ b/lib/lufa/.gitignore | |||
| @@ -13,3 +13,4 @@ Documentation/ | |||
| 13 | LUFA/StudioIntegration/ProjectGenerator/* | 13 | LUFA/StudioIntegration/ProjectGenerator/* |
| 14 | LUFA/StudioIntegration/DocBook/* | 14 | LUFA/StudioIntegration/DocBook/* |
| 15 | !LUFA/StudioIntegration/Docbook/mshelp/* | 15 | !LUFA/StudioIntegration/Docbook/mshelp/* |
| 16 | Keyboard.h \ No newline at end of file | ||
diff --git a/lib/lufa/Bootloaders/DFU/BootloaderDFU.c b/lib/lufa/Bootloaders/DFU/BootloaderDFU.c index 928cf6fe3..a2307219e 100644 --- a/lib/lufa/Bootloaders/DFU/BootloaderDFU.c +++ b/lib/lufa/Bootloaders/DFU/BootloaderDFU.c | |||
| @@ -196,7 +196,7 @@ int main(void) | |||
| 196 | while (RunBootloader || WaitForExit) { | 196 | while (RunBootloader || WaitForExit) { |
| 197 | USB_USBTask(); | 197 | USB_USBTask(); |
| 198 | #if (BOARD == BOARD_QMK) | 198 | #if (BOARD == BOARD_QMK) |
| 199 | bool pressed = (PIN(QMK_ESC_ROW) & NUM(QMK_ESC_ROW)); | 199 | bool pressed = (PIN(QMK_ESC_INPUT) & NUM(QMK_ESC_INPUT)); |
| 200 | if ((DFU_State == dfuIDLE) && (keypress > 5000) && pressed) { | 200 | if ((DFU_State == dfuIDLE) && (keypress > 5000) && pressed) { |
| 201 | break; | 201 | break; |
| 202 | } | 202 | } |
| @@ -231,12 +231,12 @@ static void SetupHardware(void) | |||
| 231 | MCUCR = (1 << IVSEL); | 231 | MCUCR = (1 << IVSEL); |
| 232 | 232 | ||
| 233 | #if (BOARD == BOARD_QMK) | 233 | #if (BOARD == BOARD_QMK) |
| 234 | // column setup | 234 | // output setup |
| 235 | DDR(QMK_ESC_COL) |= NUM(QMK_ESC_COL); | 235 | DDR(QMK_ESC_OUTPUT) |= NUM(QMK_ESC_OUTPUT); |
| 236 | PORT(QMK_ESC_COL) |= NUM(QMK_ESC_COL); | 236 | PORT(QMK_ESC_OUTPUT) |= NUM(QMK_ESC_OUTPUT); |
| 237 | 237 | ||
| 238 | // row setup | 238 | // input setup |
| 239 | DDR(QMK_ESC_ROW) |= NUM(QMK_ESC_ROW); | 239 | DDR(QMK_ESC_INPUT) |= NUM(QMK_ESC_INPUT); |
| 240 | #endif | 240 | #endif |
| 241 | 241 | ||
| 242 | /* Initialize the USB and other board hardware drivers */ | 242 | /* Initialize the USB and other board hardware drivers */ |
| @@ -265,7 +265,7 @@ static void ResetHardware(void) | |||
| 265 | MCUCR = 0; | 265 | MCUCR = 0; |
| 266 | 266 | ||
| 267 | #if (BOARD == BOARD_QMK) | 267 | #if (BOARD == BOARD_QMK) |
| 268 | DDR(QMK_ESC_COL) = PORT(QMK_ESC_COL) = DDR(QMK_ESC_ROW) = PORT(QMK_ESC_ROW) = 0; | 268 | DDR(QMK_ESC_OUTPUT) = PORT(QMK_ESC_OUTPUT) = DDR(QMK_ESC_INPUT) = PORT(QMK_ESC_INPUT) = 0; |
| 269 | #endif | 269 | #endif |
| 270 | } | 270 | } |
| 271 | 271 | ||
diff --git a/lib/lufa/Bootloaders/DFU/Descriptors.c b/lib/lufa/Bootloaders/DFU/Descriptors.c index 6b7b6d490..46120781b 100644 --- a/lib/lufa/Bootloaders/DFU/Descriptors.c +++ b/lib/lufa/Bootloaders/DFU/Descriptors.c | |||
| @@ -36,6 +36,14 @@ | |||
| 36 | */ | 36 | */ |
| 37 | 37 | ||
| 38 | #include "Descriptors.h" | 38 | #include "Descriptors.h" |
| 39 | #include "Keyboard.h" | ||
| 40 | |||
| 41 | #ifndef MANUFACTURER | ||
| 42 | #define MANUFACTURER QMK | ||
| 43 | #endif | ||
| 44 | #ifndef PRODUCT | ||
| 45 | #define PRODUCT Keyboard | ||
| 46 | #endif | ||
| 39 | 47 | ||
| 40 | /** Device descriptor structure. This descriptor, located in SRAM memory, describes the overall | 48 | /** Device descriptor structure. This descriptor, located in SRAM memory, describes the overall |
| 41 | * device characteristics, including the supported USB version, control endpoint size and the | 49 | * device characteristics, including the supported USB version, control endpoint size and the |
| @@ -125,13 +133,13 @@ const USB_Descriptor_String_t LanguageString = USB_STRING_DESCRIPTOR_ARRAY(LANGU | |||
| 125 | * form, and is read out upon request by the host when the appropriate string ID is requested, listed in the Device | 133 | * form, and is read out upon request by the host when the appropriate string ID is requested, listed in the Device |
| 126 | * Descriptor. | 134 | * Descriptor. |
| 127 | */ | 135 | */ |
| 128 | const USB_Descriptor_String_t ManufacturerString = USB_STRING_DESCRIPTOR(L"QMK"); | 136 | const USB_Descriptor_String_t ManufacturerString = USB_STRING_DESCRIPTOR(LSTR(MANUFACTURER)); |
| 129 | 137 | ||
| 130 | /** Product descriptor string. This is a Unicode string containing the product's details in human readable form, | 138 | /** Product descriptor string. This is a Unicode string containing the product's details in human readable form, |
| 131 | * and is read out upon request by the host when the appropriate string ID is requested, listed in the Device | 139 | * and is read out upon request by the host when the appropriate string ID is requested, listed in the Device |
| 132 | * Descriptor. | 140 | * Descriptor. |
| 133 | */ | 141 | */ |
| 134 | const USB_Descriptor_String_t ProductString = USB_STRING_DESCRIPTOR(L"KB"); | 142 | const USB_Descriptor_String_t ProductString = USB_STRING_DESCRIPTOR(LSTR(PRODUCT)); |
| 135 | 143 | ||
| 136 | /** This function is called by the library when in device mode, and must be overridden (see library "USB Descriptors" | 144 | /** This function is called by the library when in device mode, and must be overridden (see library "USB Descriptors" |
| 137 | * documentation) by the application code so that the address and size of a requested descriptor can be given | 145 | * documentation) by the application code so that the address and size of a requested descriptor can be given |
diff --git a/lib/lufa/Bootloaders/DFU/Descriptors.h b/lib/lufa/Bootloaders/DFU/Descriptors.h index 5487f88f3..7137d0f11 100644 --- a/lib/lufa/Bootloaders/DFU/Descriptors.h +++ b/lib/lufa/Bootloaders/DFU/Descriptors.h | |||
| @@ -189,6 +189,12 @@ | |||
| 189 | const uint16_t wIndex, | 189 | const uint16_t wIndex, |
| 190 | const void** const DescriptorAddress) | 190 | const void** const DescriptorAddress) |
| 191 | ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3); | 191 | ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3); |
| 192 | 192 | // convert to L string | |
| 193 | #define LSTR(s) XLSTR(s) | ||
| 194 | #define XLSTR(s) L ## #s | ||
| 195 | // convert to string | ||
| 196 | #define STR(s) XSTR(s) | ||
| 197 | #define XSTR(s) #s | ||
| 198 | |||
| 193 | #endif | 199 | #endif |
| 194 | 200 | ||
diff --git a/lib/lufa/LUFA/Drivers/Board/AVR8/QMK/LEDs.h b/lib/lufa/LUFA/Drivers/Board/AVR8/QMK/LEDs.h index 9fc696be9..be66b9ed2 100644 --- a/lib/lufa/LUFA/Drivers/Board/AVR8/QMK/LEDs.h +++ b/lib/lufa/LUFA/Drivers/Board/AVR8/QMK/LEDs.h | |||
| @@ -103,10 +103,20 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 103 | #define A6 0x06 | 103 | #define A6 0x06 |
| 104 | #define A7 0x07 | 104 | #define A7 0x07 |
| 105 | 105 | ||
| 106 | #define QMK_ESC_COL F1 | 106 | #include "Keyboard.h" |
| 107 | #define QMK_ESC_ROW D5 | 107 | |
| 108 | #define QMK_LED E6 | 108 | #ifndef QMK_ESC_INPUT |
| 109 | #define QMK_SPEAKER C6 | 109 | #define QMK_ESC_INPUT F1 |
| 110 | #endif | ||
| 111 | #ifndef QMK_ESC_OUTPUT | ||
| 112 | #define QMK_ESC_OUTPUT D5 | ||
| 113 | #endif | ||
| 114 | #ifndef QMK_LED | ||
| 115 | #define QMK_LED E6 | ||
| 116 | #endif | ||
| 117 | #ifndef QMK_SPEAKER | ||
| 118 | #define QMK_SPEAKER C6 | ||
| 119 | #endif | ||
| 110 | 120 | ||
| 111 | #define DDR(pin) _SFR_IO8(((pin) >> 4) + 1) | 121 | #define DDR(pin) _SFR_IO8(((pin) >> 4) + 1) |
| 112 | #define PORT(pin) _SFR_IO8(((pin) >> 4) + 2) | 122 | #define PORT(pin) _SFR_IO8(((pin) >> 4) + 2) |
