New HardwareTimer for STM32 5.7.0 (#15655)

This commit is contained in:
Lino Barreca authored and Scott Lahteine committed 2019-11-12 19:23:02 -06:00
1 parent 4762dfe797
commit ac71cdc265
31 files changed
+1290 -520

No files matched your search

+12 -2
View File
@@ -2290,7 +2290,7 @@ void Temperature::readings_ready() {
HAL_TEMP_TIMER_ISR() {
HAL_timer_isr_prologue(TEMP_TIMER_NUM);
Temperature::isr();
Temperature::tick();
HAL_timer_isr_epilogue(TEMP_TIMER_NUM);
}
@@ -2320,11 +2320,21 @@ public:
#endif
};
void Temperature::isr() {
/**
* Handle various ~1KHz tasks associated with temperature
* - Heater PWM (~1KHz with scaler)
* - LCD Button polling (~500Hz)
* - Start / Read one ADC sensor
* - Advance Babysteps
* - Endstop polling
* - Planner clean buffer
*/
void Temperature::tick() {
static int8_t temp_count = -1;
static ADCSensorState adc_sensor_state = StartupDelay;
static uint8_t pwm_count = _BV(SOFT_PWM_SCALE);
// avoid multiple loads of pwm_count
uint8_t pwm_count_tmp = pwm_count;