Browse Source

Spacing, defined(), #include tweaks

Scott Lahteine 5 years ago
parent
commit
d25231aea8

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

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

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

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

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

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

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

108
 
108
 
109
   void flush() { receive_buffer.clear(); }
109
   void flush() { receive_buffer.clear(); }
110
 
110
 
111
-  uint8_t availableForWrite(void){
111
+  uint8_t availableForWrite(void) {
112
     return transmit_buffer.free() > 255 ? 255 : (uint8_t)transmit_buffer.free();
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
     if (host_connected)
116
     if (host_connected)
117
       while (transmit_buffer.available()) { /* nada */ }
117
       while (transmit_buffer.available()) { /* nada */ }
118
   }
118
   }

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

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

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

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
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
     #ifdef TMC_DEBUG0 // crashes
314
     #ifdef TMC_DEBUG0 // crashes
315
         SERIAL_ECHOPAIR("\nCS (Vsense=1): ",current_scaling);
315
         SERIAL_ECHOPAIR("\nCS (Vsense=1): ",current_scaling);
316
-      } else {
317
-        SERIAL_ECHOPAIR("\nCS: ", current_scaling);
318
     #endif
316
     #endif
319
   }
317
   }
318
+  #ifdef TMC_DEBUG0 // crashes
319
+    else
320
+      SERIAL_ECHOPAIR("\nCS: ", current_scaling);
321
+  #endif
320
 
322
 
321
   // do some sanity checks
323
   // do some sanity checks
322
   NOMORE(current_scaling, 31);
324
   NOMORE(current_scaling, 31);

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

84
 #else
84
 #else
85
   #include <stdint.h>
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
     // we're good to go
88
     // we're good to go
89
   #else
89
   #else
90
     #error "This library only supports boards with an AVR, SAM3X or SAMD51 processor."
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
 template<uint8_t DL_SLOT,uint32_t DL_SIZE = 0>
170
 template<uint8_t DL_SLOT,uint32_t DL_SIZE = 0>
171
 class CachedScreen {
171
 class CachedScreen {
172
   protected:
172
   protected:
173
-    static bool storeBackground(){
173
+    static bool storeBackground() {
174
       DLCache dlcache(DL_SLOT);
174
       DLCache dlcache(DL_SLOT);
175
       if (!dlcache.store(DL_SIZE)) {
175
       if (!dlcache.store(DL_SIZE)) {
176
         SERIAL_ECHO_START();
176
         SERIAL_ECHO_START();
180
       return true;
180
       return true;
181
     }
181
     }
182
 
182
 
183
-    static void repaintBackground(){
183
+    static void repaintBackground() {
184
       using namespace FTDI;
184
       using namespace FTDI;
185
       DLCache dlcache(DL_SLOT);
185
       DLCache dlcache(DL_SLOT);
186
       CLCD::CommandFifo cmd;
186
       CLCD::CommandFifo cmd;
192
     }
192
     }
193
 
193
 
194
   public:
194
   public:
195
-    static void onRefresh(){
195
+    static void onRefresh() {
196
       using namespace FTDI;
196
       using namespace FTDI;
197
       DLCache dlcache(DL_SLOT);
197
       DLCache dlcache(DL_SLOT);
198
       CLCD::CommandFifo cmd;
198
       CLCD::CommandFifo cmd;
201
 
201
 
202
       if (dlcache.has_data()) {
202
       if (dlcache.has_data()) {
203
         dlcache.append();
203
         dlcache.append();
204
-      } else {
204
+      }
205
+      else {
205
         current_screen.onRedraw(BACKGROUND);
206
         current_screen.onRedraw(BACKGROUND);
206
         dlcache.store(DL_SIZE);
207
         dlcache.store(DL_SIZE);
207
       }
208
       }

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

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

Loading…
Cancel
Save