stlink: New discovery boards support.

Patch from issue #103
This commit is contained in:
Gareth McMullin 2016-07-13 07:59:03 +12:00
parent fec09464ac
commit 0480578391
1 changed files with 7 additions and 1 deletions

View File

@ -67,7 +67,13 @@ static int stlink_test_nrst(void)
GPIO_CNF_OUTPUT_PUSHPULL, led_idle_run); GPIO_CNF_OUTPUT_PUSHPULL, led_idle_run);
rcc_periph_clock_enable(RCC_GPIOB); rcc_periph_clock_enable(RCC_GPIOB);
gpio_set_mode(GPIOB, GPIO_MODE_INPUT, gpio_set_mode(GPIOB, GPIO_MODE_INPUT,
GPIO_CNF_INPUT_PULL_UPDOWN, pin); GPIO_CNF_INPUT_PULL_UPDOWN, pin | GPIO15);
if (gpio_get(GPIOB, GPIO15)) {
/* ST890 is active low */
gpio_set_mode(GPIOB, GPIO_MODE_OUTPUT_2_MHZ,
GPIO_CNF_OUTPUT_PUSHPULL, GPIO15);
gpio_clear(GPIOB, GPIO15);
}
gpio_set(GPIOB, pin); gpio_set(GPIOB, pin);
systick_value = systick_get_value(); systick_value = systick_get_value();
while (systick_get_value() > (systick_value - 20000)); /* Wait 20 msec*/ while (systick_get_value() > (systick_value - 20000)); /* Wait 20 msec*/