From 7b838f31be262e235108c15e20e0b81ad16d6d2c Mon Sep 17 00:00:00 2001 From: Giuliano Zaro <3684609+GMagician@users.noreply.github.com> Date: Sun, 26 May 2019 21:51:32 +0200 Subject: [PATCH] DUE HAL cleanup (#14126) --- Marlin/src/HAL/HAL_DUE/HAL_timers_Due.cpp | 1 - Marlin/src/HAL/HAL_DUE/ServoTimers.h | 19 +++++++++++++++++-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/Marlin/src/HAL/HAL_DUE/HAL_timers_Due.cpp b/Marlin/src/HAL/HAL_DUE/HAL_timers_Due.cpp index 9d2233d914..43c8e572b6 100644 --- a/Marlin/src/HAL/HAL_DUE/HAL_timers_Due.cpp +++ b/Marlin/src/HAL/HAL_DUE/HAL_timers_Due.cpp @@ -46,7 +46,6 @@ #define NUM_HARDWARE_TIMERS 9 -#define PRESCALER 2 // -------------------------------------------------------------------------- // Types // -------------------------------------------------------------------------- diff --git a/Marlin/src/HAL/HAL_DUE/ServoTimers.h b/Marlin/src/HAL/HAL_DUE/ServoTimers.h index 8d5d0fa583..8b1ed4c730 100644 --- a/Marlin/src/HAL/HAL_DUE/ServoTimers.h +++ b/Marlin/src/HAL/HAL_DUE/ServoTimers.h @@ -87,5 +87,20 @@ #define HANDLER_FOR_TIMER5 TC0_Handler #endif -//typedef enum { _timer1, _timer2, _timer3, _timer4, _timer5, _Nbr_16timers } timer16_Sequence_t; -typedef enum { _timer3, _timer5, _Nbr_16timers } timer16_Sequence_t; +typedef enum { + #ifdef _useTimer1 + _timer1, + #endif + #ifdef _useTimer2 + _timer2, + #endif + #ifdef _useTimer3 + _timer3, + #endif + #ifdef _useTimer4 + _timer4, + #endif + #ifdef _useTimer5 + _timer5, + #endif + _Nbr_16timers } timer16_Sequence_t;