mirror of
https://github.com/bdring/Grbl_Esp32.git
synced 2025-08-31 01:59:54 +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) {
|
for (auto s : config->_spindles) {
|
||||||
s->init();
|
s->init();
|
||||||
}
|
}
|
||||||
|
Spindles::Spindle::switchSpindle(0, config->_spindles, spindle);
|
||||||
|
|
||||||
config->_coolant->init();
|
config->_coolant->init();
|
||||||
limits_init();
|
limits_init();
|
||||||
config->_probe->init();
|
config->_probe->init();
|
||||||
|
@@ -476,11 +476,9 @@ void MachineConfig::afterParse() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (_spindles.size() == 0) {
|
if (_spindles.size() == 0) {
|
||||||
log_info("Using null spindle");
|
log_info("Spindle config missing; using null spindle");
|
||||||
_spindles.push_back(new Spindles::Null());
|
_spindles.push_back(new Spindles::Null());
|
||||||
}
|
}
|
||||||
spindle = _spindles[0];
|
|
||||||
|
|
||||||
uint32_t next_tool = 100;
|
uint32_t next_tool = 100;
|
||||||
for (auto s : _spindles) {
|
for (auto s : _spindles) {
|
||||||
if (s->_tool == -1) {
|
if (s->_tool == -1) {
|
||||||
|
@@ -39,11 +39,17 @@ namespace Spindles {
|
|||||||
}
|
}
|
||||||
if (candidate) {
|
if (candidate) {
|
||||||
if (candidate != spindle) {
|
if (candidate != spindle) {
|
||||||
spindle->stop();
|
if (spindle != nullptr) {
|
||||||
|
spindle->stop();
|
||||||
|
}
|
||||||
spindle = candidate;
|
spindle = candidate;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!spindle) {
|
if (spindle == nullptr) {
|
||||||
|
if (spindles.size() == 0) {
|
||||||
|
log_error("No spindles are defined");
|
||||||
|
return;
|
||||||
|
}
|
||||||
spindle = spindles[0];
|
spindle = spindles[0];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user