1
0
mirror of https://github.com/bdring/Grbl_Esp32.git synced 2025-08-31 18:11:48 +02:00

Default SPI miso, mosi, sck, ss pins to the "standard" gpios 19, 23, 18, 5

This commit is contained in:
Stefan de Bruijn
2021-06-08 21:24:59 +02:00
parent 3bbe92a48d
commit c3fd9da5a1
2 changed files with 14 additions and 3 deletions

View File

@@ -360,6 +360,16 @@ void SPIBus::group(Configuration::HandlerBase& handler) {
handler.item("mosi", _sck);
}
void SPIBus::afterParse() {
if (_ss.undefined() && _miso.undefined() && _mosi.undefined() && _sck.undefined()) {
// Default SPI miso, mosi, sck, ss pins to the "standard" gpios 19, 23, 18, 5
_miso = Pin::create("gpio.19");
_mosi = Pin::create("gpio.23");
_sck = Pin::create("gpio.18");
_ss = Pin::create("gpio.5");
}
}
void UserOutputs::group(Configuration::HandlerBase& handler) {
handler.item("analog0", _analogOutput[0]);
handler.item("analog1", _analogOutput[1]);

View File

@@ -200,6 +200,7 @@ public:
void validate() const override;
void group(Configuration::HandlerBase& handler) override;
void afterParse() override;
~SPIBus() = default;
};