From 88b37e5007de375fcb133e5653f22dc91b487007 Mon Sep 17 00:00:00 2001 From: David Siroky Date: Mon, 18 Jul 2016 16:05:16 +0200 Subject: [PATCH] flash-bsl RTS/DTR via GPIO --- drivers/flash_bsl.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/drivers/flash_bsl.c b/drivers/flash_bsl.c index e3eaa3e..c577e6e 100644 --- a/drivers/flash_bsl.c +++ b/drivers/flash_bsl.c @@ -597,9 +597,19 @@ static device_t flash_bsl_open(const struct device_args *args) dev->long_password = args->flags & DEVICE_FLAG_LONG_PW; /* enter bootloader */ - if (bsllib_seq_do(dev->serial_fd, dev->seq) < 0) { - printc_err("BSL entry sequence failed\n"); - goto fail; + if ( args->bsl_gpio_used ) + { + if (bsllib_seq_do_gpio(args->bsl_gpio_rts, args->bsl_gpio_dtr, dev->seq) < 0) { + printc_err("BSL entry sequence failed\n"); + goto fail; + } + } + else + { + if (bsllib_seq_do(dev->serial_fd, dev->seq) < 0) { + printc_err("BSL entry sequence failed\n"); + goto fail; + } } delay_ms(500);