mirror of
https://github.com/bdring/Grbl_Esp32.git
synced 2025-09-02 19:02:35 +02:00
Removed cs pin from SDCard class
.. in favor of the one in the SPIBus class. Per trello ticket
This commit is contained in:
@@ -436,6 +436,14 @@ void MachineConfig::afterParse() {
|
||||
_sdCard = new SDCard();
|
||||
}
|
||||
|
||||
if (_spi == nullptr) {
|
||||
_spi = new SPIBus();
|
||||
}
|
||||
|
||||
if (_i2so == nullptr) {
|
||||
_i2so = new I2SOBus();
|
||||
}
|
||||
|
||||
if (_control == nullptr) {
|
||||
log_info("Control config missing; building default");
|
||||
_control = new Control();
|
||||
|
@@ -141,7 +141,7 @@ SDCard::State SDCard::get_state(bool refresh) {
|
||||
auto spiConfig = config->_spi;
|
||||
|
||||
if (spiConfig != nullptr) {
|
||||
auto ssPin = _cs_pin.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 sckPin = spiConfig->_sck.getNative(Pin::Capabilities::Output | Pin::Capabilities::Native);
|
||||
auto misoPin = spiConfig->_miso.getNative(Pin::Capabilities::Input | Pin::Capabilities::Native);
|
||||
@@ -196,7 +196,6 @@ void SDCard::init() {
|
||||
|
||||
if (init_message) {
|
||||
_cardDetect.report("SD Card Detect");
|
||||
_cs_pin.report("SD SPI Chip Select");
|
||||
init_message = false;
|
||||
}
|
||||
|
||||
|
@@ -47,7 +47,6 @@ private:
|
||||
|
||||
State _state;
|
||||
Pin _cardDetect;
|
||||
Pin _cs_pin;
|
||||
|
||||
public:
|
||||
bool _readyNext;
|
||||
@@ -76,12 +75,7 @@ public:
|
||||
void init();
|
||||
|
||||
// Configuration handlers.
|
||||
void validate() const override { Assert(!_cs_pin.undefined(), "spi_cs pin should be configured."); }
|
||||
|
||||
void group(Configuration::HandlerBase& handler) override {
|
||||
handler.item("card_detect", _cardDetect);
|
||||
handler.item("spi_cs", _cs_pin);
|
||||
}
|
||||
void group(Configuration::HandlerBase& handler) override { handler.item("card_detect", _cardDetect); }
|
||||
|
||||
~SDCard();
|
||||
};
|
||||
|
Reference in New Issue
Block a user