On retire des choses inutiles et non utilisées
This commit is contained in:
parent
8fe96167f6
commit
1758acd46d
2 changed files with 0 additions and 66 deletions
|
|
@ -1,12 +0,0 @@
|
||||||
#include "stm32f10x.h"
|
|
||||||
|
|
||||||
//TIMERS start
|
|
||||||
#define MyTimer_Base_Start(Timer) (Timer->CR1 |= TIM_CR1_CEN)
|
|
||||||
#define MyTimer_Base_Stop(Timer) (Timer -> CR1 =(0x0))
|
|
||||||
// IT
|
|
||||||
extern volatile int g_tick_count; // Declara que a variável existe em outro arquivo
|
|
||||||
void Test(void);
|
|
||||||
void ConfigureIT();
|
|
||||||
// PWM
|
|
||||||
void ConfigurePWM();
|
|
||||||
void ConfigureTimers();
|
|
||||||
|
|
@ -1,54 +0,0 @@
|
||||||
#include <stm32f10x.h>
|
|
||||||
#include "Timer.h"
|
|
||||||
#include "MyTimer.h"
|
|
||||||
#include "PWM.h"
|
|
||||||
#include "DriverGPIO.h"
|
|
||||||
#include "Horloge.h"
|
|
||||||
|
|
||||||
// Constantes
|
|
||||||
#define ARR_TIM1 0xFFAD
|
|
||||||
#define PSC_TIM1 0xFF
|
|
||||||
#define ARR_TIM2 0xFFAD
|
|
||||||
#define PSC_TIM2 0x0225
|
|
||||||
#define ARR_TIM3 0x2CF
|
|
||||||
#define PSC_TIM3 0x0
|
|
||||||
|
|
||||||
// Variables
|
|
||||||
volatile int g_tick_count;
|
|
||||||
|
|
||||||
|
|
||||||
void Test(void) {
|
|
||||||
// Signal
|
|
||||||
g_tick_count++;
|
|
||||||
MyGPIO_Toggle(GPIOA, 8);
|
|
||||||
}
|
|
||||||
|
|
||||||
// LES COMMENTAIRES SONT POUR ACTIVER DES TIMERS QUE L'ON UTILISE PAS POUR LE MOMENT
|
|
||||||
void ConfigureTimers() {
|
|
||||||
// Config ARR & PSC
|
|
||||||
//MyTimer_Base_Init(TIM2, ARR_TIM2, PSC_TIM2);
|
|
||||||
//MyTimer_Base_Init(TIM1, ARR_TIM1, PSC_TIM1);
|
|
||||||
//MyTimer_Base_Init(TIM3, ARR_TIM2, PSC_TIM2);
|
|
||||||
//Timer_Init(TIM1, ARR_TIM1, PSC_TIM1);
|
|
||||||
Timer_Init(TIM2, 0, 0);
|
|
||||||
Timer_Init(TIM8, 0, 0);
|
|
||||||
|
|
||||||
// Enable timer clock
|
|
||||||
//EnableTimer(TIM1);
|
|
||||||
//EnableTimer(TIM2);
|
|
||||||
//EnableTimer(TIM3);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void ConfigureIT() { // Activate general interuption with a function and priority
|
|
||||||
//MyTimer_ActiveIT(TIM2, 4, Test); //start interruption with priority 4
|
|
||||||
//MyTimer_ActiveIT(TIM1, 4, Test); //start interruption with priority 4
|
|
||||||
MyTimer_ActiveIT(TIM3, 4, Test); //start interruption with priority 4
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void ConfigurePWM() { // Set dutycycle with timer
|
|
||||||
MyTimer_PWM(TIM8, 2); // Utiliser timer1 avec channel 1
|
|
||||||
//MyTimer_Set_DutyCycle(TIM1, 1, 20.0);
|
|
||||||
}
|
|
||||||
|
|
||||||
Loading…
Reference in a new issue