[X9D] Peripheral freqs now as defines

This commit is contained in:
bernet.andre@gmail.com
2013-01-09 14:46:59 +00:00
parent 8abf660e2b
commit b431f2e5bf
3 changed files with 5 additions and 10 deletions
+1 -5
View File
@@ -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
View File
@@ -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
View File
@@ -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;