usb_cdc: Only call bootloader_request() if CONFIG_HAVE_BOOTLOADER_REQUEST

Check for the build symbol prior to calling bootloader_request().
Enable the build symbol on rp2040, atsam, and atsamd chips.

This also enables serial bootloader requsts on rp2040, atsam, and
atsamd.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2022-12-19 12:04:54 -05:00
parent 806cf233ec
commit 34fd3f41ea
4 changed files with 5 additions and 0 deletions

View File

@ -14,6 +14,7 @@ config ATSAM_SELECT
select HAVE_STRICT_TIMING select HAVE_STRICT_TIMING
select HAVE_CHIPID select HAVE_CHIPID
select HAVE_STEPPER_BOTH_EDGE select HAVE_STEPPER_BOTH_EDGE
select HAVE_BOOTLOADER_REQUEST
config BOARD_DIRECTORY config BOARD_DIRECTORY
string string

View File

@ -14,6 +14,7 @@ config ATSAMD_SELECT
select HAVE_STRICT_TIMING select HAVE_STRICT_TIMING
select HAVE_CHIPID select HAVE_CHIPID
select HAVE_STEPPER_BOTH_EDGE select HAVE_STEPPER_BOTH_EDGE
select HAVE_BOOTLOADER_REQUEST
config HAVE_SERCOM config HAVE_SERCOM
depends on HAVE_GPIO_I2C || HAVE_GPIO_SPI depends on HAVE_GPIO_I2C || HAVE_GPIO_SPI

View File

@ -446,6 +446,8 @@ static uint8_t line_control_state;
static void static void
check_reboot(void) check_reboot(void)
{ {
if (!CONFIG_HAVE_BOOTLOADER_REQUEST)
return;
if (line_coding.dwDTERate == 1200 && !(line_control_state & 0x01)) if (line_coding.dwDTERate == 1200 && !(line_control_state & 0x01))
// A baud of 1200 is an Arduino style request to enter the bootloader // A baud of 1200 is an Arduino style request to enter the bootloader
bootloader_request(); bootloader_request();

View File

@ -14,6 +14,7 @@ config RP2040_SELECT
select HAVE_CHIPID select HAVE_CHIPID
select HAVE_GPIO_HARD_PWM select HAVE_GPIO_HARD_PWM
select HAVE_STEPPER_BOTH_EDGE select HAVE_STEPPER_BOTH_EDGE
select HAVE_BOOTLOADER_REQUEST
config BOARD_DIRECTORY config BOARD_DIRECTORY
string string