Widen the ARM Cortex-M family support. Allow USB peripheral change. (#18767)

This commit is contained in:
Nick Brassel 2022-10-19 17:17:49 +11:00 committed by GitHub
parent d2bc11ca67
commit f99b9ba270
Failed to generate hash of commit
3 changed files with 59 additions and 5 deletions

View file

@ -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);

View file

@ -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;
}