You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
616 B

#include "porting.h"
#include <stm32f10x.h>
void initAliveLED(void)
{
/* Activate clock for peripheral. */
RCC_APB2PeriphClockCmd(GPIO_BUS_ALIVE, ENABLE);
/* Initialize GPIO Pin. */
GPIO_InitTypeDef GPIO_InitStructure ;
GPIO_StructInit (&GPIO_InitStructure );
GPIO_InitStructure.GPIO_Pin = GPIO_PIN_ALIVE ;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP ;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz ;
GPIO_Init (GPIO_ALIVE, & GPIO_InitStructure );
}
void toggleAliveLED(void)
{
static volatile uint8_t led_stat = 0;
led_stat = !led_stat;
GPIO_WriteBit(GPIO_ALIVE, GPIO_PIN_ALIVE, led_stat);
}