Browse Source

General cleanup

Scott Lahteine 4 years ago
parent
commit
9b78138600

+ 4
- 4
Marlin/src/HAL/LPC1768/HAL_SPI.cpp View File

370
   switch (_currentSetting->dataMode) {
370
   switch (_currentSetting->dataMode) {
371
     case SPI_MODE0:
371
     case SPI_MODE0:
372
       HW_SPI_init.CPHA = SSP_CPHA_FIRST;
372
       HW_SPI_init.CPHA = SSP_CPHA_FIRST;
373
-	    HW_SPI_init.CPOL = SSP_CPOL_HI;
373
+      HW_SPI_init.CPOL = SSP_CPOL_HI;
374
       break;
374
       break;
375
     case SPI_MODE1:
375
     case SPI_MODE1:
376
       HW_SPI_init.CPHA = SSP_CPHA_SECOND;
376
       HW_SPI_init.CPHA = SSP_CPHA_SECOND;
377
-	    HW_SPI_init.CPOL = SSP_CPOL_HI;
377
+      HW_SPI_init.CPOL = SSP_CPOL_HI;
378
       break;
378
       break;
379
     case SPI_MODE2:
379
     case SPI_MODE2:
380
       HW_SPI_init.CPHA = SSP_CPHA_FIRST;
380
       HW_SPI_init.CPHA = SSP_CPHA_FIRST;
381
-	    HW_SPI_init.CPOL = SSP_CPOL_LO;
381
+      HW_SPI_init.CPOL = SSP_CPOL_LO;
382
       break;
382
       break;
383
     case SPI_MODE3:
383
     case SPI_MODE3:
384
       HW_SPI_init.CPHA = SSP_CPHA_SECOND;
384
       HW_SPI_init.CPHA = SSP_CPHA_SECOND;
385
-	    HW_SPI_init.CPOL = SSP_CPOL_LO;
385
+      HW_SPI_init.CPOL = SSP_CPOL_LO;
386
       break;
386
       break;
387
     default:
387
     default:
388
       break;
388
       break;

+ 1
- 1
Marlin/src/HAL/STM32F1/sdio.cpp View File

108
     SDIO_CLEAR_FLAG(SDIO_ICR_CMD_FLAGS | SDIO_ICR_DATA_FLAGS);
108
     SDIO_CLEAR_FLAG(SDIO_ICR_CMD_FLAGS | SDIO_ICR_DATA_FLAGS);
109
     dma_disable(SDIO_DMA_DEV, SDIO_DMA_CHANNEL);
109
     dma_disable(SDIO_DMA_DEV, SDIO_DMA_CHANNEL);
110
     return false;
110
     return false;
111
-	}
111
+  }
112
 
112
 
113
   //Wait for DMA transaction to complete
113
   //Wait for DMA transaction to complete
114
   while ((DMA2_BASE->ISR & (DMA_ISR_TEIF4|DMA_ISR_TCIF4)) == 0 ) { /* wait */ }
114
   while ((DMA2_BASE->ISR & (DMA_ISR_TEIF4|DMA_ISR_TCIF4)) == 0 ) { /* wait */ }

+ 1
- 3
Marlin/src/gcode/motion/G2_G3.cpp View File

115
   );
115
   );
116
   // Divide total travel by nominal segment length
116
   // Divide total travel by nominal segment length
117
   uint16_t segments = FLOOR(mm_of_travel / seg_length);
117
   uint16_t segments = FLOOR(mm_of_travel / seg_length);
118
-  if (segments < min_segments) {            // Too few segments?
119
-    segments = min_segments;                // More segments
120
-  }
118
+  NOLESS(segments, min_segments);         // At least some segments
121
   seg_length = mm_of_travel / segments;
119
   seg_length = mm_of_travel / segments;
122
 
120
 
