Browse Source

Clean up trailing whitespace

Scott Lahteine 7 years ago
parent
commit
382a5e3318

+ 1
- 1
Marlin/src/HAL/HAL_STM32F7/EEPROM_Emul/eeprom_emul.cpp View File

48
   * @{
48
   * @{
49
   */
49
   */
50
 #ifdef STM32F7
50
 #ifdef STM32F7
51
-  
51
+
52
 /* Includes ------------------------------------------------------------------*/
52
 /* Includes ------------------------------------------------------------------*/
53
 #include "eeprom_emul.h"
53
 #include "eeprom_emul.h"
54
 
54
 

+ 3
- 3
Marlin/src/HAL/HAL_STM32F7/README.md View File

1
 # This HAL is for the STM32F765 board "The Borg" used with STM32Generic Arduino core by danieleff.
1
 # This HAL is for the STM32F765 board "The Borg" used with STM32Generic Arduino core by danieleff.
2
 
2
 
3
-# Original core is located at: 
3
+# Original core is located at:
4
 
4
 
5
 https://github.com/danieleff/STM32GENERIC
5
 https://github.com/danieleff/STM32GENERIC
6
 
6
 
7
 but i have not committed the changes needed for the Borg there yet, so please use:
7
 but i have not committed the changes needed for the Borg there yet, so please use:
8
 
8
 
9
-https://github.com/Spawn32/STM32GENERIC 
9
+https://github.com/Spawn32/STM32GENERIC
10
 
10
 
11
 Unzip it into [Arduino]/hardware folder
11
 Unzip it into [Arduino]/hardware folder
12
 
12
 
13
 
13
 
14
-Download the latest GNU ARM Embedded Toolchain: 
14
+Download the latest GNU ARM Embedded Toolchain:
15
 
15
 
16
 https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads
16
 https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads
17
 
17
 

+ 5
- 5
Marlin/src/HAL/HAL_STM32F7/TMC2660.cpp View File

1
 /**
1
 /**
2
  * TMC26XStepper.cpp - - TMC26X Stepper library for Wiring/Arduino
2
  * TMC26XStepper.cpp - - TMC26X Stepper library for Wiring/Arduino
3
- * 
3
+ *
4
  * based on the stepper library by Tom Igoe, et. al.
4
  * based on the stepper library by Tom Igoe, et. al.
5
  *
5
  *
6
  * Copyright (c) 2011, Interactive Matter, Marcus Nowotny
6
  * Copyright (c) 2011, Interactive Matter, Marcus Nowotny
7
- * 
7
+ *
8
  * Permission is hereby granted, free of charge, to any person obtaining a copy
8
  * Permission is hereby granted, free of charge, to any person obtaining a copy
9
  * of this software and associated documentation files (the "Software"), to deal
9
  * of this software and associated documentation files (the "Software"), to deal
10
  * in the Software without restriction, including without limitation the rights
10
  * in the Software without restriction, including without limitation the rights
11
  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
  * copies of the Software, and to permit persons to whom the Software is
12
  * copies of the Software, and to permit persons to whom the Software is
13
  * furnished to do so, subject to the following conditions:
13
  * furnished to do so, subject to the following conditions:
14
- * 
14
+ *
15
  * The above copyright notice and this permission notice shall be included in
15
  * The above copyright notice and this permission notice shall be included in
16
  * all copies or substantial portions of the Software.
16
  * all copies or substantial portions of the Software.
17
- * 
17
+ *
18
  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
831
         SERIAL_ECHOLNPGM("\n  WARNING: Overtemperature Prewarning!");
831
         SERIAL_ECHOLNPGM("\n  WARNING: Overtemperature Prewarning!");
832
       else if (this->getOverTemperature()&TMC26X_OVERTEMPERATURE_SHUTDOWN)
832
       else if (this->getOverTemperature()&TMC26X_OVERTEMPERATURE_SHUTDOWN)
833
         SERIAL_ECHOLNPGM("\n  ERROR: Overtemperature Shutdown!");
833
         SERIAL_ECHOLNPGM("\n  ERROR: Overtemperature Shutdown!");
834
-      
834
+
835
       if (this->isShortToGroundA())
835
       if (this->isShortToGroundA())
836
         SERIAL_ECHOLNPGM("\n  ERROR: SHORT to ground on channel A!");
836
         SERIAL_ECHOLNPGM("\n  ERROR: SHORT to ground on channel A!");
837
 
837
 

+ 94
- 94
Marlin/src/HAL/HAL_STM32F7/TMC2660.h View File

1
 /**
1
 /**
2
  * TMC26XStepper.h - - TMC26X Stepper library for Wiring/Arduino
2
  * TMC26XStepper.h - - TMC26X Stepper library for Wiring/Arduino
3
- * 
3
+ *
4
  * based on the stepper library by Tom Igoe, et. al.
4
  * based on the stepper library by Tom Igoe, et. al.
5
  *
5
  *
6
  * Copyright (c) 2011, Interactive Matter, Marcus Nowotny
6
  * Copyright (c) 2011, Interactive Matter, Marcus Nowotny
7
- * 
7
+ *
8
  * Permission is hereby granted, free of charge, to any person obtaining a copy
8
  * Permission is hereby granted, free of charge, to any person obtaining a copy
9
  * of this software and associated documentation files (the "Software"), to deal
9
  * of this software and associated documentation files (the "Software"), to deal
10
  * in the Software without restriction, including without limitation the rights
10
  * in the Software without restriction, including without limitation the rights
11
  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
  * copies of the Software, and to permit persons to whom the Software is
12
  * copies of the Software, and to permit persons to whom the Software is
13
  * furnished to do so, subject to the following conditions:
13
  * furnished to do so, subject to the following conditions:
14
- * 
14
+ *
15
  * The above copyright notice and this permission notice shall be included in
15
  * The above copyright notice and this permission notice shall be included in
16
  * all copies or substantial portions of the Software.
16
  * all copies or substantial portions of the Software.
17
- * 
17
+ *
18
  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
33
 
33
 
34
 //! return value for TMC26XStepper.getOverTemperature() if there is a overtemperature situation in the TMC chip
34
 //! return value for TMC26XStepper.getOverTemperature() if there is a overtemperature situation in the TMC chip
35
 /*!
35
 /*!
36
- * This warning indicates that the TCM chip is too warm. 
37
- * It is still working but some parameters may be inferior. 
36
+ * This warning indicates that the TCM chip is too warm.
37
+ * It is still working but some parameters may be inferior.
38
  * You should do something against it.
38
  * You should do something against it.
39
  */
39
  */
40
 #define TMC26X_OVERTEMPERATURE_PREWARING 1
40
 #define TMC26X_OVERTEMPERATURE_PREWARING 1
41
 //! return value for TMC26XStepper.getOverTemperature() if there is a overtemperature shutdown in the TMC chip
41
 //! return value for TMC26XStepper.getOverTemperature() if there is a overtemperature shutdown in the TMC chip
42
 /*!
42
 /*!
43
- * This warning indicates that the TCM chip is too warm to operate and has shut down to prevent damage. 
43
+ * This warning indicates that the TCM chip is too warm to operate and has shut down to prevent damage.
44
  * It will stop working until it cools down again.
44
  * It will stop working until it cools down again.
45
- * If you encouter this situation you must do something against it. Like reducing the current or improving the PCB layout 
45
+ * If you encouter this situation you must do something against it. Like reducing the current or improving the PCB layout
46
  * and/or heat management.
46
  * and/or heat management.
47
  */
47
  */
48
 #define TMC26X_OVERTEMPERATURE_SHUTDOWN 2
48
 #define TMC26X_OVERTEMPERATURE_SHUTDOWN 2
78
 /*!
78
 /*!
79
  * \class TMC26XStepper
79
  * \class TMC26XStepper
80
  * \brief Class representing a TMC26X stepper driver
80
  * \brief Class representing a TMC26X stepper driver
81
- * 
81
+ *
82
  * In order to use one fo those drivers in your Arduino code you have to create an object of that class:
82
  * In order to use one fo those drivers in your Arduino code you have to create an object of that class:
83
  * \code
83
  * \code
84
  * TMC26XStepper stepper = TMC26XStepper(200,1,2,3,500);
84
  * TMC26XStepper stepper = TMC26XStepper(200,1,2,3,500);
86
  * see TMC26XStepper(int number_of_steps, int cs_pin, int dir_pin, int step_pin, unsigned int rms_current)
86
  * see TMC26XStepper(int number_of_steps, int cs_pin, int dir_pin, int step_pin, unsigned int rms_current)
87
  *
87
  *
88
  * Keep in mind that you need to start the driver with start() in order to get the TMC26X configured.
88
  * Keep in mind that you need to start the driver with start() in order to get the TMC26X configured.
89
- * 
89
+ *
90
  * The most important function is the move(). It checks if the motor has to do a step or not.
90
  * The most important function is the move(). It checks if the motor has to do a step or not.
91
  * It is important that you call move() as often as possible in your Arduino loop() routine. I suggest
91
  * It is important that you call move() as often as possible in your Arduino loop() routine. I suggest
92
  * to use a very fast loop routine and always call it at the beginning or the end.
92
  * to use a very fast loop routine and always call it at the beginning or the end.
94
  * In order to move you have to provide a movement speed with setSpeed(). The speed is a positive value setting
94
  * In order to move you have to provide a movement speed with setSpeed(). The speed is a positive value setting
95
  * the rotations per minute.
95
  * the rotations per minute.
96
  *
96
  *
97
- * To really move the motor you have to call step() to tell the driver to move the motor the given number 
97
+ * To really move the motor you have to call step() to tell the driver to move the motor the given number
98
  * of steps in the given direction. Positive values move the motor in one direction, negative values in the other direction.
98
  * of steps in the given direction. Positive values move the motor in one direction, negative values in the other direction.
99
  *
99
  *
100
  * You can check with isMoving() if the mototr is still moving or stop it  apruptely with stop().
100
  * You can check with isMoving() if the mototr is still moving or stop it  apruptely with stop().
115
      *
115
      *
116
      * Keep in mind that you must also call TMC26XStepper.start() in order to configure the stepper driver for use.
116
      * Keep in mind that you must also call TMC26XStepper.start() in order to configure the stepper driver for use.
117
      *
117
      *
118
-     * By default the Constant Off Time chopper is used, see TCM262Stepper.setConstantOffTimeChopper() for details. 
118
+     * By default the Constant Off Time chopper is used, see TCM262Stepper.setConstantOffTimeChopper() for details.
119
      * This should work on most motors (YMMV). You may want to configure and use the Spread Cycle Chopper, see  setSpreadCycleChopper().
119
      * This should work on most motors (YMMV). You may want to configure and use the Spread Cycle Chopper, see  setSpreadCycleChopper().
120
      *
120
      *
121
      * By default a microstepping of 1/32th is used to provide a smooth motor run, while still giving a good progression per step.
121
      * By default a microstepping of 1/32th is used to provide a smooth motor run, while still giving a good progression per step.
123
      * \sa start(), setMicrosteps()
123
      * \sa start(), setMicrosteps()
124
      */
124
      */
125
     TMC26XStepper(int number_of_steps, int cs_pin, int dir_pin, int step_pin, unsigned int current, unsigned int resistor=100); //resistor=150
125
     TMC26XStepper(int number_of_steps, int cs_pin, int dir_pin, int step_pin, unsigned int current, unsigned int resistor=100); //resistor=150
126
-    
126
+
127
     /*!
127
     /*!
128
      * \brief configures and starts the TMC26X stepper driver. Before you called this function the stepper driver is in nonfunctional mode.
128
      * \brief configures and starts the TMC26X stepper driver. Before you called this function the stepper driver is in nonfunctional mode.
129
      *
129
      *
130
-     * This routine configures the TMC26X stepper driver for the given values via SPI. 
130
+     * This routine configures the TMC26X stepper driver for the given values via SPI.
131
      * Most member functions are non functional if the driver has not been started.
131
      * Most member functions are non functional if the driver has not been started.
132
      * Therefore it is best to call this in your Arduino setup() function.
132
      * Therefore it is best to call this in your Arduino setup() function.
133
      */
133
      */
134
     void start();
134
     void start();
135
-    
135
+
136
     /*!
136
     /*!
137
      * \brief resets the stepper in unconfigured mode.
137
      * \brief resets the stepper in unconfigured mode.
138
      *
138
      *
139
-     * This routine enables you to call start again. It does not change anything 
139
+     * This routine enables you to call start again. It does not change anything
140
      * in the internal stepper configuration or the desired configuration.
140
      * in the internal stepper configuration or the desired configuration.
141
      * It just marks the stepper as not yet startet. You do not have to reconfigure
141
      * It just marks the stepper as not yet startet. You do not have to reconfigure
142
      * the stepper to start it again, but it is not reset to any factory settings
142
      * the stepper to start it again, but it is not reset to any factory settings
151
      * \param whatSpeed the desired speed in rotations per minute.
151
      * \param whatSpeed the desired speed in rotations per minute.
152
      */
152
      */
153
     void setSpeed(unsigned int whatSpeed);
153
     void setSpeed(unsigned int whatSpeed);
154
-    
154
+
155
     /*!
155
     /*!
156
      * \brief reads out the currently selected speed in revolutions per minute.
156
      * \brief reads out the currently selected speed in revolutions per minute.
157
      * \sa setSpeed()
157
      * \sa setSpeed()
164
      * This method set's the number of microsteps per step in 2^i interval.
164
      * This method set's the number of microsteps per step in 2^i interval.
165
      * This means you can select 1, 2, 4, 16, 32, 64, 128 or 256 as valid microsteps.
165
      * This means you can select 1, 2, 4, 16, 32, 64, 128 or 256 as valid microsteps.
166
      * If you give any other value it will be rounded to the next smaller number (3 would give a microstepping of 2).
166
      * If you give any other value it will be rounded to the next smaller number (3 would give a microstepping of 2).
167
-     * You can always check the current microstepping with getMicrosteps(). 
168
-     */ 
167
+     * You can always check the current microstepping with getMicrosteps().
168
+     */
169
     void setMicrosteps(int number_of_steps);
169
     void setMicrosteps(int number_of_steps);
170
-    
170
+
171
     /*!
171
     /*!
172
      * \brief returns the effective current number of microsteps selected.
172
      * \brief returns the effective current number of microsteps selected.
173
      *
173
      *
174
-     * This function always returns the effective number of microsteps. 
174
+     * This function always returns the effective number of microsteps.
175
      * This can be a bit different than the micro steps set in setMicrosteps() since it is rounded to 2^i.
175
      * This can be a bit different than the micro steps set in setMicrosteps() since it is rounded to 2^i.
176
      *
176
      *
177
      * \sa setMicrosteps()
177
      * \sa setMicrosteps()
187
      * If the previous movement is not finished yet the function will return -1 and not change the steps to move the motor.
187
      * If the previous movement is not finished yet the function will return -1 and not change the steps to move the motor.
188
      * If the motor does not move it return 0
188
      * If the motor does not move it return 0
189
      *
189
      *
190
-     * The direction of the movement is indicated by the sign of the steps parameter. It is not determinable if positive values are right 
190
+     * The direction of the movement is indicated by the sign of the steps parameter. It is not determinable if positive values are right
191
      * or left This depends on the internal construction of the motor and how you connected it to the stepper driver.
191
      * or left This depends on the internal construction of the motor and how you connected it to the stepper driver.
192
      *
192
      *
193
      * You can always verify with isMoving() or even use stop() to stop the motor before giving it new step directions.
193
      * You can always verify with isMoving() or even use stop() to stop the motor before giving it new step directions.
194
      * \sa isMoving(), getStepsLeft(), stop()
194
      * \sa isMoving(), getStepsLeft(), stop()
195
      */
195
      */
196
     char step(int number_of_steps);
196
     char step(int number_of_steps);
197
-    
197
+
198
     /*!
198
     /*!
199
      * \brief Central movement method, must be called as often as possible in the lopp function and is very fast.
199
      * \brief Central movement method, must be called as often as possible in the lopp function and is very fast.
200
      *
200
      *
201
-     * This routine checks if the motor still has to move, if the waiting delay has passed to send a new step command to the motor 
201
+     * This routine checks if the motor still has to move, if the waiting delay has passed to send a new step command to the motor
202
      * and manages the number of steps yet to move to fulfill the current move command.
202
      * and manages the number of steps yet to move to fulfill the current move command.
203
      *
203
      *
204
      * This function is implemented to be as fast as possible to call it as often as possible in your loop routine.
204
      * This function is implemented to be as fast as possible to call it as often as possible in your loop routine.
206
      * possible is not a bad idea and if you even manage that the intervals you call this function are not too irregular helps too.
206
      * possible is not a bad idea and if you even manage that the intervals you call this function are not too irregular helps too.
207
      *
207
      *
208
      * You can call this routine even if you know that the motor is not miving. It introduces just a very small penalty in your code.
208
      * You can call this routine even if you know that the motor is not miving. It introduces just a very small penalty in your code.
209
-     * You must not call isMoving() to determine if you need to call this function, since taht is done internally already and only 
209
+     * You must not call isMoving() to determine if you need to call this function, since taht is done internally already and only
210
      * slows down you code.
210
      * slows down you code.
211
-     * 
211
+     *
212
      * How often you call this function directly influences your top miving speed for the motor. It may be a good idea to call this
212
      * How often you call this function directly influences your top miving speed for the motor. It may be a good idea to call this
213
      * from an timer overflow interrupt to ensure proper calling.
213
      * from an timer overflow interrupt to ensure proper calling.
214
      * \sa step()
214
      * \sa step()
223
      *\sa step(), move()
223
      *\sa step(), move()
224
      */
224
      */
225
     char isMoving(void);
225
     char isMoving(void);
226
-    
226
+
227
     /*!
227
     /*!
228
      * \brief Get the number of steps left in the current movement.
228
      * \brief Get the number of steps left in the current movement.
229
      * \return The number of steps left in the movement. This number is always positive.
229
      * \return The number of steps left in the movement. This number is always positive.
230
      */
230
      */
231
     unsigned int getStepsLeft(void);
231
     unsigned int getStepsLeft(void);
232
-    
232
+
233
     /*!
233
     /*!
234
      * \brief Stops the motor regardless if it moves or not.
234
      * \brief Stops the motor regardless if it moves or not.
235
      * \return -1 if the motor was moving and is really stoped or 0 if it was not moving at all.
235
      * \return -1 if the motor was moving and is really stoped or 0 if it was not moving at all.
237
      * This method directly and apruptely stops the motor and may be used as an emergency stop.
237
      * This method directly and apruptely stops the motor and may be used as an emergency stop.
238
      */
238
      */
239
     char stop(void);
239
     char stop(void);
240
-    
240
+
241
     /*!
241
     /*!
242
      * \brief Sets and configure the classical Constant Off Timer Chopper
242
      * \brief Sets and configure the classical Constant Off Timer Chopper
243
      * \param constant_off_time The off time setting controls the minimum chopper frequency. For most applications an off time within the range of 5μs to 20μs will fit. Setting this parameter to zero completely disables all driver transistors and the motor can free-wheel. 0: chopper off, 1:15: off time setting (1 will work with minimum blank time of 24 clocks)
243
      * \param constant_off_time The off time setting controls the minimum chopper frequency. For most applications an off time within the range of 5μs to 20μs will fit. Setting this parameter to zero completely disables all driver transistors and the motor can free-wheel. 0: chopper off, 1:15: off time setting (1 will work with minimum blank time of 24 clocks)
246
      * \param sine_wave_offset Sine wave offset. Controls the sine wave offset. A positive offset corrects for zero crossing error. -3…-1: negative offset, 0: no offset,1…12: positive offset
246
      * \param sine_wave_offset Sine wave offset. Controls the sine wave offset. A positive offset corrects for zero crossing error. -3…-1: negative offset, 0: no offset,1…12: positive offset
247
      * \param use_curreent_comparator Selects usage of the current comparator for termination of the fast decay cycle. If current comparator is enabled, it terminates the fast decay cycle in case the current reaches a higher negative value than the actual positive value. (0 disable, -1 enable).
247
      * \param use_curreent_comparator Selects usage of the current comparator for termination of the fast decay cycle. If current comparator is enabled, it terminates the fast decay cycle in case the current reaches a higher negative value than the actual positive value. (0 disable, -1 enable).
248
      *
248
      *
249
-     * The classic constant off time chopper uses a fixed portion of fast decay following each on phase. 
250
-     * While the duration of the on time is determined by the chopper comparator, the fast decay time needs 
251
-     * to be set by the user in a way, that the current decay is enough for the driver to be able to follow 
252
-     * the falling slope of the sine wave, and on the other hand it should not be too long, in order to minimize 
253
-     * motor current ripple and power dissipation. This best can be tuned using an oscilloscope or 
254
-     * trying out motor smoothness at different velocities. A good starting value is a fast decay time setting 
249
+     * The classic constant off time chopper uses a fixed portion of fast decay following each on phase.
250
+     * While the duration of the on time is determined by the chopper comparator, the fast decay time needs
251
+     * to be set by the user in a way, that the current decay is enough for the driver to be able to follow
252
+     * the falling slope of the sine wave, and on the other hand it should not be too long, in order to minimize
253
+     * motor current ripple and power dissipation. This best can be tuned using an oscilloscope or
254
+     * trying out motor smoothness at different velocities. A good starting value is a fast decay time setting
255
      * similar to the slow decay time setting.
255
      * similar to the slow decay time setting.
256
-     * After tuning of the fast decay time, the offset should be determined, in order to have a smooth zero transition. 
257
-     * This is necessary, because the fast decay phase leads to the absolute value of the motor current being lower 
258
-     * than the target current (see figure 17). If the zero offset is too low, the motor stands still for a short 
256
+     * After tuning of the fast decay time, the offset should be determined, in order to have a smooth zero transition.
257
+     * This is necessary, because the fast decay phase leads to the absolute value of the motor current being lower
258
+     * than the target current (see figure 17). If the zero offset is too low, the motor stands still for a short
259
      * moment during current zero crossing, if it is set too high, it makes a larger microstep.
259
      * moment during current zero crossing, if it is set too high, it makes a larger microstep.
260
      * Typically, a positive offset setting is required for optimum operation.
260
      * Typically, a positive offset setting is required for optimum operation.
261
      *
261
      *
263
      * \sa setRandomOffTime() for spreading the noise over a wider spectrum
263
      * \sa setRandomOffTime() for spreading the noise over a wider spectrum
264
      */
264
      */
265
     void setConstantOffTimeChopper(char constant_off_time, char blank_time, char fast_decay_time_setting, char sine_wave_offset, unsigned char use_current_comparator);
265
     void setConstantOffTimeChopper(char constant_off_time, char blank_time, char fast_decay_time_setting, char sine_wave_offset, unsigned char use_current_comparator);
266
-    
266
+
267
     /*!
267
     /*!
268
      * \brief Sets and configures with spread cycle chopper.
268
      * \brief Sets and configures with spread cycle chopper.
269
      * \param constant_off_time The off time setting controls the minimum chopper frequency. For most applications an off time within the range of 5μs to 20μs will fit. Setting this parameter to zero completely disables all driver transistors and the motor can free-wheel. 0: chopper off, 1:15: off time setting (1 will work with minimum blank time of 24 clocks)
269
      * \param constant_off_time The off time setting controls the minimum chopper frequency. For most applications an off time within the range of 5μs to 20μs will fit. Setting this parameter to zero completely disables all driver transistors and the motor can free-wheel. 0: chopper off, 1:15: off time setting (1 will work with minimum blank time of 24 clocks)
272
      * \param hysteresis_end Hysteresis end setting. Sets the hysteresis end value after a number of decrements. Decrement interval time is controlled by hysteresis_decrement. The sum hysteresis_start + hysteresis_end must be <16. At a current setting CS of max. 30 (amplitude reduced to 240), the sum is not limited.
272
      * \param hysteresis_end Hysteresis end setting. Sets the hysteresis end value after a number of decrements. Decrement interval time is controlled by hysteresis_decrement. The sum hysteresis_start + hysteresis_end must be <16. At a current setting CS of max. 30 (amplitude reduced to 240), the sum is not limited.
273
      * \param hysteresis_decrement Hysteresis decrement setting. This setting determines the slope of the hysteresis during on time and during fast decay time. 0 (fast decrement) … 3 (slow decrement).
273
      * \param hysteresis_decrement Hysteresis decrement setting. This setting determines the slope of the hysteresis during on time and during fast decay time. 0 (fast decrement) … 3 (slow decrement).
274
      *
274
      *
275
-     * The spreadCycle chopper scheme (pat.fil.) is a precise and simple to use chopper principle, which automatically determines 
276
-     * the optimum fast decay portion for the motor. Anyhow, a number of settings can be made in order to optimally fit the driver 
275
+     * The spreadCycle chopper scheme (pat.fil.) is a precise and simple to use chopper principle, which automatically determines
276
+     * the optimum fast decay portion for the motor. Anyhow, a number of settings can be made in order to optimally fit the driver
277
      * to the motor.
277
      * to the motor.
278
      * Each chopper cycle is comprised of an on-phase, a slow decay phase, a fast decay phase and a second slow decay phase.
278
      * Each chopper cycle is comprised of an on-phase, a slow decay phase, a fast decay phase and a second slow decay phase.
279
-     * The slow decay phases limit the maximum chopper frequency and are important for low motor and driver power dissipation. 
280
-     * The hysteresis start setting limits the chopper frequency by forcing the driver to introduce a minimum amount of 
281
-     * current ripple into the motor coils. The motor inductivity determines the ability to follow a changing motor current. 
282
-     * The duration of the on- and fast decay phase needs to cover at least the blank time, because the current comparator is 
279
+     * The slow decay phases limit the maximum chopper frequency and are important for low motor and driver power dissipation.
280
+     * The hysteresis start setting limits the chopper frequency by forcing the driver to introduce a minimum amount of
281
+     * current ripple into the motor coils. The motor inductivity determines the ability to follow a changing motor current.
282
+     * The duration of the on- and fast decay phase needs to cover at least the blank time, because the current comparator is
283
      * disabled during this time.
283
      * disabled during this time.
284
-     * 
284
+     *
285
      * \sa setRandomOffTime() for spreading the noise over a wider spectrum
285
      * \sa setRandomOffTime() for spreading the noise over a wider spectrum
286
      */
286
      */
287
     void setSpreadCycleChopper(char constant_off_time, char blank_time, char hysteresis_start, char hysteresis_end, char hysteresis_decrement);
287
     void setSpreadCycleChopper(char constant_off_time, char blank_time, char hysteresis_start, char hysteresis_end, char hysteresis_decrement);
290
      * \brief Use random off time for noise reduction (0 for off, -1 for on).
290
      * \brief Use random off time for noise reduction (0 for off, -1 for on).
291
      * \param value 0 for off, -1 for on
291
      * \param value 0 for off, -1 for on
292
      *
292
      *
293
-     * In a constant off time chopper scheme both coil choppers run freely, i.e. are not synchronized. 
294
-     * The frequency of each chopper mainly depends on the coil current and the position dependant motor coil inductivity, 
295
-     * thus it depends on the microstep position. With some motors a slightly audible beat can occur between the chopper 
296
-     * frequencies, especially when they are near to each other. This typically occurs at a few microstep positions within 
297
-     * each quarter wave. 
298
-     * This effect normally is not audible when compared to mechanical noise generated by ball bearings, 
293
+     * In a constant off time chopper scheme both coil choppers run freely, i.e. are not synchronized.
294
+     * The frequency of each chopper mainly depends on the coil current and the position dependant motor coil inductivity,
295
+     * thus it depends on the microstep position. With some motors a slightly audible beat can occur between the chopper
296
+     * frequencies, especially when they are near to each other. This typically occurs at a few microstep positions within
297
+     * each quarter wave.
298
+     * This effect normally is not audible when compared to mechanical noise generated by ball bearings,
299
      * etc. Further factors which can cause a similar effect are a poor layout of sense resistor GND connection.
299
      * etc. Further factors which can cause a similar effect are a poor layout of sense resistor GND connection.
300
-     * In order to minimize the effect of a beat between both chopper frequencies, an internal random generator is provided. 
300
+     * In order to minimize the effect of a beat between both chopper frequencies, an internal random generator is provided.
301
      * It modulates the slow decay time setting when switched on. The random off time feature further spreads the chopper spectrum,
301
      * It modulates the slow decay time setting when switched on. The random off time feature further spreads the chopper spectrum,
302
      * reducing electromagnetic emission on single frequencies.
302
      * reducing electromagnetic emission on single frequencies.
303
      */
303
      */
304
     void setRandomOffTime(char value);
304
     void setRandomOffTime(char value);
305
-    
305
+
306
     /*!
306
     /*!
307
      * \brief set the maximum motor current in mA (1000 is 1 Amp)
307
      * \brief set the maximum motor current in mA (1000 is 1 Amp)
308
      * Keep in mind this is the maximum peak Current. The RMS current will be 1/sqrt(2) smaller. The actual current can also be smaller
308
      * Keep in mind this is the maximum peak Current. The RMS current will be 1/sqrt(2) smaller. The actual current can also be smaller
311
      * \sa getCurrent(), getCurrentCurrent()
311
      * \sa getCurrent(), getCurrentCurrent()
312
      */
312
      */
313
     void setCurrent(unsigned int current);
313
     void setCurrent(unsigned int current);
314
-    
314
+
315
     /*!
315
     /*!
316
      * \brief readout the motor maximum current in mA (1000 is an Amp)
316
      * \brief readout the motor maximum current in mA (1000 is an Amp)
317
      * This is the maximum current. to get the current current - which may be affected by CoolStep us getCurrentCurrent()
317
      * This is the maximum current. to get the current current - which may be affected by CoolStep us getCurrentCurrent()
319
      * \sa getCurrentCurrent()
319
      * \sa getCurrentCurrent()
320
      */
320
      */
321
     unsigned int getCurrent(void);
321
     unsigned int getCurrent(void);
322
-    
322
+
323
     /*!
323
     /*!
324
      * \brief set the StallGuard threshold in order to get sensible StallGuard readings.
324
      * \brief set the StallGuard threshold in order to get sensible StallGuard readings.
325
      * \param stall_guard_threshold -64 … 63 the StallGuard threshold
325
      * \param stall_guard_threshold -64 … 63 the StallGuard threshold
332
      *
332
      *
333
      * If you switch on the filter the StallGuard reading is only updated each 4th full step to reduce the noise in the
333
      * If you switch on the filter the StallGuard reading is only updated each 4th full step to reduce the noise in the
334
      * reading.
334
      * reading.
335
-     * 
335
+     *
336
      * \sa getCurrentStallGuardReading() to read out the current value.
336
      * \sa getCurrentStallGuardReading() to read out the current value.
337
-     */ 
337
+     */
338
     void setStallGuardThreshold(char stall_guard_threshold, char stall_guard_filter_enabled);
338
     void setStallGuardThreshold(char stall_guard_threshold, char stall_guard_filter_enabled);
339
-    
339
+
340
     /*!
340
     /*!
341
      * \brief reads out the StallGuard threshold
341
      * \brief reads out the StallGuard threshold
342
      * \return a number between -64 and 63.
342
      * \return a number between -64 and 63.
343
      */
343
      */
344
     char getStallGuardThreshold(void);
344
     char getStallGuardThreshold(void);
345
-    
345
+
346
     /*!
346
     /*!
347
      * \brief returns the current setting of the StallGuard filter
347
      * \brief returns the current setting of the StallGuard filter
348
      * \return 0 if not set, -1 if set
348
      * \return 0 if not set, -1 if set
349
      */
349
      */
350
     char getStallGuardFilter(void);
350
     char getStallGuardFilter(void);
351
-    
351
+
352
     /*!
352
     /*!
353
      * \brief This method configures the CoolStep smart energy operation. You must have a proper StallGuard configuration for the motor situation (current, voltage, speed) in rder to use this feature.
353
      * \brief This method configures the CoolStep smart energy operation. You must have a proper StallGuard configuration for the motor situation (current, voltage, speed) in rder to use this feature.
354
      * \param lower_SG_threshold Sets the lower threshold for stallGuard2TM reading. Below this value, the motor current becomes increased. Allowed values are 0...480
354
      * \param lower_SG_threshold Sets the lower threshold for stallGuard2TM reading. Below this value, the motor current becomes increased. Allowed values are 0...480
358
      * \param lower_current_limit Sets the lower motor current limit for coolStepTM operation by scaling the CS value. Values can be COOL_STEP_HALF_CS_LIMIT, COOL_STEP_QUARTER_CS_LIMIT
358
      * \param lower_current_limit Sets the lower motor current limit for coolStepTM operation by scaling the CS value. Values can be COOL_STEP_HALF_CS_LIMIT, COOL_STEP_QUARTER_CS_LIMIT
359
      * The CoolStep smart energy operation automatically adjust the current sent into the motor according to the current load,
359
      * The CoolStep smart energy operation automatically adjust the current sent into the motor according to the current load,
360
      * read out by the StallGuard in order to provide the optimum torque with the minimal current consumption.
360
      * read out by the StallGuard in order to provide the optimum torque with the minimal current consumption.
361
-     * You configure the CoolStep current regulator by defining upper and lower bounds of StallGuard readouts. If the readout is above the 
361
+     * You configure the CoolStep current regulator by defining upper and lower bounds of StallGuard readouts. If the readout is above the
362
      * limit the current gets increased, below the limit the current gets decreased.
362
      * limit the current gets increased, below the limit the current gets decreased.
363
      * You can specify the upper an lower threshold of the StallGuard readout in order to adjust the current. You can also set the number of
363
      * You can specify the upper an lower threshold of the StallGuard readout in order to adjust the current. You can also set the number of
364
      * StallGuard readings neccessary above or below the limit to get a more stable current adjustement.
364
      * StallGuard readings neccessary above or below the limit to get a more stable current adjustement.
368
      */
368
      */
369
     void setCoolStepConfiguration(unsigned int lower_SG_threshold, unsigned int SG_hysteresis, unsigned char current_decrement_step_size,
369
     void setCoolStepConfiguration(unsigned int lower_SG_threshold, unsigned int SG_hysteresis, unsigned char current_decrement_step_size,
370
                                   unsigned char current_increment_step_size, unsigned char lower_current_limit);
370
                                   unsigned char current_increment_step_size, unsigned char lower_current_limit);
371
-    
371
+
372
     /*!
372
     /*!
373
      * \brief enables or disables the CoolStep smart energy operation feature. It must be configured before enabling it.
373
      * \brief enables or disables the CoolStep smart energy operation feature. It must be configured before enabling it.
374
      * \param enabled true if CoolStep should be enabled, false if not.
374
      * \param enabled true if CoolStep should be enabled, false if not.
375
      * \sa setCoolStepConfiguration()
375
      * \sa setCoolStepConfiguration()
376
      */
376
      */
377
     void setCoolStepEnabled(boolean enabled);
377
     void setCoolStepEnabled(boolean enabled);
378
-    
379
-    
378
+
379
+
380
     /*!
380
     /*!
381
      * \brief check if the CoolStep feature is enabled
381
      * \brief check if the CoolStep feature is enabled
382
      * \sa setCoolStepEnabled()
382
      * \sa setCoolStepEnabled()
388
      * \sa setCoolStepConfiguration()
388
      * \sa setCoolStepConfiguration()
389
      */
389
      */
390
     unsigned int getCoolStepLowerSgThreshold();
390
     unsigned int getCoolStepLowerSgThreshold();
391
-    
391
+
392
     /*!
392
     /*!
393
      * \brief returns the upper StallGuard threshold for the CoolStep operation
393
      * \brief returns the upper StallGuard threshold for the CoolStep operation
394
      * \sa setCoolStepConfiguration()
394
      * \sa setCoolStepConfiguration()
395
      */
395
      */
396
     unsigned int getCoolStepUpperSgThreshold();
396
     unsigned int getCoolStepUpperSgThreshold();
397
-    
397
+
398
     /*!
398
     /*!
399
      * \brief returns the number of StallGuard readings befor CoolStep adjusts the motor current.
399
      * \brief returns the number of StallGuard readings befor CoolStep adjusts the motor current.
400
      * \sa setCoolStepConfiguration()
400
      * \sa setCoolStepConfiguration()
401
      */
401
      */
402
     unsigned char getCoolStepNumberOfSGReadings();
402
     unsigned char getCoolStepNumberOfSGReadings();
403
-    
403
+
404
     /*!
404
     /*!
405
      * \brief returns the increment steps for the current for the CoolStep operation
405
      * \brief returns the increment steps for the current for the CoolStep operation
406
      * \sa setCoolStepConfiguration()
406
      * \sa setCoolStepConfiguration()
407
      */
407
      */
408
     unsigned char getCoolStepCurrentIncrementSize();
408
     unsigned char getCoolStepCurrentIncrementSize();
409
-    
409
+
410
     /*!
410
     /*!
411
      * \brief returns the absolut minium current for the CoolStep operation
411
      * \brief returns the absolut minium current for the CoolStep operation
412
      * \sa setCoolStepConfiguration()
412
      * \sa setCoolStepConfiguration()
413
      * \sa COOL_STEP_HALF_CS_LIMIT, COOL_STEP_QUARTER_CS_LIMIT
413
      * \sa COOL_STEP_HALF_CS_LIMIT, COOL_STEP_QUARTER_CS_LIMIT
414
      */
414
      */
415
     unsigned char getCoolStepLowerCurrentLimit();
415
     unsigned char getCoolStepLowerCurrentLimit();
416
-    
416
+
417
     /*!
417
     /*!
418
      * \brief Get the current microstep position for phase A
418
      * \brief Get the current microstep position for phase A
419
      * \return The current microstep position for phase A 0…255
419
      * \return The current microstep position for phase A 0…255
420
-     * 
420
+     *
421
      * Keep in mind that this routine reads and writes a value via SPI - so this may take a bit time.
421
      * Keep in mind that this routine reads and writes a value via SPI - so this may take a bit time.
422
      */
422
      */
423
     int getMotorPosition(void);
423
     int getMotorPosition(void);
424
-    
424
+
425
     /*!
425
     /*!
426
      * \brief Reads the current StallGuard value.
426
      * \brief Reads the current StallGuard value.
427
      * \return The current StallGuard value, lesser values indicate higher load, 0 means stall detected.
427
      * \return The current StallGuard value, lesser values indicate higher load, 0 means stall detected.
429
      * \sa setStallGuardThreshold() for tuning the readout to sensible ranges.
429
      * \sa setStallGuardThreshold() for tuning the readout to sensible ranges.
430
      */
430
      */
431
     int getCurrentStallGuardReading(void);
431
     int getCurrentStallGuardReading(void);
432
-    
432
+
433
     /*!
433
     /*!
434
      * \brief Reads the current current setting value as fraction of the maximum current
434
      * \brief Reads the current current setting value as fraction of the maximum current
435
      * Returns values between 0 and 31, representing 1/32 to 32/32 (=1)
435
      * Returns values between 0 and 31, representing 1/32 to 32/32 (=1)
436
      * \sa setCoolStepConfiguration()
436
      * \sa setCoolStepConfiguration()
437
      */
437
      */
438
     unsigned char getCurrentCSReading(void);
438
     unsigned char getCurrentCSReading(void);
439
-    
440
-    
439
+
440
+
441
     /*!
441
     /*!
442
      *\brief a convenience method to determine if the current scaling uses 0.31V or 0.165V as reference.
442
      *\brief a convenience method to determine if the current scaling uses 0.31V or 0.165V as reference.
443
      *\return false if 0.13V is the reference voltage, true if 0.165V is used.
443
      *\return false if 0.13V is the reference voltage, true if 0.165V is used.
447
     /*!
447
     /*!
448
      * \brief Reads the current current setting value and recalculates the absolute current in mA (1A would be 1000).
448
      * \brief Reads the current current setting value and recalculates the absolute current in mA (1A would be 1000).
449
      * This method calculates the currently used current setting (either by setting or by CoolStep) and reconstructs
449
      * This method calculates the currently used current setting (either by setting or by CoolStep) and reconstructs
450
-     * the current in mA by usinge the VSENSE and resistor value. This method uses floating point math - so it 
450
+     * the current in mA by usinge the VSENSE and resistor value. This method uses floating point math - so it
451
      * may not be the fastest.
451
      * may not be the fastest.
452
      * \sa getCurrentCSReading(), getResistor(), isCurrentScalingHalfed(), getCurrent()
452
      * \sa getCurrentCSReading(), getResistor(), isCurrentScalingHalfed(), getCurrent()
453
      */
453
      */
454
     unsigned int getCurrentCurrent(void);
454
     unsigned int getCurrentCurrent(void);
455
-    
455
+
456
     /*!
456
     /*!
457
      * \brief checks if there is a StallGuard warning in the last status
457
      * \brief checks if there is a StallGuard warning in the last status
458
      * \return 0 if there was no warning, -1 if there was some warning.
458
      * \return 0 if there was no warning, -1 if there was some warning.
462
      * \sa setStallGuardThreshold() for tuning the readout to sensible ranges.
462
      * \sa setStallGuardThreshold() for tuning the readout to sensible ranges.
463
      */
463
      */
464
     boolean isStallGuardOverThreshold(void);
464
     boolean isStallGuardOverThreshold(void);
465
-    
465
+
466
     /*!
466
     /*!
467
      * \brief Return over temperature status of the last status readout
467
      * \brief Return over temperature status of the last status readout
468
      * return 0 is everything is OK, TMC26X_OVERTEMPERATURE_PREWARING if status is reached, TMC26X_OVERTEMPERATURE_SHUTDOWN is the chip is shutdown, -1 if the status is unknown.
468
      * return 0 is everything is OK, TMC26X_OVERTEMPERATURE_PREWARING if status is reached, TMC26X_OVERTEMPERATURE_SHUTDOWN is the chip is shutdown, -1 if the status is unknown.
470
      * You may want to use getMotorPosition() or getCurrentStallGuardReading() to enforce an updated status readout.
470
      * You may want to use getMotorPosition() or getCurrentStallGuardReading() to enforce an updated status readout.
471
      */
471
      */
472
     char getOverTemperature(void);
472
     char getOverTemperature(void);
473
-    
473
+
474
     /*!
474
     /*!
475
      * \brief Is motor channel A shorted to ground detected in the last status readout.
475
      * \brief Is motor channel A shorted to ground detected in the last status readout.
476
      * \return true is yes, false if not.
476
      * \return true is yes, false if not.
477
      * Keep in mind that this method does not enforce a readout but uses the value of the last status readout.
477
      * Keep in mind that this method does not enforce a readout but uses the value of the last status readout.
478
      * You may want to use getMotorPosition() or getCurrentStallGuardReading() to enforce an updated status readout.
478
      * You may want to use getMotorPosition() or getCurrentStallGuardReading() to enforce an updated status readout.
479
      */
479
      */
480
-     
480
+
481
     boolean isShortToGroundA(void);
481
     boolean isShortToGroundA(void);
482
 
482
 
483
     /*!
483
     /*!
502
      * You may want to use getMotorPosition() or getCurrentStallGuardReading() to enforce an updated status readout.
502
      * You may want to use getMotorPosition() or getCurrentStallGuardReading() to enforce an updated status readout.
503
      */
503
      */
504
     boolean isOpenLoadB(void);
504
     boolean isOpenLoadB(void);
505
-    
505
+
506
     /*!
506
     /*!
507
      * \brief Is chopper inactive since 2^20 clock cycles - defaults to ~0,08s
507
      * \brief Is chopper inactive since 2^20 clock cycles - defaults to ~0,08s
508
      * \return true is yes, false if not.
508
      * \return true is yes, false if not.
523
      * \sa setStallGuardThreshold() for tuning the readout to sensible ranges.
523
      * \sa setStallGuardThreshold() for tuning the readout to sensible ranges.
524
      */
524
      */
525
     boolean isStallGuardReached(void);
525
     boolean isStallGuardReached(void);
526
-    
526
+
527
     /*!
527
     /*!
528
      *\brief enables or disables the motor driver bridges. If disabled the motor can run freely. If enabled not.
528
      *\brief enables or disables the motor driver bridges. If disabled the motor can run freely. If enabled not.
529
      *\param enabled a boolean value true if the motor should be enabled, false otherwise.
529
      *\param enabled a boolean value true if the motor should be enabled, false otherwise.
530
      */
530
      */
531
     void setEnabled(boolean enabled);
531
     void setEnabled(boolean enabled);
532
-    
532
+
533
     /*!
533
     /*!
534
      *\brief checks if the output bridges are enabled. If the bridges are not enabled the motor can run freely
534
      *\brief checks if the output bridges are enabled. If the bridges are not enabled the motor can run freely
535
      *\return true if the bridges and by that the motor driver are enabled, false if not.
535
      *\return true if the bridges and by that the motor driver are enabled, false if not.
541
      * \brief Manually read out the status register
541
      * \brief Manually read out the status register
542
      * This function sends a byte to the motor driver in order to get the current readout. The parameter read_value
542
      * This function sends a byte to the motor driver in order to get the current readout. The parameter read_value
543
      * seletcs which value will get returned. If the read_vlaue changes in respect to the previous readout this method
543
      * seletcs which value will get returned. If the read_vlaue changes in respect to the previous readout this method
544
-     * automatically send two bytes to the motor: one to set the redout and one to get the actual readout. So this method 
544
+     * automatically send two bytes to the motor: one to set the redout and one to get the actual readout. So this method
545
      * may take time to send and read one or two bits - depending on the previous readout.
545
      * may take time to send and read one or two bits - depending on the previous readout.
546
      * \param read_value selects which value to read out (0..3). You can use the defines TMC26X_READOUT_POSITION, TMC_262_READOUT_STALLGUARD, or TMC_262_READOUT_CURRENT
546
      * \param read_value selects which value to read out (0..3). You can use the defines TMC26X_READOUT_POSITION, TMC_262_READOUT_STALLGUARD, or TMC_262_READOUT_CURRENT
547
      * \sa TMC26X_READOUT_POSITION, TMC_262_READOUT_STALLGUARD, TMC_262_READOUT_CURRENT
547
      * \sa TMC26X_READOUT_POSITION, TMC_262_READOUT_STALLGUARD, TMC_262_READOUT_CURRENT
548
      */
548
      */
549
     void readStatus(char read_value);
549
     void readStatus(char read_value);
550
-    
550
+
551
     /*!
551
     /*!
552
      * \brief Returns the current sense resistor value in milliohm.
552
      * \brief Returns the current sense resistor value in milliohm.
553
      * The default value of ,15 Ohm will return 150.
553
      * The default value of ,15 Ohm will return 150.
555
     int getResistor();
555
     int getResistor();
556
 
556
 
557
     /*!
557
     /*!
558
-     * \brief Prints out all the information that can be found in the last status read out - it does not force a status readout. 
558
+     * \brief Prints out all the information that can be found in the last status read out - it does not force a status readout.
559
      * The result is printed via Serial
559
      * The result is printed via Serial
560
      */
560
      */
561
     void debugLastStatus(void);
561
     void debugLastStatus(void);
565
      */
565
      */
566
     int version(void);
566
     int version(void);
567
 
567
 
568
-  private:    
568
+  private:
569
     unsigned int steps_left;    // The steps the motor has to do to complete the movement
569
     unsigned int steps_left;    // The steps the motor has to do to complete the movement
570
     int direction;              // Direction of rotation
570
     int direction;              // Direction of rotation
571
     unsigned long step_delay;   // Delay between steps, in ms, based on speed
571
     unsigned long step_delay;   // Delay between steps, in ms, based on speed
572
     int number_of_steps;        // Total number of steps this motor can take
572
     int number_of_steps;        // Total number of steps this motor can take
573
     unsigned int speed;         // Store the current speed in order to change the speed after changing microstepping
573
     unsigned int speed;         // Store the current speed in order to change the speed after changing microstepping
574
     unsigned int resistor;      // Current sense resitor value in milliohm
574
     unsigned int resistor;      // Current sense resitor value in milliohm
575
-        
575
+
576
     unsigned long last_step_time;   // Time stamp in ms of when the last step was taken
576
     unsigned long last_step_time;   // Time stamp in ms of when the last step was taken
577
     unsigned long next_step_time;   // Time stamp in ms of when the last step was taken
577
     unsigned long next_step_time;   // Time stamp in ms of when the last step was taken
578
-    
578
+
579
     // Driver control register copies to easily set & modify the registers
579
     // Driver control register copies to easily set & modify the registers
580
     unsigned long driver_control_register_value;
580
     unsigned long driver_control_register_value;
581
     unsigned long chopper_config_register;
581
     unsigned long chopper_config_register;
584
     unsigned long driver_configuration_register_value;
584
     unsigned long driver_configuration_register_value;
585
     // The driver status result
585
     // The driver status result
586
     unsigned long driver_status_result;
586
     unsigned long driver_status_result;
587
-    
587
+
588
     // Helper routione to get the top 10 bit of the readout
588
     // Helper routione to get the top 10 bit of the readout
589
     inline int getReadoutValue();
589
     inline int getReadoutValue();
590
-    
590
+
591
     // The pins for the stepper driver
591
     // The pins for the stepper driver
592
     unsigned char cs_pin;
592
     unsigned char cs_pin;
593
     unsigned char step_pin;
593
     unsigned char step_pin;
594
     unsigned char dir_pin;
594
     unsigned char dir_pin;
595
-    
596
-    // Status values 
595
+
596
+    // Status values
597
     boolean started; // If the stepper has been started yet
597
     boolean started; // If the stepper has been started yet
598
     int microsteps; // The current number of micro steps
598
     int microsteps; // The current number of micro steps
599
     char constant_off_time; // We need to remember this value in order to enable and disable the motor
599
     char constant_off_time; // We need to remember this value in order to enable and disable the motor
600
     unsigned char cool_step_lower_threshold; //  we need to remember the threshold to enable and disable the CoolStep feature
600
     unsigned char cool_step_lower_threshold; //  we need to remember the threshold to enable and disable the CoolStep feature
601
     boolean cool_step_enabled; // We need to remember this to configure the coolstep if it si enabled
601
     boolean cool_step_enabled; // We need to remember this to configure the coolstep if it si enabled
602
-    
602
+
603
     // SPI sender
603
     // SPI sender
604
     inline void send262(unsigned long datagram);
604
     inline void send262(unsigned long datagram);
605
 };
605
 };

