L6470 SPI daisy chain support (#12895)

This commit is contained in:
Bob Kuhn
2019-01-23 19:06:54 -06:00
committed by Scott Lahteine
parent 6453b82a5e
commit 2f35747f29
95 changed files with 7844 additions and 1429 deletions

View File

@ -44,6 +44,8 @@
#include "HAL/shared/Delay.h"
#include "module/stepper_indirection.h"
#ifdef ARDUINO
#include <pins_arduino.h>
#endif
@ -158,6 +160,10 @@
#include "lcd/extensible_ui/ui_api.h"
#endif
#if HAS_DRIVER(L6470)
#include "libs/L6470/L6470_Marlin.h"
#endif
bool Running = true;
#if ENABLED(TEMPERATURE_UNITS_SUPPORT)
@ -341,28 +347,34 @@ void manage_inactivity(const bool ignore_stepper_queue/*=false*/) {
#endif
if (stepper_inactive_time) {
static bool already_shutdown_steppers; // = false
if (planner.has_blocks_queued())
gcode.previous_move_ms = ms; // reset_stepper_timeout to keep steppers powered
else if (MOVE_AWAY_TEST && !ignore_stepper_queue && ELAPSED(ms, gcode.previous_move_ms + stepper_inactive_time)) {
#if ENABLED(DISABLE_INACTIVE_X)
disable_X();
#endif
#if ENABLED(DISABLE_INACTIVE_Y)
disable_Y();
#endif
#if ENABLED(DISABLE_INACTIVE_Z)
disable_Z();
#endif
#if ENABLED(DISABLE_INACTIVE_E)
disable_e_steppers();
#endif
#if HAS_LCD_MENU && ENABLED(AUTO_BED_LEVELING_UBL)
if (ubl.lcd_map_control) {
ubl.lcd_map_control = false;
ui.defer_status_screen(false);
}
#endif
if (!already_shutdown_steppers) {
already_shutdown_steppers = true; // L6470 SPI will consume 99% of free time without this
#if ENABLED(DISABLE_INACTIVE_X)
disable_X();
#endif
#if ENABLED(DISABLE_INACTIVE_Y)
disable_Y();
#endif
#if ENABLED(DISABLE_INACTIVE_Z)
disable_Z();
#endif
#if ENABLED(DISABLE_INACTIVE_E)
disable_e_steppers();
#endif
#if HAS_LCD_MENU && ENABLED(AUTO_BED_LEVELING_UBL)
if (ubl.lcd_map_control) {
ubl.lcd_map_control = false;
ui.defer_status_screen(false);
}
#endif
}
}
else
already_shutdown_steppers = false;
}
#if PIN_EXISTS(CHDK) // Check if pin should be set to LOW (after M240 set it HIGH)
@ -516,6 +528,10 @@ void manage_inactivity(const bool ignore_stepper_queue/*=false*/) {
monitor_tmc_driver();
#endif
#if ENABLED(MONITOR_L6470_DRIVER_STATUS)
L6470.monitor_driver();
#endif
// Limit check_axes_activity frequency to 10Hz
static millis_t next_check_axes_ms = 0;
if (ELAPSED(ms, next_check_axes_ms)) {
@ -680,6 +696,10 @@ void setup() {
HAL_init();
#endif
#if HAS_DRIVER(L6470)
L6470.init(); // setup SPI and then init chips
#endif
#if ENABLED(MAX7219_DEBUG)
max7219.init();
#endif