1
0
mirror of https://github.com/bdring/Grbl_Esp32.git synced 2025-08-29 17:19:50 +02:00

Fixed a few more bugs in machine config. This should be test-able.

This commit is contained in:
Stefan de Bruijn
2021-03-26 11:21:08 +01:00
parent faf8f44888
commit 920c934c34
3 changed files with 58 additions and 55 deletions

View File

@@ -373,11 +373,6 @@ void MachineConfig::afterParse() {
_coolant = new CoolantControl();
}
if (_spi == nullptr) {
log_info("SPI config missing; building default SPI bus.");
_spi = new SPIBus();
}
if (_probe == nullptr) {
log_info("Probe config missing; building default probe.");
_probe = new Probe();

View File

@@ -91,7 +91,7 @@ namespace Motors {
config_message();
auto spiConfig = MachineConfig::instance()->_spi;
if (spiConfig != nullptr) {
auto ssPin = spiConfig->_ss.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);
@@ -118,6 +118,10 @@ namespace Motors {
0 // core
);
}
} else {
grbl_msg_sendf(CLIENT_SERIAL, MsgLevel::Info, "SPI bus is not available; cannot initialize TMC driver.");
_has_errors = true;
}
}
/*

View File

@@ -133,6 +133,7 @@ uint8_t get_sd_state(bool refresh) {
// fortunately doesn't change any of the settings.
auto spiConfig = MachineConfig::instance()->_spi;
if (spiConfig != nullptr) {
auto ssPin = spiConfig->_ss.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);
@@ -167,6 +168,9 @@ uint8_t get_sd_state(bool refresh) {
}
}
return sd_state;
} else {
return SDCARD_NOT_PRESENT;
}
}
uint8_t set_sd_state(uint8_t flag) {