+ 1
- 1
Marlin/src/module/stepper_indirection.cpp View File

41
 #if ENABLED(HAVE_TMCDRIVER)
41
 #if ENABLED(HAVE_TMCDRIVER)
42
 
42
 
43
   #include <SPI.h>
43
   #include <SPI.h>
44
-  
44
+
45
   #ifdef STM32F7
45
   #ifdef STM32F7
46
     #include "../HAL/HAL_STM32F7/TMC2660.h"
46
     #include "../HAL/HAL_STM32F7/TMC2660.h"
47
   #else
47
   #else

+ 6
- 6
Marlin/src/pins/pins_THE_BORG.h View File

56
 #define X_MAX_PIN          _STM32_PIN(PORTE, 10)
56
 #define X_MAX_PIN          _STM32_PIN(PORTE, 10)
57
 #define Y_MIN_PIN          _STM32_PIN(PORTE, 7)
57
 #define Y_MIN_PIN          _STM32_PIN(PORTE, 7)
58
 #define Y_MAX_PIN          _STM32_PIN(PORTE, 8)
58
 #define Y_MAX_PIN          _STM32_PIN(PORTE, 8)
59
-#define Z_MIN_PIN          _STM32_PIN(PORTF, 15) 
59
+#define Z_MIN_PIN          _STM32_PIN(PORTF, 15)
60
 #define Z_MAX_PIN          _STM32_PIN(PORTG, 0)
