[X9D] SD Card and clocks sorted hopefully for good.

This commit is contained in:
bernet.andre@gmail.com
2013-01-09 13:24:49 +00:00
parent 78ed555f6e
commit 8abf660e2b
10 changed files with 60 additions and 68 deletions
+6 -6
View File
@@ -37,19 +37,19 @@ void delaysInit(void)
{
// Timer13
RCC->APB1ENR |= RCC_APB1ENR_TIM13EN; // Enable clock
TIM13->PSC = Peri1_frequency / 100000; // 0.1uS from 30MHz
TIM13->PSC = (Peri1_frequency * Timer_mult) / 10000000 - 1; // 0.1uS
TIM13->CCER = 0;
TIM13->CCMR1 = 0;
TIM13->EGR = 0;
TIM13->CR1 = 0x03;
TIM13->CR1 = 0x02;
TIM13->DIER = 0;
}
void delay_01us(uint16_t nb)
{
TIM13->EGR = 1;
TIM13->CNT = 0;
TIM13->EGR = 1;
while(((uint16_t)TIM13->CNT) < nb);
TIM13->EGR = 0;
TIM13->CR1 = 0x03;
while(TIM13->CNT < nb);
TIM13->CR1 = 0x02;
}