mirror of
https://github.com/bdring/Grbl_Esp32.git
synced 2025-08-30 17:49:56 +02:00
Improved the initial selection of spindle.
This commit is contained in:
@@ -111,6 +111,8 @@ void grbl_init() {
|
||||
for (auto s : config->_spindles) {
|
||||
s->init();
|
||||
}
|
||||
Spindles::Spindle::switchSpindle(0, config->_spindles, spindle);
|
||||
|
||||
config->_coolant->init();
|
||||
limits_init();
|
||||
config->_probe->init();
|
||||
|
@@ -476,11 +476,9 @@ void MachineConfig::afterParse() {
|
||||
}
|
||||
|
||||
if (_spindles.size() == 0) {
|
||||
log_info("Using null spindle");
|
||||
log_info("Spindle config missing; using null spindle");
|
||||
_spindles.push_back(new Spindles::Null());
|
||||
}
|
||||
spindle = _spindles[0];
|
||||
|
||||
uint32_t next_tool = 100;
|
||||
for (auto s : _spindles) {
|
||||
if (s->_tool == -1) {
|
||||
|
@@ -39,11 +39,17 @@ namespace Spindles {
|
||||
}
|
||||
if (candidate) {
|
||||
if (candidate != spindle) {
|
||||
spindle->stop();
|
||||
if (spindle != nullptr) {
|
||||
spindle->stop();
|
||||
}
|
||||
spindle = candidate;
|
||||
}
|
||||
} else {
|
||||
if (!spindle) {
|
||||
if (spindle == nullptr) {
|
||||
if (spindles.size() == 0) {
|
||||
log_error("No spindles are defined");
|
||||
return;
|
||||
}
|
||||
spindle = spindles[0];
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user