60
 #define Z_MAX_PIN          _STM32_PIN(PORTG, 0)
61
-#define E_MIN_PIN          _STM32_PIN(PORTE, 2)  
61
+#define E_MIN_PIN          _STM32_PIN(PORTE, 2)
62
 #define E_MAX_PIN          _STM32_PIN(PORTE, 3)
62
 #define E_MAX_PIN          _STM32_PIN(PORTE, 3)
63
 //
63
 //
64
 // Z Probe (when not Z_MIN_PIN)
64
 // Z Probe (when not Z_MIN_PIN)
165
 // Prusa i3 MK2 Multi Material Multiplexer Support
165
 // Prusa i3 MK2 Multi Material Multiplexer Support
166
 //
166
 //
167
 
167
 
168
-#define E_MUX0_PIN         _STM32_PIN(PORTG, 3)  
168
+#define E_MUX0_PIN         _STM32_PIN(PORTG, 3)
169
 #define E_MUX1_PIN         _STM32_PIN(PORTG, 4)
169
 #define E_MUX1_PIN         _STM32_PIN(PORTG, 4)
170
 
170
 
171
 //
171
 //
172
 // Servos
172
 // Servos
173
 //
173
 //
174
 
174
 
175
-#define SERVO0_PIN         _STM32_PIN(PORTE, 13)  
176
-#define SERVO1_PIN         _STM32_PIN(PORTE, 14)  
175
+#define SERVO0_PIN         _STM32_PIN(PORTE, 13)
176
+#define SERVO1_PIN         _STM32_PIN(PORTE, 14)
177
 
