forked from mirrors/qmk_userspace
Widen the ARM Cortex-M family support. Allow USB peripheral change. (#18767)
This commit is contained in:
parent
d2bc11ca67
commit
f99b9ba270
3 changed files with 59 additions and 5 deletions
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue