Skip to content

Commit

Permalink
Merge pull request #13 from matthiasb85/master
Browse files Browse the repository at this point in the history
added support for maplemini board
  • Loading branch information
daniel-thompson authored Jun 8, 2020
2 parents c90e6ec + 1287b4e commit 3ad87f3
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/bootloader/usbdfu.c
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,15 @@ static usbd_device *usb_init(void)
gpio_set_mode(GPIOA, GPIO_MODE_OUTPUT_2_MHZ, GPIO_CNF_OUTPUT_PUSHPULL,
GPIO11 | GPIO12);
gpio_clear(GPIOA, GPIO11 || GPIO12);

#ifdef USE_MAPLEMINI
/* add support for Maplemini board */
rcc_periph_clock_enable(RCC_GPIOB);
gpio_set_mode(GPIOB, GPIO_MODE_OUTPUT_2_MHZ, GPIO_CNF_OUTPUT_PUSHPULL,
GPIO9);
gpio_clear(GPIOB, GPIO9);
#endif

t = time_now() + 10000;
while (cyclecmp32(time_now(), t) < 0)
;
Expand Down
9 changes: 9 additions & 0 deletions src/i2c-stm32f1-usb/i2c-stm32f1-usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,15 @@ static int usb_fibre(fibre_t *fibre)
gpio_set_mode(GPIOA, GPIO_MODE_OUTPUT_2_MHZ, GPIO_CNF_OUTPUT_PUSHPULL,
GPIO11 | GPIO12);
gpio_clear(GPIOA, GPIO11 | GPIO12);

#ifdef USE_MAPLEMINI
/* add support for Maplemini board */
rcc_periph_clock_enable(RCC_GPIOB);
gpio_set_mode(GPIOB, GPIO_MODE_OUTPUT_2_MHZ, GPIO_CNF_OUTPUT_PUSHPULL,
GPIO9);
gpio_clear(GPIOB, GPIO9);
#endif

t = time_now() + 10000;
PT_WAIT_UNTIL(fibre_timeout(t));

Expand Down

0 comments on commit 3ad87f3

Please sign in to comment.