update code base to Marlin 2.0.9.2
This commit is contained in:
53
Marlin/src/HAL/ESP32/timers.h
Executable file → Normal file
53
Marlin/src/HAL/ESP32/timers.h
Executable file → Normal file
@@ -16,7 +16,7 @@
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
@@ -24,24 +24,29 @@
|
||||
#include <stdint.h>
|
||||
#include <driver/timer.h>
|
||||
|
||||
// Includes needed to get I2S_STEPPER_STREAM. Note that pins.h
|
||||
// is included in case this header is being included early.
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
#include "../../pins/pins.h"
|
||||
|
||||
// ------------------------
|
||||
// Defines
|
||||
// ------------------------
|
||||
//
|
||||
#define FORCE_INLINE __attribute__((always_inline)) inline
|
||||
|
||||
typedef uint64_t hal_timer_t;
|
||||
#define HAL_TIMER_TYPE_MAX 0xFFFFFFFFFFFFFFFFULL
|
||||
|
||||
#define STEP_TIMER_NUM 0 // index of timer to use for stepper
|
||||
#define TEMP_TIMER_NUM 1 // index of timer to use for temperature
|
||||
#define PWM_TIMER_NUM 2 // index of timer to use for PWM outputs
|
||||
#define PULSE_TIMER_NUM STEP_TIMER_NUM
|
||||
#ifndef STEP_TIMER_NUM
|
||||
#define STEP_TIMER_NUM 0 // Timer Index for Stepper
|
||||
#endif
|
||||
#ifndef PULSE_TIMER_NUM
|
||||
#define PULSE_TIMER_NUM STEP_TIMER_NUM
|
||||
#endif
|
||||
#ifndef TEMP_TIMER_NUM
|
||||
#define TEMP_TIMER_NUM 1 // Timer Index for Temperature
|
||||
#endif
|
||||
#ifndef PWM_TIMER_NUM
|
||||
#define PWM_TIMER_NUM 2 // index of timer to use for PWM outputs
|
||||
#endif
|
||||
#ifndef TONE_TIMER_NUM
|
||||
#define TONE_TIMER_NUM 3 // index of timer for beeper tones
|
||||
#endif
|
||||
|
||||
#define HAL_TIMER_RATE APB_CLK_FREQ // frequency of timer peripherals
|
||||
|
||||
@@ -57,6 +62,8 @@ typedef uint64_t hal_timer_t;
|
||||
|
||||
#define STEP_TIMER_MIN_INTERVAL 8 // minimum time in µs between stepper interrupts
|
||||
|
||||
#define TONE_TIMER_PRESCALE 1000 // Arbitrary value, no idea what i'm doing here
|
||||
|
||||
#define TEMP_TIMER_PRESCALE 1000 // prescaler for setting Temp timer, 72Khz
|
||||
#define TEMP_TIMER_FREQUENCY 1000 // temperature interrupt frequency
|
||||
|
||||
@@ -79,13 +86,25 @@ typedef uint64_t hal_timer_t;
|
||||
#define ENABLE_TEMPERATURE_INTERRUPT() HAL_timer_enable_interrupt(TEMP_TIMER_NUM)
|
||||
#define DISABLE_TEMPERATURE_INTERRUPT() HAL_timer_disable_interrupt(TEMP_TIMER_NUM)
|
||||
|
||||
#define HAL_TEMP_TIMER_ISR() extern "C" void tempTC_Handler()
|
||||
#define HAL_STEP_TIMER_ISR() extern "C" void stepTC_Handler()
|
||||
#define HAL_PWM_TIMER_ISR() extern "C" void pwmTC_Handler()
|
||||
#ifndef HAL_TEMP_TIMER_ISR
|
||||
#define HAL_TEMP_TIMER_ISR() extern "C" void tempTC_Handler()
|
||||
#endif
|
||||
#ifndef HAL_STEP_TIMER_ISR
|
||||
#define HAL_STEP_TIMER_ISR() extern "C" void stepTC_Handler()
|
||||
#endif
|
||||
#ifndef HAL_PWM_TIMER_ISR
|
||||
#define HAL_PWM_TIMER_ISR() extern "C" void pwmTC_Handler()
|
||||
#endif
|
||||
#ifndef HAL_TONE_TIMER_ISR
|
||||
#define HAL_TONE_TIMER_ISR() extern "C" void toneTC_Handler()
|
||||
#endif
|
||||
|
||||
extern "C" void tempTC_Handler();
|
||||
extern "C" void stepTC_Handler();
|
||||
extern "C" void pwmTC_Handler();
|
||||
extern "C" {
|
||||
void tempTC_Handler();
|
||||
void stepTC_Handler();
|
||||
void pwmTC_Handler();
|
||||
void toneTC_Handler();
|
||||
}
|
||||
|
||||
// ------------------------
|
||||
// Types
|
||||
|
Reference in New Issue
Block a user