add system LED initialisation

Change-Id: I79f1b769fc9dd7e1a972bacf0928ff46988f0e36
This commit is contained in:
Kevin Redon 2019-01-03 18:02:23 +01:00
parent 5c7d9805c2
commit d25509abca
2 changed files with 9 additions and 0 deletions

View File

@ -27,6 +27,10 @@
#define GPIO_PIN_FUNCTION_M 12
#define GPIO_PIN_FUNCTION_N 13
/** LED pin to indicate system state (pull low to switch on */
#define LED_SYSTEM GPIO(GPIO_PORTC, 18)
/** USB D+/D- pins */
#define PA24 GPIO(GPIO_PORTA, 24)
#define PA25 GPIO(GPIO_PORTA, 25)

View File

@ -143,6 +143,11 @@ void system_init(void)
{
init_mcu();
// configure system LED
gpio_set_pin_level(LED_SYSTEM, true); // switch off LED
gpio_set_pin_direction(LED_SYSTEM, GPIO_DIRECTION_OUT);
gpio_set_pin_function(LED_SYSTEM, GPIO_PIN_FUNCTION_OFF);
USB_DEVICE_INSTANCE_init();
FLASH_0_init();
}