mirror of
https://github.com/embassy-rs/embassy.git
synced 2024-11-21 22:32:29 +00:00
examples/stm32: do not enable vbus detect by default, it doesn't work on all boards.
This commit is contained in:
parent
09781db85d
commit
66e3d4da8d
@ -77,13 +77,11 @@ async fn main(spawner: Spawner) {
|
||||
let ep_out_buffer = &mut OUTPUT_BUFFER.init([0; 256])[..];
|
||||
let mut config = embassy_stm32::usb::Config::default();
|
||||
|
||||
// Enable vbus_detection
|
||||
// Note: some boards don't have this wired up and might not require it,
|
||||
// as they are powered through usb!
|
||||
// If you hang on boot, try setting this to "false"!
|
||||
// See https://embassy.dev/book/dev/faq.html#_the_usb_examples_are_not_working_on_my_board_is_there_anything_else_i_need_to_configure
|
||||
// for more information
|
||||
config.vbus_detection = true;
|
||||
// Do not enable vbus_detection. This is a safe default that works in all boards.
|
||||
// However, if your USB device is self-powered (can stay powered on if USB is unplugged), you need
|
||||
// to enable vbus_detection to comply with the USB spec. If you enable it, the board
|
||||
// has to support it or USB won't work at all. See docs on `vbus_detection` for details.
|
||||
config.vbus_detection = false;
|
||||
|
||||
let driver = Driver::new_fs(p.USB_OTG_FS, Irqs, p.PA12, p.PA11, ep_out_buffer, config);
|
||||
|
||||
|
@ -55,13 +55,11 @@ async fn main(_spawner: Spawner) {
|
||||
let mut ep_out_buffer = [0u8; 256];
|
||||
let mut config = embassy_stm32::usb::Config::default();
|
||||
|
||||
// Enable vbus_detection
|
||||
// Note: some boards don't have this wired up and might not require it,
|
||||
// as they are powered through usb!
|
||||
// If you hang on boot, try setting this to "false"!
|
||||
// See https://embassy.dev/book/dev/faq.html#_the_usb_examples_are_not_working_on_my_board_is_there_anything_else_i_need_to_configure
|
||||
// for more information
|
||||
config.vbus_detection = true;
|
||||
// Do not enable vbus_detection. This is a safe default that works in all boards.
|
||||
// However, if your USB device is self-powered (can stay powered on if USB is unplugged), you need
|
||||
// to enable vbus_detection to comply with the USB spec. If you enable it, the board
|
||||
// has to support it or USB won't work at all. See docs on `vbus_detection` for details.
|
||||
config.vbus_detection = false;
|
||||
|
||||
let driver = Driver::new_fs(p.USB_OTG_FS, Irqs, p.PA12, p.PA11, &mut ep_out_buffer, config);
|
||||
|
||||
|
@ -52,13 +52,11 @@ async fn main(_spawner: Spawner) {
|
||||
let mut ep_out_buffer = [0u8; 256];
|
||||
let mut config = embassy_stm32::usb::Config::default();
|
||||
|
||||
// Enable vbus_detection
|
||||
// Note: some boards don't have this wired up and might not require it,
|
||||
// as they are powered through usb!
|
||||
// If you hang on boot, try setting this to "false"!
|
||||
// See https://embassy.dev/book/dev/faq.html#_the_usb_examples_are_not_working_on_my_board_is_there_anything_else_i_need_to_configure
|
||||
// for more information
|
||||
config.vbus_detection = true;
|
||||
// Do not enable vbus_detection. This is a safe default that works in all boards.
|
||||
// However, if your USB device is self-powered (can stay powered on if USB is unplugged), you need
|
||||
// to enable vbus_detection to comply with the USB spec. If you enable it, the board
|
||||
// has to support it or USB won't work at all. See docs on `vbus_detection` for details.
|
||||
config.vbus_detection = false;
|
||||
|
||||
let driver = Driver::new_fs(p.USB_OTG_FS, Irqs, p.PA12, p.PA11, &mut ep_out_buffer, config);
|
||||
|
||||
|
@ -105,13 +105,11 @@ async fn main(_spawner: Spawner) {
|
||||
let mut ep_out_buffer = [0u8; 256];
|
||||
let mut config = embassy_stm32::usb::Config::default();
|
||||
|
||||
// Enable vbus_detection
|
||||
// Note: some boards don't have this wired up and might not require it,
|
||||
// as they are powered through usb!
|
||||
// If you hang on boot, try setting this to "false"!
|
||||
// See https://embassy.dev/book/dev/faq.html#_the_usb_examples_are_not_working_on_my_board_is_there_anything_else_i_need_to_configure
|
||||
// for more information
|
||||
config.vbus_detection = true;
|
||||
// Do not enable vbus_detection. This is a safe default that works in all boards.
|
||||
// However, if your USB device is self-powered (can stay powered on if USB is unplugged), you need
|
||||
// to enable vbus_detection to comply with the USB spec. If you enable it, the board
|
||||
// has to support it or USB won't work at all. See docs on `vbus_detection` for details.
|
||||
config.vbus_detection = false;
|
||||
|
||||
let driver = Driver::new_fs(p.USB_OTG_FS, Irqs, p.PA12, p.PA11, &mut ep_out_buffer, config);
|
||||
|
||||
|
@ -52,13 +52,11 @@ async fn main(_spawner: Spawner) {
|
||||
let mut ep_out_buffer = [0u8; 256];
|
||||
let mut config = embassy_stm32::usb::Config::default();
|
||||
|
||||
// Enable vbus_detection
|
||||
// Note: some boards don't have this wired up and might not require it,
|
||||
// as they are powered through usb!
|
||||
// If you hang on boot, try setting this to "false"!
|
||||
// See https://embassy.dev/book/dev/faq.html#_the_usb_examples_are_not_working_on_my_board_is_there_anything_else_i_need_to_configure
|
||||
// for more information
|
||||
config.vbus_detection = true;
|
||||
// Do not enable vbus_detection. This is a safe default that works in all boards.
|
||||
// However, if your USB device is self-powered (can stay powered on if USB is unplugged), you need
|
||||
// to enable vbus_detection to comply with the USB spec. If you enable it, the board
|
||||
// has to support it or USB won't work at all. See docs on `vbus_detection` for details.
|
||||
config.vbus_detection = false;
|
||||
|
||||
let driver = Driver::new_fs(p.USB_OTG_FS, Irqs, p.PA12, p.PA11, &mut ep_out_buffer, config);
|
||||
|
||||
|
@ -52,13 +52,11 @@ async fn main(_spawner: Spawner) {
|
||||
let mut ep_out_buffer = [0u8; 256];
|
||||
let mut config = embassy_stm32::usb::Config::default();
|
||||
|
||||
// Enable vbus_detection
|
||||
// Note: some boards don't have this wired up and might not require it,
|
||||
// as they are powered through usb!
|
||||
// If you hang on boot, try setting this to "false"!
|
||||
// See https://embassy.dev/book/dev/faq.html#_the_usb_examples_are_not_working_on_my_board_is_there_anything_else_i_need_to_configure
|
||||
// for more information
|
||||
config.vbus_detection = true;
|
||||
// Do not enable vbus_detection. This is a safe default that works in all boards.
|
||||
// However, if your USB device is self-powered (can stay powered on if USB is unplugged), you need
|
||||
// to enable vbus_detection to comply with the USB spec. If you enable it, the board
|
||||
// has to support it or USB won't work at all. See docs on `vbus_detection` for details.
|
||||
config.vbus_detection = false;
|
||||
|
||||
let driver = Driver::new_fs(p.USB_OTG_FS, Irqs, p.PA12, p.PA11, &mut ep_out_buffer, config);
|
||||
|
||||
|
@ -53,13 +53,11 @@ async fn main(_spawner: Spawner) {
|
||||
let mut ep_out_buffer = [0u8; 256];
|
||||
let mut config = embassy_stm32::usb::Config::default();
|
||||
|
||||
// Enable vbus_detection
|
||||
// Note: some boards don't have this wired up and might not require it,
|
||||
// as they are powered through usb!
|
||||
// If you hang on boot, try setting this to "false"!
|
||||
// See https://embassy.dev/book/dev/faq.html#_the_usb_examples_are_not_working_on_my_board_is_there_anything_else_i_need_to_configure
|
||||
// for more information
|
||||
config.vbus_detection = true;
|
||||
// Do not enable vbus_detection. This is a safe default that works in all boards.
|
||||
// However, if your USB device is self-powered (can stay powered on if USB is unplugged), you need
|
||||
// to enable vbus_detection to comply with the USB spec. If you enable it, the board
|
||||
// has to support it or USB won't work at all. See docs on `vbus_detection` for details.
|
||||
config.vbus_detection = false;
|
||||
|
||||
let driver = Driver::new_fs(p.USB_OTG_FS, Irqs, p.PA12, p.PA11, &mut ep_out_buffer, config);
|
||||
|
||||
|
@ -47,13 +47,11 @@ async fn main(_spawner: Spawner) {
|
||||
let mut ep_out_buffer = [0u8; 256];
|
||||
let mut config = embassy_stm32::usb::Config::default();
|
||||
|
||||
// Enable vbus_detection
|
||||
// Note: some boards don't have this wired up and might not require it,
|
||||
// as they are powered through usb!
|
||||
// If you hang on boot, try setting this to "false"!
|
||||
// See https://embassy.dev/book/dev/faq.html#_the_usb_examples_are_not_working_on_my_board_is_there_anything_else_i_need_to_configure
|
||||
// for more information
|
||||
config.vbus_detection = true;
|
||||
// Do not enable vbus_detection. This is a safe default that works in all boards.
|
||||
// However, if your USB device is self-powered (can stay powered on if USB is unplugged), you need
|
||||
// to enable vbus_detection to comply with the USB spec. If you enable it, the board
|
||||
// has to support it or USB won't work at all. See docs on `vbus_detection` for details.
|
||||
config.vbus_detection = false;
|
||||
|
||||
let driver = Driver::new_fs(p.USB_OTG_FS, Irqs, p.PA12, p.PA11, &mut ep_out_buffer, config);
|
||||
|
||||
|
@ -43,6 +43,10 @@ async fn main(_spawner: Spawner) {
|
||||
// Create the driver, from the HAL.
|
||||
let mut ep_out_buffer = [0u8; 256];
|
||||
let mut config = embassy_stm32::usb::Config::default();
|
||||
// Do not enable vbus_detection. This is a safe default that works in all boards.
|
||||
// However, if your USB device is self-powered (can stay powered on if USB is unplugged), you need
|
||||
// to enable vbus_detection to comply with the USB spec. If you enable it, the board
|
||||
// has to support it or USB won't work at all. See docs on `vbus_detection` for details.
|
||||
config.vbus_detection = false;
|
||||
let driver = Driver::new_fs(p.USB_OTG_FS, Irqs, p.PA12, p.PA11, &mut ep_out_buffer, config);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user