mirror of
https://github.com/bdring/Grbl_Esp32.git
synced 2025-08-30 09:39:49 +02:00
Fixed a few more bugs in machine config. This should be test-able.
This commit is contained in:
@@ -373,11 +373,6 @@ void MachineConfig::afterParse() {
|
|||||||
_coolant = new CoolantControl();
|
_coolant = new CoolantControl();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_spi == nullptr) {
|
|
||||||
log_info("SPI config missing; building default SPI bus.");
|
|
||||||
_spi = new SPIBus();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_probe == nullptr) {
|
if (_probe == nullptr) {
|
||||||
log_info("Probe config missing; building default probe.");
|
log_info("Probe config missing; building default probe.");
|
||||||
_probe = new Probe();
|
_probe = new Probe();
|
||||||
|
@@ -91,7 +91,7 @@ namespace Motors {
|
|||||||
config_message();
|
config_message();
|
||||||
|
|
||||||
auto spiConfig = MachineConfig::instance()->_spi;
|
auto spiConfig = MachineConfig::instance()->_spi;
|
||||||
|
if (spiConfig != nullptr) {
|
||||||
auto ssPin = spiConfig->_ss.getNative(Pin::Capabilities::Output | Pin::Capabilities::Native);
|
auto ssPin = spiConfig->_ss.getNative(Pin::Capabilities::Output | Pin::Capabilities::Native);
|
||||||
auto mosiPin = spiConfig->_mosi.getNative(Pin::Capabilities::Output | Pin::Capabilities::Native);
|
auto mosiPin = spiConfig->_mosi.getNative(Pin::Capabilities::Output | Pin::Capabilities::Native);
|
||||||
auto sckPin = spiConfig->_sck.getNative(Pin::Capabilities::Output | Pin::Capabilities::Native);
|
auto sckPin = spiConfig->_sck.getNative(Pin::Capabilities::Output | Pin::Capabilities::Native);
|
||||||
@@ -118,6 +118,10 @@ namespace Motors {
|
|||||||
0 // core
|
0 // core
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
grbl_msg_sendf(CLIENT_SERIAL, MsgLevel::Info, "SPI bus is not available; cannot initialize TMC driver.");
|
||||||
|
_has_errors = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@@ -133,6 +133,7 @@ uint8_t get_sd_state(bool refresh) {
|
|||||||
// fortunately doesn't change any of the settings.
|
// fortunately doesn't change any of the settings.
|
||||||
auto spiConfig = MachineConfig::instance()->_spi;
|
auto spiConfig = MachineConfig::instance()->_spi;
|
||||||
|
|
||||||
|
if (spiConfig != nullptr) {
|
||||||
auto ssPin = spiConfig->_ss.getNative(Pin::Capabilities::Output | Pin::Capabilities::Native);
|
auto ssPin = spiConfig->_ss.getNative(Pin::Capabilities::Output | Pin::Capabilities::Native);
|
||||||
auto mosiPin = spiConfig->_mosi.getNative(Pin::Capabilities::Output | Pin::Capabilities::Native);
|
auto mosiPin = spiConfig->_mosi.getNative(Pin::Capabilities::Output | Pin::Capabilities::Native);
|
||||||
auto sckPin = spiConfig->_sck.getNative(Pin::Capabilities::Output | Pin::Capabilities::Native);
|
auto sckPin = spiConfig->_sck.getNative(Pin::Capabilities::Output | Pin::Capabilities::Native);
|
||||||
@@ -167,6 +168,9 @@ uint8_t get_sd_state(bool refresh) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return sd_state;
|
return sd_state;
|
||||||
|
} else {
|
||||||
|
return SDCARD_NOT_PRESENT;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t set_sd_state(uint8_t flag) {
|
uint8_t set_sd_state(uint8_t flag) {
|
||||||
|
Reference in New Issue
Block a user