Skip to content

Commit

Permalink
Widen the ARM Cortex-M family support. Allow USB peripheral change. (q…
Browse files Browse the repository at this point in the history
  • Loading branch information
tzarc authored Oct 19, 2022
1 parent d2bc11c commit f99b9ba
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 5 deletions.
53 changes: 52 additions & 1 deletion data/schemas/keyboard.jsonschema
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,58 @@
},
"processor": {
"type": "string",
"enum": ["cortex-m0", "cortex-m0plus", "cortex-m3", "cortex-m4", "MKL26Z64", "MK20DX128", "MK20DX256", "MK64FX512", "MK66FX1M0", "RP2040", "STM32F042", "STM32F072", "STM32F103", "STM32F303", "STM32F401", "STM32F405", "STM32F407", "STM32F411", "STM32F446", "STM32G431", "STM32G474", "STM32L412", "STM32L422", "STM32L432", "STM32L433", "STM32L442", "STM32L443", "GD32VF103", "WB32F3G71", "WB32FQ95", "atmega16u2", "atmega32u2", "atmega16u4", "atmega32u4", "at90usb162", "at90usb646", "at90usb647", "at90usb1286", "at90usb1287", "atmega32a", "atmega328p", "atmega328", "attiny85", "unknown"]
"enum": [
"cortex-m0",
"cortex-m0plus",
"cortex-m3",
"cortex-m4",
"cortex-m7",
"cortex-m23",
"cortex-m33",
"cortex-m35p",
"cortex-m55",
"cortex-m85",
"MKL26Z64",
"MK20DX128",
"MK20DX256",
"MK64FX512",
"MK66FX1M0",
"RP2040",
"STM32F042",
"STM32F072",
"STM32F103",
"STM32F303",
"STM32F401",
"STM32F405",
"STM32F407",
"STM32F411",
"STM32F446",
"STM32G431",
"STM32G474",
"STM32L412",
"STM32L422",
"STM32L432",
"STM32L433",
"STM32L442",
"STM32L443",
"GD32VF103",
"WB32F3G71",
"WB32FQ95",
"atmega16u2",
"atmega32u2",
"atmega16u4",
"atmega32u4",
"at90usb162",
"at90usb646",
"at90usb647",
"at90usb1286",
"at90usb1287",
"atmega32a",
"atmega328p",
"atmega328",
"attiny85",
"unknown"
]
},
"audio": {
"type": "object",
Expand Down
4 changes: 3 additions & 1 deletion tmk_core/protocol/chibios/usb_main.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@
*/

/* The USB driver to use */
#define USB_DRIVER USBD1
#ifndef USB_DRIVER
# define USB_DRIVER USBD1
#endif // USB_DRIVER

/* Initialize the USB driver and bus */
void init_usb_driver(USBDriver *usbp);
Expand Down
7 changes: 4 additions & 3 deletions tmk_core/protocol/chibios/usb_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,14 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <hal.h>
#include "usb_main.h"
#include "usb_util.h"

void usb_disconnect(void) {
usbDisconnectBus(&USBD1);
usbStop(&USBD1);
usbDisconnectBus(&USB_DRIVER);
usbStop(&USB_DRIVER);
}

bool usb_connected_state(void) {
return usbGetDriverStateI(&USBD1) == USB_ACTIVE;
return usbGetDriverStateI(&USB_DRIVER) == USB_ACTIVE;
}

0 comments on commit f99b9ba

Please sign in to comment.