Mettre à jour 'BE-chti C/soft/PjtKEIL_StepSon/Src/principal.c'
这个提交包含在:
父节点
d3dc3d3eeb
当前提交
7727ffa188
共有 1 个文件被更改,包括 15 次插入 和 6 次删除
|
@ -1,7 +1,12 @@
|
|||
|
||||
|
||||
#include "GestionSon.h"
|
||||
#include "DriverJeuLaser.h"
|
||||
|
||||
#define TE_IN_TICKS 6552
|
||||
#define PERIODE_PWM 720
|
||||
|
||||
extern short Sortie_son;
|
||||
|
||||
extern void CallbackSon(void);
|
||||
|
||||
|
||||
|
@ -15,13 +20,17 @@ int main(void)
|
|||
// ============= INIT PERIPH (faites qu'une seule fois) =====================
|
||||
// ===========================================================================
|
||||
|
||||
// Après exécution : le coeur CPU est clocké à 72MHz ainsi que tous les timers
|
||||
// Après exécution : le coeur CPU est clocké à 72MHz ainsi que tous les timers
|
||||
CLOCK_Configure();
|
||||
|
||||
Timer_1234_Init_ff(TIM4, 65520000);
|
||||
Active_IT_Debordement_Timer(TIM4, 2, CallbackSon);
|
||||
Run_Timer(TIM4);
|
||||
|
||||
// Timer_1234_Init_ff(TIM4, PeriodeSonMicroSec * US_IN_TICKS);
|
||||
Timer_1234_Init_ff(TIM4, TE_IN_TICKS);
|
||||
//Timer_1234_Init_ff(TIM3, PERIODE_PWM); // periode de la PWM = 10us
|
||||
Active_IT_Debordement_Timer(TIM4, 2, GestionSon);
|
||||
GPIO_Configure(GPIOB, 0, OUTPUT, ALT_PPULL);
|
||||
|
||||
PWM_Init_ff(TIM3, 3, PERIODE_PWM);
|
||||
StartSon();
|
||||
|
||||
|
||||
//============================================================================
|
||||
|
|
正在加载…
在新工单中引用