mirror of
https://github.com/bdring/Grbl_Esp32.git
synced 2025-08-18 12:21:39 +02:00
First valid spi_index is 1, not 0
This commit is contained in:
@@ -313,6 +313,7 @@ void print_trinamic_common(int axis, int gang, TrinamicMode run, TrinamicMode ho
|
||||
item("use_enable", tf(false));
|
||||
#endif
|
||||
}
|
||||
// The first valid spi_index is 1; 0 means not yet assigned
|
||||
int spi_index = 0;
|
||||
void print_trinamic_spi(TrinamicDriver* m, int axis, int gang, const char* name = "trinamic_spi") {
|
||||
print_stepper(m, axis, gang, name);
|
||||
@@ -322,7 +323,7 @@ void print_trinamic_spi(TrinamicDriver* m, int axis, int gang, const char* name
|
||||
if (spi_index == 0) {
|
||||
pin_item("cs_pin", m->_cs_pin, true);
|
||||
}
|
||||
item("spi_index", spi_index++);
|
||||
item("spi_index", ++spi_index);
|
||||
} else {
|
||||
pin_item("cs_pin", m->_cs_pin, true);
|
||||
}
|
||||
|
Reference in New Issue
Block a user