Bläddra i källkod

Clean up trailing whitespace

Scott Lahteine 7 år sedan
förälder
incheckning
382a5e3318

+ 1
- 1
Marlin/src/HAL/HAL_STM32F7/EEPROM_Emul/eeprom_emul.cpp Visa fil

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

+ 3
- 3
Marlin/src/HAL/HAL_STM32F7/README.md Visa fil

@@ -1,17 +1,17 @@
1 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 5
 https://github.com/danieleff/STM32GENERIC
6 6
 
7 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 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 16
 https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads
17 17
 

+ 5
- 5
Marlin/src/HAL/HAL_STM32F7/TMC2660.cpp Visa fil

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

+ 94
- 94
Marlin/src/HAL/HAL_STM32F7/TMC2660.h Visa fil

@@ -1,20 +1,20 @@
1 1
 /**
2 2
  * TMC26XStepper.h - - TMC26X Stepper library for Wiring/Arduino
3
- * 
3
+ *
4 4
  * based on the stepper library by Tom Igoe, et. al.
5 5
  *
6 6
  * Copyright (c) 2011, Interactive Matter, Marcus Nowotny
7
- * 
7
+ *
8 8
  * Permission is hereby granted, free of charge, to any person obtaining a copy
9 9
  * of this software and associated documentation files (the "Software"), to deal
10 10
  * in the Software without restriction, including without limitation the rights
11 11
  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12 12
  * copies of the Software, and to permit persons to whom the Software is
13 13
  * furnished to do so, subject to the following conditions:
14
- * 
14
+ *
15 15
  * The above copyright notice and this permission notice shall be included in
16 16
  * all copies or substantial portions of the Software.
17
- * 
17
+ *
18 18
  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 19
  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 20
  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -33,16 +33,16 @@
33 33
 
34 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 38
  * You should do something against it.
39 39
  */
40 40
 #define TMC26X_OVERTEMPERATURE_PREWARING 1
41 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 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 46
  * and/or heat management.
47 47
  */
48 48
 #define TMC26X_OVERTEMPERATURE_SHUTDOWN 2
@@ -78,7 +78,7 @@
78 78
 /*!
79 79
  * \class TMC26XStepper
80 80
  * \brief Class representing a TMC26X stepper driver
81
- * 
81
+ *
82 82
  * In order to use one fo those drivers in your Arduino code you have to create an object of that class:
83 83
  * \code
84 84
  * TMC26XStepper stepper = TMC26XStepper(200,1,2,3,500);
@@ -86,7 +86,7 @@
86 86
  * see TMC26XStepper(int number_of_steps, int cs_pin, int dir_pin, int step_pin, unsigned int rms_current)
87 87
  *
88 88
  * Keep in mind that you need to start the driver with start() in order to get the TMC26X configured.
89
- * 
89
+ *
90 90
  * The most important function is the move(). It checks if the motor has to do a step or not.
91 91
  * It is important that you call move() as often as possible in your Arduino loop() routine. I suggest
92 92
  * to use a very fast loop routine and always call it at the beginning or the end.
@@ -94,7 +94,7 @@
94 94
  * In order to move you have to provide a movement speed with setSpeed(). The speed is a positive value setting
95 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 98
  * of steps in the given direction. Positive values move the motor in one direction, negative values in the other direction.
99 99
  *
100 100
  * You can check with isMoving() if the mototr is still moving or stop it  apruptely with stop().
@@ -115,7 +115,7 @@ class TMC26XStepper {
115 115
      *
116 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 119
      * This should work on most motors (YMMV). You may want to configure and use the Spread Cycle Chopper, see  setSpreadCycleChopper().
120 120
      *
121 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,20 +123,20 @@ class TMC26XStepper {
123 123
      * \sa start(), setMicrosteps()
124 124
      */
125 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 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 131
      * Most member functions are non functional if the driver has not been started.
132 132
      * Therefore it is best to call this in your Arduino setup() function.
133 133
      */
134 134
     void start();
135
-    
135
+
136 136
     /*!
137 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 140
      * in the internal stepper configuration or the desired configuration.
141 141
      * It just marks the stepper as not yet startet. You do not have to reconfigure
142 142
      * the stepper to start it again, but it is not reset to any factory settings
@@ -151,7 +151,7 @@ class TMC26XStepper {
151 151
      * \param whatSpeed the desired speed in rotations per minute.
152 152
      */