123
   /**
121
   /**

+ 5
- 5
Marlin/src/lcd/dwin/e3v2/rotary_encoder.cpp View File

127
 
127
 
128
       // if must encoder rati multiplier
128
       // if must encoder rati multiplier
129
       if (EncoderRate.encoderRateEnabled) {
129
       if (EncoderRate.encoderRateEnabled) {
130
-        const float abs_diff = ABS(temp_diff);
131
-        const float encoderMovementSteps = abs_diff / (ENCODER_PULSES_PER_STEP);
130
+        const float abs_diff = ABS(temp_diff),
131
+                    encoderMovementSteps = abs_diff / (ENCODER_PULSES_PER_STEP);
132
         if (EncoderRate.lastEncoderTime) {
132
         if (EncoderRate.lastEncoderTime) {
133
           // Note that the rate is always calculated between two passes through the
133
           // Note that the rate is always calculated between two passes through the
134
           // loop and that the abs of the temp_diff value is tracked.
134
           // loop and that the abs of the temp_diff value is tracked.
135
           const float encoderStepRate = encoderMovementSteps / float(ms - EncoderRate.lastEncoderTime) * 1000;
135
           const float encoderStepRate = encoderMovementSteps / float(ms - EncoderRate.lastEncoderTime) * 1000;
136
-          if (encoderStepRate >= ENCODER_100X_STEPS_PER_SEC)  encoderMultiplier = 100;
137
-          else if (encoderStepRate >= ENCODER_10X_STEPS_PER_SEC) encoderMultiplier = 10;
138
-          else if (encoderStepRate >= ENCODER_5X_STEPS_PER_SEC) encoderMultiplier = 5;
136
+               if (encoderStepRate >= ENCODER_100X_STEPS_PER_SEC) encoderMultiplier = 100;
137
+          else if (encoderStepRate >= ENCODER_10X_STEPS_PER_SEC)  encoderMultiplier = 10;
138
+          else if (encoderStepRate >= ENCODER_5X_STEPS_PER_SEC)   encoderMultiplier = 5;
139
         }
139
         }
140
         EncoderRate.lastEncoderTime = ms;
140
         EncoderRate.lastEncoderTime = ms;
141
       }
141
       }

+ 3
- 3
Marlin/src/lcd/dwin/e3v2/rotary_encoder.h View File

55
 
55
 
56
 typedef enum {
56
 typedef enum {
57
   ENCODER_DIFF_NO    = 0,
57
   ENCODER_DIFF_NO    = 0,
58
-	ENCODER_DIFF_CW    = 1,
58
+  ENCODER_DIFF_CW    = 1,
59
   ENCODER_DIFF_CCW   = 2,
59
   ENCODER_DIFF_CCW   = 2,
60
-	ENCODER_DIFF_ENTER = 3
60
+  ENCODER_DIFF_ENTER = 3
61
 } ENCODER_DiffState;
61
 } ENCODER_DiffState;
62
 
62
 
63
 /*编码器初始化 PB12:Encoder_A PB13:Encoder_B PB14:Encoder_C*/
63
 /*编码器初始化 PB12:Encoder_A PB13:Encoder_B PB14:Encoder_C*/
87
   /*状态LED初始化*/
87
   /*状态LED初始化*/
88
   void STATE_LED_Configuration(void);
88
   void STATE_LED_Configuration(void);
89
 
89
 
90
-	/*LED灯操作*/
90
+  /*LED灯操作*/
91
   void LED_Action(void);
91
   void LED_Action(void);
92
 
92
 
93
   /*LED初始化*/
93
   /*LED初始化*/

+ 4
- 4
Marlin/src/pins/stm32f1/pins_CREALITY_V4.h View File

161
 
161
 
162
 #if ENABLED(RET6_12864_LCD)
162
 #if ENABLED(RET6_12864_LCD)
163
 
163
 
164
-  /* RET6 12864 LCD */
164
+  // RET6 12864 LCD
165
   #define LCD_PINS_RS                       PB12
165
   #define LCD_PINS_RS                       PB12
166
   #define LCD_PINS_ENABLE                   PB15
166
   #define LCD_PINS_ENABLE                   PB15
167
   #define LCD_PINS_D4                       PB13
167
   #define LCD_PINS_D4                       PB13
174
 
174
 
175
 #elif ENABLED(VET6_12864_LCD)
175
 #elif ENABLED(VET6_12864_LCD)
176
 
176
 
177
-  /* VET6 12864 LCD */
177
+  // VET6 12864 LCD
178
   #define LCD_PINS_RS                       PA4
178
   #define LCD_PINS_RS                       PA4
179
   #define LCD_PINS_ENABLE                   PA7
179
   #define LCD_PINS_ENABLE                   PA7
180
   #define LCD_PINS_D4                       PA5
180
   #define LCD_PINS_D4                       PA5
185
 
185
 
186
 #elif ENABLED(DWIN_CREALITY_LCD)
186
 #elif ENABLED(DWIN_CREALITY_LCD)
187
 
187
 
188
-  /* RET6 DWIN ENCODER LCD */
188
+  // RET6 DWIN ENCODER LCD
189
   #define BTN_ENC                           PB14
189
   #define BTN_ENC                           PB14
190
   #define BTN_EN1                           PB15
190
   #define BTN_EN1                           PB15
191
   #define BTN_EN2                           PB12
191
   #define BTN_EN2                           PB12
198
 
198
 
199
 #elif ENABLED(DWIN_VET6_CREALITY_LCD)
199
 #elif ENABLED(DWIN_VET6_CREALITY_LCD)
200
 
200
 
201
-  /* VET6 DWIN ENCODER LCD */
201
+  // VET6 DWIN ENCODER LCD
202
   #define BTN_ENC                           PA6
202
   #define BTN_ENC                           PA6
203
   #define BTN_EN1                           PA7
203
   #define BTN_EN1                           PA7
204
   #define BTN_EN2                           PA4
204
   #define BTN_EN2                           PA4

Loading…
Cancel
Save