/* * board.c * * Board-specific setup and management. * * Written & released by Keir Fraser * * This is free and unencumbered software released into the public domain. * See the file COPYING for more details, or visit . */ /* Pull up currently unused and possibly-floating pins. */ static void gpio_pull_up_pins(GPIO gpio, uint16_t mask) { unsigned int i; for (i = 0; i < 16; i++) { if (mask & 1) gpio_configure_pin(gpio, i, GPI_pull_up); mask >>= 1; } } #if STM32F == 1 #include "f1/board.c" #elif STM32F == 7 #include "f7/board.c" #endif void board_init(void) { mcu_board_init(); #ifdef NDEBUG /* Pull up unused debug pins (A9,A10 = serial console). */ gpio_pull_up_pins(gpioa, (1u<<9) | (1u<<10)); #endif /* Activity LED is active low. */ gpio_configure_pin(gpio_led, pin_led, GPO_pushpull(IOSPD_LOW, HIGH)); } /* Set the activity LED status. */ void act_led(bool_t on) { gpio_write_pin(gpio_led, pin_led, on ? LOW : HIGH); } /* * Local variables: * mode: C * c-file-style: "Linux" * c-basic-offset: 4 * tab-width: 4 * indent-tabs-mode: nil * End: */