153 153
     void setSpeed(unsigned int whatSpeed);
154
-    
154
+
155 155
     /*!
156 156
      * \brief reads out the currently selected speed in revolutions per minute.
157 157
      * \sa setSpeed()
@@ -164,14 +164,14 @@ class TMC26XStepper {
164 164
      * This method set's the number of microsteps per step in 2^i interval.
165 165
      * This means you can select 1, 2, 4, 16, 32, 64, 128 or 256 as valid microsteps.
166 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 169
     void setMicrosteps(int number_of_steps);
170
-    
170
+
171 171
     /*!
172 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 175
      * This can be a bit different than the micro steps set in setMicrosteps() since it is rounded to 2^i.
176 176
      *
177 177
      * \sa setMicrosteps()
@@ -187,18 +187,18 @@ class TMC26XStepper {
187 187
      * If the previous movement is not finished yet the function will return -1 and not change the steps to move the motor.
188 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 191
      * or left This depends on the internal construction of the motor and how you connected it to the stepper driver.
192 192
      *
193 193
      * You can always verify with isMoving() or even use stop() to stop the motor before giving it new step directions.
194 194
      * \sa isMoving(), getStepsLeft(), stop()
195 195
      */
196 196
     char step(int number_of_steps);
197
-    
197
+
198 198
     /*!
199 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 202
      * and manages the number of steps yet to move to fulfill the current move command.
203 203
      *
204 204
      * This function is implemented to be as fast as possible to call it as often as possible in your loop routine.
@@ -206,9 +206,9 @@ class TMC26XStepper {
206 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 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 210
      * slows down you code.
211
-     * 
211
+     *
212 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 213
      * from an timer overflow interrupt to ensure proper calling.
214 214
      * \sa step()
@@ -223,13 +223,13 @@ class TMC26XStepper {
223 223
      *\sa step(), move()
224 224
      */
225 225
     char isMoving(void);
226
-    
226
+
227 227
     /*!
228 228
      * \brief Get the number of steps left in the current movement.
229 229
      * \return The number of steps left in the movement. This number is always positive.
230 230
      */
231 231
     unsigned int getStepsLeft(void);
232
-    
232
+
233 233
     /*!
234 234
      * \brief Stops the motor regardless if it moves or not.
235 235
      * \return -1 if the motor was moving and is really stoped or 0 if it was not moving at all.
@@ -237,7 +237,7 @@ class TMC26XStepper {
237 237
      * This method directly and apruptely stops the motor and may be used as an emergency stop.
238 238
      */
239 239
     char stop(void);
240
-    
240
+
241 241
     /*!
242 242
      * \brief Sets and configure the classical Constant Off Timer Chopper
243 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,16 +246,16 @@ class TMC26XStepper {
246 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 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 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 259
      * moment during current zero crossing, if it is set too high, it makes a larger microstep.
260 260
      * Typically, a positive offset setting is required for optimum operation.
261 261
      *
@@ -263,7 +263,7 @@ class TMC26XStepper {
263 263
      * \sa setRandomOffTime() for spreading the noise over a wider spectrum
264 264
      */
265 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 268
      * \brief Sets and configures with spread cycle chopper.
