Toggle LED.
This commit is contained in:
parent
e1093e5a09
commit
ea2c431fdf
|
@ -21,4 +21,10 @@ void BOARD_InitBootPins(void) {
|
|||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
|
||||
GPIO_InitStruct.Alternate = GPIO_AF7_USART1;
|
||||
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
|
||||
|
||||
GPIO_InitStruct.Pin = LED_G_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_OD;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
|
||||
HAL_GPIO_Init(LED_G_GPIO_Port, &GPIO_InitStruct);
|
||||
}
|
|
@ -1,6 +1,9 @@
|
|||
#ifndef PIN_MUX_H
|
||||
#define PIN_MUX_H
|
||||
|
||||
#define LED_G_Pin GPIO_PIN_1
|
||||
#define LED_G_GPIO_Port GPIOA
|
||||
|
||||
void BOARD_InitBootPins();
|
||||
|
||||
#endif
|
|
@ -19,5 +19,6 @@ int main(void) {
|
|||
|
||||
for (;;) {
|
||||
HAL_Delay(500);
|
||||
HAL_GPIO_TogglePin(LED_G_GPIO_Port, LED_G_Pin);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue