Browse Source

Spacing, defined(), #include tweaks

Scott Lahteine 4 years ago
parent
commit
d25231aea8

+ 1
- 1
Marlin/src/HAL/HAL_AVR/fast_pwm.cpp View File

@@ -65,7 +65,7 @@ Timer get_pwm_timer(const pin_t pin) {
65 65
             /*n, q*/      2, 0
66 66
           };
67 67
         }
68
-      #elif defined TCCR2A
68
+      #elif defined(TCCR2A)
69 69
         #if ENABLED(USE_OCR2A_AS_TOP)
70 70
           case TIMER2A:   break; // protect TIMER2A
71 71
           case TIMER2B: {

+ 2
- 1
Marlin/src/HAL/HAL_ESP32/HAL_spi_ESP32.cpp View File

@@ -27,9 +27,10 @@
27 27
 #include "../shared/HAL_SPI.h"
28 28
 #include <pins_arduino.h>
29 29
 #include "spi_pins.h"
30
-#include "../../core/macros.h"
31 30
 #include <SPI.h>
32 31
 
32
+#include "../../core/macros.h"
33
+
33 34
 // ------------------------
34 35
 // Public Variables
35 36
 // ------------------------

+ 2
- 1
Marlin/src/HAL/HAL_ESP32/web.cpp View File

@@ -27,11 +27,12 @@
27 27
 #if ENABLED(WEBSUPPORT)
28 28
 
29 29
 #include <SPIFFS.h>
30
+
30 31
 #include "wifi.h"
31 32
 
32 33
 AsyncEventSource events("/events"); // event source (Server-Sent events)
33 34
 
34
-void onNotFound(AsyncWebServerRequest *request){
35
+void onNotFound(AsyncWebServerRequest *request) {
35 36
   request->send(404);
36 37
 }
37 38
 

+ 2
- 2
Marlin/src/HAL/HAL_LINUX/include/serial.h View File

@@ -108,11 +108,11 @@ public:
108 108
 
109 109
   void flush() { receive_buffer.clear(); }
110 110
 
111
-  uint8_t availableForWrite(void){
111
+  uint8_t availableForWrite(void) {
112 112
     return transmit_buffer.free() > 255 ? 255 : (uint8_t)transmit_buffer.free();
113 113
   }
114 114
 
115
-  void flushTX(void){
115
+  void flushTX(void) {
116 116
     if (host_connected)
117 117
       while (transmit_buffer.available()) { /* nada */ }
118 118
   }

+ 7
- 7
Marlin/src/HAL/HAL_STM32/pinsDebug_STM32duino.h View File

@@ -145,19 +145,19 @@ uint8_t get_pin_mode(const pin_t Ard_num) {
145 145
     case 'D' : mode_all = GPIOD->MODER; break;
146 146
     #ifdef PE_0
147 147
       case 'E' : mode_all = GPIOE->MODER; break;
148
-    #elif defined (PF_0)
148
+    #elif defined(PF_0)
149 149
       case 'F' : mode_all = GPIOF->MODER; break;
150
-    #elif defined (PG_0)
150
+    #elif defined(PG_0)
151 151
       case 'G' : mode_all = GPIOG->MODER; break;
152
-    #elif defined (PH_0)
152
+    #elif defined(PH_0)
153 153
       case 'H' : mode_all = GPIOH->MODER; break;
154
-    #elif defined (PI_0)
154
+    #elif defined(PI_0)
155 155
       case 'I' : mode_all = GPIOI->MODER; break;
156
-    #elif defined (PJ_0)
156
+    #elif defined(PJ_0)
157 157
       case 'J' : mode_all = GPIOJ->MODER; break;
158
-    #elif defined (PK_0)
158
+    #elif defined(PK_0)
159 159
       case 'K' : mode_all = GPIOK->MODER; break;
160
-    #elif defined (PL_0)
160
+    #elif defined(PL_0)
161 161
       case 'L' : mode_all = GPIOL->MODER; break;
162 162
     #endif
163 163
   }

+ 4
- 2
Marlin/src/HAL/HAL_STM32_F4_F7/STM32F7/TMC2660.cpp View File

@@ -313,10 +313,12 @@ void TMC26XStepper::setCurrent(uint16_t current) {
313 313
     current_scaling = (byte)((resistor_value * mASetting * 32.0 / (0.165 * sq(1000.0))) - 0.5); //theoretically - 1.0 for better rounding it is 0.5
314 314
     #ifdef TMC_DEBUG0 // crashes
315 315
         SERIAL_ECHOPAIR("\nCS (Vsense=1): ",current_scaling);
316
-      } else {
317
-        SERIAL_ECHOPAIR("\nCS: ", current_scaling);
318 316
     #endif
319 317
   }
318
+  #ifdef TMC_DEBUG0 // crashes
319
+    else
320
+      SERIAL_ECHOPAIR("\nCS: ", current_scaling);
321
+  #endif
320 322
 
321 323
   // do some sanity checks
322 324
   NOMORE(current_scaling, 31);

+ 1
- 1
Marlin/src/HAL/shared/servo.h View File

@@ -84,7 +84,7 @@
84 84
 #else
85 85
   #include <stdint.h>
86 86
 
87
-  #if defined(__AVR__) || defined(ARDUINO_ARCH_SAM) || defined (__SAMD51__)
87
+  #if defined(__AVR__) || defined(ARDUINO_ARCH_SAM) || defined(__SAMD51__)
88 88
     // we're good to go
89 89
   #else
90 90
     #error "This library only supports boards with an AVR, SAM3X or SAMD51 processor."

+ 5
- 4
Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/extended/screen_types.h View File

@@ -170,7 +170,7 @@ class UncachedScreen {
170 170
 template<uint8_t DL_SLOT,uint32_t DL_SIZE = 0>
171 171
 class CachedScreen {
172 172
   protected:
173
-    static bool storeBackground(){
173
+    static bool storeBackground() {
174 174
       DLCache dlcache(DL_SLOT);
175 175
       if (!dlcache.store(DL_SIZE)) {
176 176
         SERIAL_ECHO_START();
@@ -180,7 +180,7 @@ class CachedScreen {
180 180
       return true;
181 181
     }
182 182
 
183
-    static void repaintBackground(){
183
+    static void repaintBackground() {
184 184
       using namespace FTDI;
185 185
       DLCache dlcache(DL_SLOT);
186 186
       CLCD::CommandFifo cmd;
@@ -192,7 +192,7 @@ class CachedScreen {
192 192
     }
193 193
 
194 194
   public:
195
-    static void onRefresh(){
195
+    static void onRefresh() {
196 196
       using namespace FTDI;
197 197
       DLCache dlcache(DL_SLOT);
198 198
       CLCD::CommandFifo cmd;
@@ -201,7 +201,8 @@ class CachedScreen {
201 201
 
202 202
       if (dlcache.has_data()) {
203 203
         dlcache.append();
204
-      } else {
204
+      }
205
+      else {
205 206
         current_screen.onRedraw(BACKGROUND);
206 207
         dlcache.store(DL_SIZE);
207 208
       }

+ 3
- 3
buildroot/share/PlatformIO/variants/BIGTREE_GENERIC_STM32F407_5X/variant.h View File

@@ -47,15 +47,15 @@ extern const PinName digitalPin[];
47 47
   #define STM32F4X_PIN_NUM  64  //64 pins mcu, 51 gpio
48 48
   #define STM32F4X_GPIO_NUM 51
49 49
   #define STM32F4X_ADC_NUM  16
50
-#elif defined STM32F407_5VX
50
+#elif defined(STM32F407_5VX)
51 51
   #define STM32F4X_PIN_NUM  100  //100 pins mcu, 82 gpio
52 52
   #define STM32F4X_GPIO_NUM 82
53 53
   #define STM32F4X_ADC_NUM  16
54
-#elif defined STM32F407_5ZX
54
+#elif defined(STM32F407_5ZX)
55 55
   #define STM32F4X_PIN_NUM  144  //144 pins mcu, 114 gpio
56 56
   #define STM32F4X_GPIO_NUM 114
57 57
   #define STM32F4X_ADC_NUM  24
58
-#elif defined STM32F407IX
58
+#elif defined(STM32F407IX)
59 59
   #define STM32F4X_PIN_NUM  176  //176 pins mcu, 140 gpio
60 60
   #define STM32F4X_GPIO_NUM 140
61 61
   #define STM32F4X_ADC_NUM  24

Loading…
Cancel
Save