diff options
Diffstat (limited to 'src/Hardware/SAM4E/Main.cpp')
-rw-r--r-- | src/Hardware/SAM4E/Main.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/Hardware/SAM4E/Main.cpp b/src/Hardware/SAM4E/Main.cpp new file mode 100644 index 00000000..355443b4 --- /dev/null +++ b/src/Hardware/SAM4E/Main.cpp @@ -0,0 +1,26 @@ +/* + * Main.cpp + * Program entry point + * Created on: 11 Jul 2020 + * Author: David + * License: GNU GPL version 3 + */ + +#include <CoreIO.h> +#include <RepRapFirmware.h> + +// Program initialisation +void AppInit() noexcept +{ + // When the reset button is pressed on pre-production Duet WiFi boards, if the TMC2660 drivers were previously enabled then we get + // uncommanded motor movements if the STEP lines pick up any noise. Try to reduce that by initialising the pins that control the drivers early here. + // On the production boards the ENN line is pulled high by an external pullup resistor and that prevents motor movements. + for (size_t drive = 0; drive < MaxSmartDrivers; ++drive) + { + pinMode(STEP_PINS[drive], OUTPUT_LOW); + pinMode(DIRECTION_PINS[drive], OUTPUT_LOW); + pinMode(ENABLE_PINS[drive], OUTPUT_HIGH); + } +} + +// End |