Initial compiling Zephyr integration

This commit is contained in:
Martin Jaeger
2019-12-20 10:37:50 +01:00
parent b87d223dff
commit 88148e70cb
32 changed files with 576 additions and 44 deletions
+7 -2
View File
@@ -16,11 +16,11 @@
#include "half_bridge.h"
#include "mcu.h"
#include "pcb.h"
#include "config.h"
static int _pwm_resolution;
static float _min_duty;
static float _max_duty;
@@ -57,8 +57,13 @@ class PWM_TIM3
#endif
// Select AF2 on PB0 and PB1
#ifdef __MBED__
GPIOB->AFR[0] |= 0x2 << GPIO_AFRL_AFRL0_Pos;
GPIOB->AFR[0] |= 0x2 << GPIO_AFRL_AFRL1_Pos;
#else
GPIOB->AFR[0] |= 0x2 << GPIO_AFRL_AFSEL0_Pos;
GPIOB->AFR[0] |= 0x2 << GPIO_AFRL_AFSEL1_Pos;
#endif
// No prescaler --> timer frequency == SystemClock
TIM3->PSC = 0;