269 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,16 +272,16 @@ class TMC26XStepper {
272 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 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 277
      * to the motor.
278 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 283
      * disabled during this time.
284
-     * 
284
+     *
285 285
      * \sa setRandomOffTime() for spreading the noise over a wider spectrum
286 286
      */
287 287
     void setSpreadCycleChopper(char constant_off_time, char blank_time, char hysteresis_start, char hysteresis_end, char hysteresis_decrement);
@@ -290,19 +290,19 @@ class TMC26XStepper {
290 290
      * \brief Use random off time for noise reduction (0 for off, -1 for on).
291 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 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 301
      * It modulates the slow decay time setting when switched on. The random off time feature further spreads the chopper spectrum,
302 302
      * reducing electromagnetic emission on single frequencies.
303 303
      */
304 304
     void setRandomOffTime(char value);
305
-    
305
+
306 306
     /*!
307 307
      * \brief set the maximum motor current in mA (1000 is 1 Amp)
308 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,7 +311,7 @@ class TMC26XStepper {
311 311
      * \sa getCurrent(), getCurrentCurrent()
312 312
      */
313 313
     void setCurrent(unsigned int current);
314
-    
314
+
315 315
     /*!
316 316
      * \brief readout the motor maximum current in mA (1000 is an Amp)
317 317
      * This is the maximum current. to get the current current - which may be affected by CoolStep us getCurrentCurrent()
@@ -319,7 +319,7 @@ class TMC26XStepper {
319 319
      * \sa getCurrentCurrent()
320 320
      */
321 321
     unsigned int getCurrent(void);
322
-    
322
+
323 323
     /*!
324 324
      * \brief set the StallGuard threshold in order to get sensible StallGuard readings.
325 325
      * \param stall_guard_threshold -64 … 63 the StallGuard threshold
@@ -332,23 +332,23 @@ class TMC26XStepper {
332 332
      *
333 333
      * If you switch on the filter the StallGuard reading is only updated each 4th full step to reduce the noise in the
334 334
      * reading.
335
-     * 
335
+     *
336 336
      * \sa getCurrentStallGuardReading() to read out the current value.
337
-     */ 
337
+     */
338 338
     void setStallGuardThreshold(char stall_guard_threshold, char stall_guard_filter_enabled);
339
-    
339
+
340 340
     /*!
341 341
      * \brief reads out the StallGuard threshold
342 342
      * \return a number between -64 and 63.
343 343
      */
344 344
     char getStallGuardThreshold(void);
345
-    
345
+
346 346
     /*!
347 347
      * \brief returns the current setting of the StallGuard filter
348 348
      * \return 0 if not set, -1 if set
349 349
      */
350 350
     char getStallGuardFilter(void);
351
-    
351
+
352 352
     /*!
353 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 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,7 +358,7 @@ class TMC26XStepper {
358 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 359
      * The CoolStep smart energy operation automatically adjust the current sent into the motor according to the current load,
360 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 362
      * limit the current gets increased, below the limit the current gets decreased.
363 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 364
      * StallGuard readings neccessary above or below the limit to get a more stable current adjustement.
@@ -368,15 +368,15 @@ class TMC26XStepper {
368 368
      */
369 369
     void setCoolStepConfiguration(unsigned int lower_SG_threshold, unsigned int SG_hysteresis, unsigned char current_decrement_step_size,
370 370
                                   unsigned char current_increment_step_size, unsigned char lower_current_limit);
371
-    
371
+
372 372
     /*!
373 373
      * \brief enables or disables the CoolStep smart energy operation feature. It must be configured before enabling it.
374 374
      * \param enabled true if CoolStep should be enabled, false if not.
375 375
      * \sa setCoolStepConfiguration()
376 376
      */
377 377
     void setCoolStepEnabled(boolean enabled);
378
-    
379
-    
378
+
379
+
380 380
     /*!
381 381
      * \brief check if the CoolStep feature is enabled
382 382
      * \sa setCoolStepEnabled()
@@ -388,40 +388,40 @@ class TMC26XStepper {
388 388
      * \sa setCoolStepConfiguration()
389 389
      */
390 390
     unsigned int getCoolStepLowerSgThreshold();
391
-    
391
+
392 392
     /*!
393 393
      * \brief returns the upper StallGuard threshold for the CoolStep operation
394 394
      * \sa setCoolStepConfiguration()
395 395
      */
396 396
     unsigned int getCoolStepUpperSgThreshold();
397
-    
397
+
398 398
     /*!
399 399
      * \brief returns the number of StallGuard readings befor CoolStep adjusts the motor current.
400 400
      * \sa setCoolStepConfiguration()
401 401
      */
402 402
     unsigned char getCoolStepNumberOfSGReadings();
403
-    
403
+
404 404
     /*!
405 405
      * \brief returns the increment steps for the current for the CoolStep operation
406 406
      * \sa setCoolStepConfiguration()
407 407
      */
408 408
     unsigned char getCoolStepCurrentIncrementSize();
409
-    
409
+
410 410
     /*!
411 411
      * \brief returns the absolut minium current for the CoolStep operation
412 412
      * \sa setCoolStepConfiguration()
413 413
      * \sa COOL_STEP_HALF_CS_LIMIT, COOL_STEP_QUARTER_CS_LIMIT
414 414
      */
415 415
     unsigned char getCoolStepLowerCurrentLimit();
416
-    
416
+
417 417
     /*!
418 418
      * \brief Get the current microstep position for phase A
419 419
      * \return The current microstep position for phase A 0…255
420
-     * 
420
+     *
421 421
      * Keep in mind that this routine reads and writes a value via SPI - so this may take a bit time.
422 422
      */
423 423
     int getMotorPosition(void);
424
-    
424
+
425 425
     /*!
426 426
      * \brief Reads the current StallGuard value.
427 427
      * \return The current StallGuard value, lesser values indicate higher load, 0 means stall detected.
@@ -429,15 +429,15 @@ class TMC26XStepper {
429 429
      * \sa setStallGuardThreshold() for tuning the readout to sensible ranges.
430 430
      */
431 431
     int getCurrentStallGuardReading(void);
432
-    
432
+
433 433
     /*!
434 434
      * \brief Reads the current current setting value as fraction of the maximum current
435 435
      * Returns values between 0 and 31, representing 1/32 to 32/32 (=1)
436 436
      * \sa setCoolStepConfiguration()
437 437
      */
438 438
     unsigned char getCurrentCSReading(void);
439
-    
440
-    
439
+
440
+
441 441
     /*!
442 442
      *\brief a convenience method to determine if the current scaling uses 0.31V or 0.165V as reference.
443 443
      *\return false if 0.13V is the reference voltage, true if 0.165V is used.
@@ -447,12 +447,12 @@ class TMC26XStepper {
447 447
     /*!
448 448
      * \brief Reads the current current setting value and recalculates the absolute current in mA (1A would be 1000).
449 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 451
      * may not be the fastest.
452 452
      * \sa getCurrentCSReading(), getResistor(), isCurrentScalingHalfed(), getCurrent()
453 453
      */
454 454
     unsigned int getCurrentCurrent(void);
455
-    
455
+
456 456
     /*!
457 457
      * \brief checks if there is a StallGuard warning in the last status
458 458
      * \return 0 if there was no warning, -1 if there was some warning.
@@ -462,7 +462,7 @@ class TMC26XStepper {
462 462
      * \sa setStallGuardThreshold() for tuning the readout to sensible ranges.
463 463
      */
464 464
     boolean isStallGuardOverThreshold(void);
465
-    
465
+
466 466
     /*!
467 467
      * \brief Return over temperature status of the last status readout
468 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,14 +470,14 @@ class TMC26XStepper {
470 470
      * You may want to use getMotorPosition() or getCurrentStallGuardReading() to enforce an updated status readout.
471 471
      */
472 472
     char getOverTemperature(void);
473
-    
473
+
474 474
     /*!
475 475
      * \brief Is motor channel A shorted to ground detected in the last status readout.
476 476
      * \return true is yes, false if not.
477 477
      * Keep in mind that this method does not enforce a readout but uses the value of the last status readout.
478 478
      * You may want to use getMotorPosition() or getCurrentStallGuardReading() to enforce an updated status readout.
479 479
      */
480
-     
480
+
481 481
     boolean isShortToGroundA(void);
482 482
 
483 483
     /*!
@@ -502,7 +502,7 @@ class TMC26XStepper {
502 502
      * You may want to use getMotorPosition() or getCurrentStallGuardReading() to enforce an updated status readout.
503 503
      */
504 504
     boolean isOpenLoadB(void);
505
-    
505
+
506 506
     /*!
507 507
      * \brief Is chopper inactive since 2^20 clock cycles - defaults to ~0,08s
508 508
      * \return true is yes, false if not.
@@ -523,13 +523,13 @@ class TMC26XStepper {
523 523
      * \sa setStallGuardThreshold() for tuning the readout to sensible ranges.
524 524
      */
525 525
     boolean isStallGuardReached(void);
526
-    
526
+
527 527
     /*!
528 528
      *\brief enables or disables the motor driver bridges. If disabled the motor can run freely. If enabled not.
529 529
      *\param enabled a boolean value true if the motor should be enabled, false otherwise.
530 530
      */
531 531
     void setEnabled(boolean enabled);
532
-    
532
+
533 533
     /*!
534 534
      *\brief checks if the output bridges are enabled. If the bridges are not enabled the motor can run freely
535 535
      *\return true if the bridges and by that the motor driver are enabled, false if not.
@@ -541,13 +541,13 @@ class TMC26XStepper {
541 541
      * \brief Manually read out the status register
542 542
      * This function sends a byte to the motor driver in order to get the current readout. The parameter read_value
543 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 545
      * may take time to send and read one or two bits - depending on the previous readout.
546 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 547
      * \sa TMC26X_READOUT_POSITION, TMC_262_READOUT_STALLGUARD, TMC_262_READOUT_CURRENT
548 548
      */
549 549
     void readStatus(char read_value);
550
-    
550
+
551 551
     /*!
552 552
      * \brief Returns the current sense resistor value in milliohm.
553 553
      * The default value of ,15 Ohm will return 150.
@@ -555,7 +555,7 @@ class TMC26XStepper {
555 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 559
      * The result is printed via Serial
560 560
      */
561 561
     void debugLastStatus(void);
@@ -565,17 +565,17 @@ class TMC26XStepper {
565 565
      */
566 566
     int version(void);
567 567
 
568
-  private:    
568
+  private:
569 569
     unsigned int steps_left;    // The steps the motor has to do to complete the movement
570 570
     int direction;              // Direction of rotation
571 571
     unsigned long step_delay;   // Delay between steps, in ms, based on speed
572 572
     int number_of_steps;        // Total number of steps this motor can take
573 573
     unsigned int speed;         // Store the current speed in order to change the speed after changing microstepping
574 574
     unsigned int resistor;      // Current sense resitor value in milliohm
575
-        
575
+
576 576
     unsigned long last_step_time;   // Time stamp in ms of when the last step was taken
577 577
     unsigned long next_step_time;   // Time stamp in ms of when the last step was taken
578
-    
578
+
579 579
     // Driver control register copies to easily set & modify the registers
580 580
     unsigned long driver_control_register_value;
581 581
     unsigned long chopper_config_register;
@@ -584,22 +584,22 @@ class TMC26XStepper {
584 584
     unsigned long driver_configuration_register_value;
585 585
     // The driver status result
586 586
     unsigned long driver_status_result;
587
-    
587
+
588 588
     // Helper routione to get the top 10 bit of the readout
589 589
     inline int getReadoutValue();
590
-    
590
+
591 591
     // The pins for the stepper driver
592 592
     unsigned char cs_pin;
593 593
     unsigned char step_pin;
594 594
     unsigned char dir_pin;
595
-    
596
-    // Status values 
595
+
596
+    // Status values
597 597
     boolean started; // If the stepper has been started yet
598 598
     int microsteps; // The current number of micro steps
599 599
     char constant_off_time; // We need to remember this value in order to enable and disable the motor
600 600
     unsigned char cool_step_lower_threshold; //  we need to remember the threshold to enable and disable the CoolStep feature
601 601
     boolean cool_step_enabled; // We need to remember this to configure the coolstep if it si enabled
602
-    
602
+
603 603
     // SPI sender
604 604
     inline void send262(unsigned long datagram);
605 605
 };

+ 1
- 1
Marlin/src/module/stepper_indirection.cpp Visa fil

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

+ 6
- 6
Marlin/src/pins/pins_THE_BORG.h Visa fil

@@ -56,9 +56,9 @@
56 56
 #define X_MAX_PIN          _STM32_PIN(PORTE, 10)
57 57
 #define Y_MIN_PIN          _STM32_PIN(PORTE, 7)
58 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 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 62
 #define E_MAX_PIN          _STM32_PIN(PORTE, 3)
63 63
 //
64 64
 // Z Probe (when not Z_MIN_PIN)
@@ -165,15 +165,15 @@
165 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 169
 #define E_MUX1_PIN         _STM32_PIN(PORTG, 4)
170 170
 
171 171
 //
172 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 179
 #define SDSS               _STM32_PIN(PORTA, 8)
@@ -191,7 +191,7 @@
191 191
 #define MAX7219_LOAD_PIN   _STM32_PIN(PORTD, 1)     //EXP1-5
192 192
 
193 193
 //#define NEOPIXEL_PIN    4
194
-  
194
+
195 195
 //
196 196
 // LCD / Controller
197 197
 //

+ 1
- 1
Marlin/src/sd/cardreader.cpp Visa fil

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

+ 1
- 1
Marlin/src/sd/cardreader.h Visa fil

@@ -174,7 +174,7 @@ private:
174 174
   LsAction lsAction; //stored for recursion.
175 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 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 178
     #if NUM_SERIAL > 1
179 179
       , const int8_t port = -1
180 180
     #endif

Laddar…
Avbryt
Spara