Make it clear LED is mandatory.

This commit is contained in:
NIIBE Yutaka
2015-06-29 15:58:21 +09:00
parent 15ae2d8b32
commit 97b4471cee
10 changed files with 105 additions and 71 deletions

View File

@@ -344,14 +344,16 @@ gpio_init (void)
AFIO->MAPR |= AFIO_MAPR_SOMETHING;
#endif
GPIO_USB->ODR = VAL_GPIO_ODR;
GPIO_USB->CRH = VAL_GPIO_CRH;
GPIO_USB->CRL = VAL_GPIO_CRL;
/* LED is mandatory. If it's on an independent port, we configure it. */
GPIO_LED->ODR = VAL_GPIO_ODR;
GPIO_LED->CRH = VAL_GPIO_CRH;
GPIO_LED->CRL = VAL_GPIO_CRL;
#if GPIO_USB_BASE != GPIO_LED_BASE
GPIO_LED->ODR = VAL_GPIO_LED_ODR;
GPIO_LED->CRH = VAL_GPIO_LED_CRH;
GPIO_LED->CRL = VAL_GPIO_LED_CRL;
/* If there is USB enabler pin and it's independent, we configure it. */
#if defined(GPIO_USB_BASE) && GPIO_USB_BASE != GPIO_LED_BASE
GPIO_USB->ODR = VAL_GPIO_USB_ODR;
GPIO_USB->CRH = VAL_GPIO_USB_CRH;
GPIO_USB->CRL = VAL_GPIO_USB_CRL;
#endif
#ifdef GPIO_OTHER_BASE