stm32_serDes_protobuf_project/main.c

39 lines
587 B
C
Raw Normal View History

2024-03-28 17:25:38 +03:00
#include "bsp.h"
int main() {
init();
do {
loop();
} while (1);
}
void init() {
RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOB, ENABLE);
GPIO_InitTypeDef gpio;
GPIO_StructInit(&gpio);
gpio.GPIO_Mode = GPIO_Mode_OUT;
gpio.GPIO_Pin = LEDS;
GPIO_Init(GPIOB, &gpio);
GPIO_SetBits(GPIOB, LEDS);
}
void loop() {
static uint32_t counter = 0;
++counter;
GPIO_ResetBits(GPIOB, LEDS);
GPIO_SetBits(GPIOB, LED[counter % 3]);
delay(250);
}
void delay(uint32_t ms) {
ms *= 3360;
while(ms--) {
__NOP();
}
}