177
 
178
 
178
 
179
 #define SDSS               _STM32_PIN(PORTA, 8)
179
 #define SDSS               _STM32_PIN(PORTA, 8)
191
 #define MAX7219_LOAD_PIN   _STM32_PIN(PORTD, 1)     //EXP1-5
191
 #define MAX7219_LOAD_PIN   _STM32_PIN(PORTD, 1)     //EXP1-5
192
 
192
 
193
 //#define NEOPIXEL_PIN    4
193
 //#define NEOPIXEL_PIN    4
194
-  
194
+
195
 //
195
 //
196
 // LCD / Controller
196
 // LCD / Controller
197
 //
197
 //

+ 1
- 1
Marlin/src/sd/cardreader.cpp View File

180
 ) {
180
 ) {
181
   lsAction = LS_SerialPrint;
181
   lsAction = LS_SerialPrint;
182
   root.rewind();
182
   root.rewind();
183
-  lsDive("", root  
183
+  lsDive("", root
184
     #if NUM_SERIAL > 1
184
     #if NUM_SERIAL > 1
185
       , NULL, port
185
       , NULL, port
186
     #endif
186
     #endif

+ 1
- 1
Marlin/src/sd/cardreader.h View File

174
   LsAction lsAction; //stored for recursion.
174
   LsAction lsAction; //stored for recursion.
175
   uint16_t nrFiles; //counter for the files in the current directory and recycled as position counter for getting the nrFiles'th name in the directory.
175
   uint16_t nrFiles; //counter for the files in the current directory and recycled as position counter for getting the nrFiles'th name in the directory.
176
   char* diveDirName;
176
   char* diveDirName;
177
-  void lsDive(const char *prepend, SdFile parent, const char * const match=NULL  
177
+  void lsDive(const char *prepend, SdFile parent, const char * const match=NULL
178
     #if NUM_SERIAL > 1
178
     #if NUM_SERIAL > 1
179
       , const int8_t port = -1
179
       , const int8_t port = -1
180
     #endif
180
     #endif

Loading…
Cancel
Save