enable all periph clocks by default on startup, added testing synchronous uart write command

This commit is contained in:
2018-01-13 12:30:17 +01:00
parent 29264540f7
commit 8852f9f8b4
4 changed files with 51 additions and 54 deletions
+11 -5
View File
@@ -2,6 +2,7 @@
// Created by MightyPork on 2017/11/26.
//
#include <stm32f072xb.h>
#include "platform.h"
#include "usbd_core.h"
#include "USB/usb_device.h"
@@ -20,11 +21,16 @@ void plat_init_resources(void)
{
uint32_t rv = 0;
__HAL_RCC_GPIOA_CLK_ENABLE();
__HAL_RCC_GPIOB_CLK_ENABLE();
__HAL_RCC_GPIOC_CLK_ENABLE();
__HAL_RCC_GPIOD_CLK_ENABLE();
__HAL_RCC_GPIOE_CLK_ENABLE();
// switch everything ON (we should not write reserved bits, but nothing bad seems to happen)
RCC->APB1ENR = 0xFFFFFFFF;
RCC->APB2ENR = 0xFFFFFFFF;
RCC->AHBENR = 0xFFFFFFFF; // GPIOs are here
// __HAL_RCC_GPIOA_CLK_ENABLE();
// __HAL_RCC_GPIOB_CLK_ENABLE();
// __HAL_RCC_GPIOC_CLK_ENABLE();
// __HAL_RCC_GPIOD_CLK_ENABLE();
// __HAL_RCC_GPIOE_CLK_ENABLE();
// --- Common unit drivers ---