Initial compiling Zephyr integration
This commit is contained in:
+7
-2
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user