mirror of
https://github.com/bdring/Grbl_Esp32.git
synced 2025-08-31 18:11:48 +02:00
Create default speed map for Laser and Null spindles
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
@@ -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) {
|
||||
|
Reference in New Issue
Block a user