[X9D] Peripheral freqs now as defines
This commit is contained in:
@@ -38,10 +38,6 @@ uint8_t temperature = 0; // Raw temp reading
|
||||
uint8_t maxTemperature = 0 ; // Raw temp reading
|
||||
volatile uint32_t Tenms ; // TODO to remove everywhere / use a #define
|
||||
|
||||
uint32_t Peri1_frequency = 30000000;
|
||||
uint32_t Peri2_frequency = 30000000;
|
||||
uint32_t Timer_mult = 2;
|
||||
|
||||
#define PIN_MODE_MASK 0x0003
|
||||
#define PIN_INPUT 0x0000
|
||||
#define PIN_OUTPUT 0x0001
|
||||
@@ -125,7 +121,7 @@ void init5msTimer()
|
||||
// Timer14
|
||||
RCC->APB1ENR |= RCC_APB1ENR_TIM14EN ; // Enable clock
|
||||
TIM14->ARR = 4999 ; // 5mS
|
||||
TIM14->PSC = (Peri1_frequency * Timer_mult) / 1000000 - 1 ; // 1uS from 30MHz
|
||||
TIM14->PSC = (PERI1_FREQUENCY * TIMER_MULT) / 1000000 - 1 ; // 1uS from 30MHz
|
||||
TIM14->CCER = 0 ;
|
||||
TIM14->CCMR1 = 0 ;
|
||||
TIM14->EGR = 0 ;
|
||||
|
||||
+3
-4
@@ -47,10 +47,9 @@
|
||||
#include "audio_driver.h"
|
||||
#include "delays.h"
|
||||
|
||||
extern uint32_t SystemCoreClock;
|
||||
extern uint32_t Peri1_frequency;
|
||||
extern uint32_t Peri2_frequency;
|
||||
extern uint32_t Timer_mult;
|
||||
#define PERI1_FREQUENCY 30000000
|
||||
#define PERI2_FREQUENCY 60000000
|
||||
#define TIMER_MULT 2
|
||||
|
||||
// TODO elsewhere
|
||||
#if !defined(SIMU)
|
||||
|
||||
+1
-1
@@ -37,7 +37,7 @@ void delaysInit(void)
|
||||
{
|
||||
// Timer13
|
||||
RCC->APB1ENR |= RCC_APB1ENR_TIM13EN; // Enable clock
|
||||
TIM13->PSC = (Peri1_frequency * Timer_mult) / 10000000 - 1; // 0.1uS
|
||||
TIM13->PSC = (PERI1_FREQUENCY * TIMER_MULT) / 10000000 - 1; // 0.1uS
|
||||
TIM13->CCER = 0;
|
||||
TIM13->CCMR1 = 0;
|
||||
TIM13->CR1 = 0x02;
|
||||
|
||||
Reference in New Issue
Block a user