1
0
mirror of https://github.com/bdring/Grbl_Esp32.git synced 2025-08-31 10:01:48 +02:00

Create default speed map for Laser and Null spindles

This commit is contained in:
Mitch Bradley
2021-06-23 19:42:39 -10:00
parent c32e8a5e3c
commit a6dfd9257c
2 changed files with 9 additions and 1 deletions

View File

@@ -50,7 +50,12 @@ namespace Spindles {
_pwm_precision = calc_pwm_precision(_pwm_freq); // determine the best precision
_pwm_period = (1 << _pwm_precision);
// pre-calculate some PWM count values
if (_speeds.size() == 0) {
// The default speed map for a Laser is linear from 0=0% to 255=100%
_speeds.push_back({ 0, 0 });
_speeds.push_back({ 255, 100 });
}
setupSpeeds(_laser_full_power);
_pwm_chan_num = 0; // Channel 0 is reserved for spindle use
}

View File

@@ -33,6 +33,9 @@ namespace Spindles {
void Null::init() {
is_reversable = false;
config_message();
if (_speeds.size() == 0) {
_speeds.push_back({ 0, 0 });
}
}
void IRAM_ATTR Null::setSpeedfromISR(uint32_t dev_speed) {};
void Null::setState(SpindleState state, SpindleSpeed speed) {