Accelerometre.c est maintenant plus mince, et aucun des programmes utilisent Timer.c, mais plutot Horloge.c
This commit is contained in:
parent
fbc87e8a21
commit
a2d245df7e
2 changed files with 0 additions and 35 deletions
|
|
@ -1,8 +0,0 @@
|
|||
#ifndef TIMER_H_
|
||||
#define TIMER_H_
|
||||
#include <stm32f10x.h>
|
||||
// Config de timer
|
||||
extern void MyTimer_Base_Init(TIM_TypeDef *Timer , unsigned short ValARR , unsigned short ValPSC );
|
||||
// Enable timers
|
||||
void EnableTimer(TIM_TypeDef *Timer);
|
||||
#endif
|
||||
27
src/Timer.c
27
src/Timer.c
|
|
@ -1,27 +0,0 @@
|
|||
#include <stm32f10x.h>
|
||||
#include <Timer.h>
|
||||
|
||||
void MyTimer_Base_Init( TIM_TypeDef * Timer , unsigned short ValARR , unsigned short ValPSC ) { // Configuration du timer
|
||||
Timer -> PSC=(ValPSC);
|
||||
Timer-> ARR = (ValARR);
|
||||
Timer->EGR |= TIM_EGR_UG;
|
||||
};
|
||||
|
||||
|
||||
|
||||
void EnableTimer(TIM_TypeDef *Timer){
|
||||
if(Timer == TIM2){
|
||||
RCC -> APB1ENR |= RCC_APB1ENR_TIM2EN;
|
||||
}
|
||||
else if(Timer == TIM3){
|
||||
RCC -> APB1ENR |= RCC_APB1ENR_TIM3EN;
|
||||
}
|
||||
else if(Timer == TIM4){
|
||||
RCC -> APB1ENR |= RCC_APB1ENR_TIM4EN;
|
||||
}
|
||||
else if(Timer == TIM1){
|
||||
RCC->APB2ENR |= RCC_APB2ENR_TIM1EN;
|
||||
}
|
||||
else{
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue