FreeRTOS w/blink works

This commit is contained in:
cpq committed 2021-05-11 20:44:14 +01:00
1 parent c44549bfa5
commit 151e375091
5 files changed
+46 -33

No files matched your search

+11
View File
@@ -13,6 +13,17 @@ static inline void led_toggle(void) {
}
static inline void init_hardware(void) {
RCC->CR |= (RCC_CR_HSEON);
while (!(RCC->CR & RCC_CR_HSERDY)) (void) 0;
RCC->CFGR &= ~(RCC_CFGR_SW);
RCC->CFGR |= (RCC_CFGR_SW_HSE);
RCC->CFGR &= ~(RCC_CFGR_PLLMULL);
RCC->CFGR |= (RCC_CFGR_PLLMULL9);
RCC->CR |= (RCC_CR_PLLON);
while (!(RCC->CR & RCC_CR_PLLRDY)) (void) 0;
RCC->CFGR &= ~(RCC_CFGR_SW);
RCC->CFGR |= (RCC_CFGR_SW_PLL);
RCC->APB2ENR |= BIT(2) | BIT(3) | BIT(4); // Init GPIO banks A,B,C
gpio_init(LED1, OUTPUT); // Set LED
}