Browse Source

Use C++ language supported 'nullptr' (#13944)

Scott Lahteine 5 years ago
parent
commit
ad4ffa1d2f
No account linked to committer's email address
70 changed files with 670 additions and 668 deletions
  1. 22
    20
      Marlin/src/HAL/HAL_AVR/endstop_interrupts.h
  2. 12
    12
      Marlin/src/HAL/HAL_AVR/fast_pwm.cpp
  3. 146
    146
      Marlin/src/HAL/HAL_AVR/fastio_1280.h
  4. 94
    94
      Marlin/src/HAL/HAL_AVR/fastio_1281.h
  5. 38
    38
      Marlin/src/HAL/HAL_AVR/fastio_168.h
  6. 72
    72
      Marlin/src/HAL/HAL_AVR/fastio_644.h
  7. 106
    106
      Marlin/src/HAL/HAL_AVR/fastio_AT90USB.h
  8. 1
    1
      Marlin/src/HAL/HAL_AVR/fastio_AVR.h
  9. 1
    1
      Marlin/src/HAL/HAL_DUE/G2_pins.h
  10. 1
    1
      Marlin/src/HAL/HAL_DUE/InterruptVectors_Due.cpp
  11. 3
    3
      Marlin/src/HAL/HAL_ESP32/HAL_timers_ESP32.cpp
  12. 6
    6
      Marlin/src/HAL/HAL_ESP32/i2s.cpp
  13. 4
    4
      Marlin/src/HAL/HAL_LINUX/hardware/Timer.cpp
  14. 2
    2
      Marlin/src/HAL/HAL_LINUX/persistent_store_impl.cpp
  15. 1
    1
      Marlin/src/HAL/HAL_STM32F1/HAL.cpp
  16. 1
    1
      Marlin/src/HAL/HAL_STM32F1/HAL.h
  17. 1
    1
      Marlin/src/HAL/HAL_STM32F1/fastio_STM32F1.h
  18. 1
    1
      Marlin/src/HAL/HAL_STM32F1/u8g_com_stm32duino_fsmc.cpp
  19. 1
    1
      Marlin/src/HAL/HAL_STM32F4/HAL_spi_STM32F4.cpp
  20. 1
    1
      Marlin/src/HAL/shared/backtrace/unwarm.cpp
  21. 3
    3
      Marlin/src/HAL/shared/backtrace/unwarmbytab.cpp
  22. 1
    1
      Marlin/src/Marlin.cpp
  23. 1
    1
      Marlin/src/Marlin.h
  24. 1
    1
      Marlin/src/core/serial.cpp
  25. 2
    2
      Marlin/src/core/serial.h
  26. 5
    5
      Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp
  27. 1
    1
      Marlin/src/feature/host_actions.cpp
  28. 2
    2
      Marlin/src/feature/host_actions.h
  29. 1
    1
      Marlin/src/feature/twibus.cpp
  30. 1
    1
      Marlin/src/feature/twibus.h
  31. 1
    1
      Marlin/src/gcode/bedlevel/ubl/M421.cpp
  32. 1
    1
      Marlin/src/gcode/calibrate/G425.cpp
  33. 2
    2
      Marlin/src/gcode/calibrate/M100.cpp
  34. 4
    4
      Marlin/src/gcode/parser.cpp
  35. 7
    7
      Marlin/src/gcode/parser.h
  36. 10
    10
      Marlin/src/gcode/queue.cpp
  37. 3
    3
      Marlin/src/inc/SanityCheck.h
  38. 2
    2
      Marlin/src/lcd/HD44780/lcdprint_hd44780.cpp
  39. 3
    3
      Marlin/src/lcd/HD44780/ultralcd_HD44780.cpp
  40. 6
    6
      Marlin/src/lcd/dogm/u8g_fontutf8.cpp
  41. 3
    3
      Marlin/src/lcd/dogm/ultralcd_DOGM.cpp
  42. 1
    1
      Marlin/src/lcd/menu/game/invaders.cpp
  43. 3
    3
      Marlin/src/lcd/menu/menu.cpp
  44. 6
    6
      Marlin/src/lcd/menu/menu.h
  45. 1
    1
      Marlin/src/lcd/menu/menu_advanced.cpp
  46. 1
    1
      Marlin/src/lcd/menu/menu_bed_corners.cpp
  47. 2
    2
      Marlin/src/lcd/menu/menu_filament.cpp
  48. 5
    5
      Marlin/src/lcd/menu/menu_main.cpp
  49. 1
    1
      Marlin/src/lcd/menu/menu_mixer.cpp
  50. 1
    1
      Marlin/src/lcd/ultralcd.cpp
  51. 2
    2
      Marlin/src/lcd/ultralcd.h
  52. 1
    1
      Marlin/src/libs/L6470/L6470_Marlin.cpp
  53. 1
    1
      Marlin/src/libs/vector_3.cpp
  54. 2
    2
      Marlin/src/module/configuration_store.cpp
  55. 1
    1
      Marlin/src/module/configuration_store.h
  56. 1
    1
      Marlin/src/module/endstops.cpp
  57. 3
    3
      Marlin/src/module/planner.cpp
  58. 4
    4
      Marlin/src/module/planner.h
  59. 3
    3
      Marlin/src/module/stepper.cpp
  60. 1
    1
      Marlin/src/module/temperature.cpp
  61. 6
    6
      Marlin/src/module/thermistor/thermistors.h
  62. 2
    2
      Marlin/src/sd/SdBaseFile.cpp
  63. 15
    15
      Marlin/src/sd/cardreader.cpp
  64. 2
    2
      Marlin/src/sd/cardreader.h
  65. 15
    15
      Marlin/src/sd/usb_flashdrive/lib/Usb.cpp
  66. 2
    2
      Marlin/src/sd/usb_flashdrive/lib/UsbCore.h
  67. 1
    1
      Marlin/src/sd/usb_flashdrive/lib/address.h
  68. 8
    8
      Marlin/src/sd/usb_flashdrive/lib/masstorage.cpp
  69. 4
    4
      Marlin/src/sd/usb_flashdrive/lib/parsetools.h
  70. 1
    1
      buildroot/share/pin_interrupt_test/pin_interrupt_test.ino

+ 22
- 20
Marlin/src/HAL/HAL_AVR/endstop_interrupts.h View File

@@ -54,7 +54,7 @@ void endstop_ISR(void) { endstops.update(); }
54 54
   #undef  digitalPinToPCICR
55 55
   #define digitalPinToPCICR(p)    ( WITHIN(p, 10, 15) || \
56 56
                                     WITHIN(p, 50, 53) || \
57
-                                    WITHIN(p, 62, 69) ? &PCICR : (uint8_t*)0 )
57
+                                    WITHIN(p, 62, 69) ? &PCICR : nullptr )
58 58
   #undef  digitalPinToPCICRbit
59 59
   #define digitalPinToPCICRbit(p) ( WITHIN(p, 10, 13) || WITHIN(p, 50, 53) ? 0 : \
60 60
                                     WITHIN(p, 14, 15) ? 1 : \
@@ -64,7 +64,7 @@ void endstop_ISR(void) { endstops.update(); }
64 64
   #define digitalPinToPCMSK(p)    ( WITHIN(p, 10, 13) || WITHIN(p, 50, 53) ? &PCMSK0 : \
65 65
                                     WITHIN(p, 14, 15) ? &PCMSK1 : \
66 66
                                     WITHIN(p, 62, 69) ? &PCMSK2 : \
67
-                                    (uint8_t *)0 )
67
+                                    nullptr )
68 68
   #undef  digitalPinToPCMSKbit
69 69
   #define digitalPinToPCMSKbit(p) ( WITHIN(p, 10, 13) ? ((p) - 6) : \
70 70
                                     (p) == 14 || (p) == 51 ? 2 : \
@@ -78,9 +78,11 @@ void endstop_ISR(void) { endstops.update(); }
78 78
 
79 79
 // Install Pin change interrupt for a pin. Can be called multiple times.
80 80
 void pciSetup(const int8_t pin) {
81
-  SBI(*digitalPinToPCMSK(pin), digitalPinToPCMSKbit(pin));  // enable pin
82
-  SBI(PCIFR, digitalPinToPCICRbit(pin)); // clear any outstanding interrupt
83
-  SBI(PCICR, digitalPinToPCICRbit(pin)); // enable interrupt for the group
81
+  if (digitalPinToPCMSK(pin) != nullptr) {
82
+    SBI(*digitalPinToPCMSK(pin), digitalPinToPCMSKbit(pin));  // enable pin
83
+    SBI(PCIFR, digitalPinToPCICRbit(pin)); // clear any outstanding interrupt
84
+    SBI(PCICR, digitalPinToPCICRbit(pin)); // enable interrupt for the group
85
+  }
84 86
 }
85 87
 
86 88
 // Handlers for pin change interrupts
@@ -107,7 +109,7 @@ void setup_endstop_interrupts( void ) {
107 109
       attachInterrupt(digitalPinToInterrupt(X_MAX_PIN), endstop_ISR, CHANGE); // assign it
108 110
     #else
109 111
       // Not all used endstop/probe -pins can raise interrupts. Please deactivate ENDSTOP_INTERRUPTS or change the pin configuration!
110
-      static_assert(digitalPinToPCICR(X_MAX_PIN) != NULL, "X_MAX_PIN is not interrupt-capable"); // if pin has no pin change interrupt - error
112
+      static_assert(digitalPinToPCICR(X_MAX_PIN), "X_MAX_PIN is not interrupt-capable"); // if pin has no pin change interrupt - error
111 113
       pciSetup(X_MAX_PIN);                                                            // assign it
112 114
     #endif
113 115
   #endif
@@ -117,7 +119,7 @@ void setup_endstop_interrupts( void ) {
117 119
       attachInterrupt(digitalPinToInterrupt(X_MIN_PIN), endstop_ISR, CHANGE);
118 120
     #else
119 121
       // Not all used endstop/probe -pins can raise interrupts. Please deactivate ENDSTOP_INTERRUPTS or change the pin configuration!
120
-      static_assert(digitalPinToPCICR(X_MIN_PIN) != NULL, "X_MIN_PIN is not interrupt-capable");
122
+      static_assert(digitalPinToPCICR(X_MIN_PIN), "X_MIN_PIN is not interrupt-capable");
121 123
       pciSetup(X_MIN_PIN);
122 124
     #endif
123 125
   #endif
@@ -127,7 +129,7 @@ void setup_endstop_interrupts( void ) {
127 129
       attachInterrupt(digitalPinToInterrupt(Y_MAX_PIN), endstop_ISR, CHANGE);
128 130
     #else
129 131
       // Not all used endstop/probe -pins can raise interrupts. Please deactivate ENDSTOP_INTERRUPTS or change the pin configuration!
130
-      static_assert(digitalPinToPCICR(Y_MAX_PIN) != NULL, "Y_MAX_PIN is not interrupt-capable");
132
+      static_assert(digitalPinToPCICR(Y_MAX_PIN), "Y_MAX_PIN is not interrupt-capable");
131 133
       pciSetup(Y_MAX_PIN);
132 134
     #endif
133 135
   #endif
@@ -137,7 +139,7 @@ void setup_endstop_interrupts( void ) {
137 139
       attachInterrupt(digitalPinToInterrupt(Y_MIN_PIN), endstop_ISR, CHANGE);
138 140
     #else
139 141
       // Not all used endstop/probe -pins can raise interrupts. Please deactivate ENDSTOP_INTERRUPTS or change the pin configuration!
140
-      static_assert(digitalPinToPCICR(Y_MIN_PIN) != NULL, "Y_MIN_PIN is not interrupt-capable");
142
+      static_assert(digitalPinToPCICR(Y_MIN_PIN), "Y_MIN_PIN is not interrupt-capable");
141 143
       pciSetup(Y_MIN_PIN);
142 144
     #endif
143 145
   #endif
@@ -147,7 +149,7 @@ void setup_endstop_interrupts( void ) {
147 149
       attachInterrupt(digitalPinToInterrupt(Z_MAX_PIN), endstop_ISR, CHANGE);
148 150
     #else
149 151
       // Not all used endstop/probe -pins can raise interrupts. Please deactivate ENDSTOP_INTERRUPTS or change the pin configuration!
150
-      static_assert(digitalPinToPCICR(Z_MAX_PIN) != NULL, "Z_MAX_PIN is not interrupt-capable");
152
+      static_assert(digitalPinToPCICR(Z_MAX_PIN), "Z_MAX_PIN is not interrupt-capable");
151 153
       pciSetup(Z_MAX_PIN);
152 154
     #endif
153 155
   #endif
@@ -157,7 +159,7 @@ void setup_endstop_interrupts( void ) {
157 159
       attachInterrupt(digitalPinToInterrupt(Z_MIN_PIN), endstop_ISR, CHANGE);
158 160
     #else
159 161
       // Not all used endstop/probe -pins can raise interrupts. Please deactivate ENDSTOP_INTERRUPTS or change the pin configuration!
160
-      static_assert(digitalPinToPCICR(Z_MIN_PIN) != NULL, "Z_MIN_PIN is not interrupt-capable");
162
+      static_assert(digitalPinToPCICR(Z_MIN_PIN), "Z_MIN_PIN is not interrupt-capable");
161 163
       pciSetup(Z_MIN_PIN);
162 164
     #endif
163 165
   #endif
@@ -167,7 +169,7 @@ void setup_endstop_interrupts( void ) {
167 169
       attachInterrupt(digitalPinToInterrupt(X2_MAX_PIN), endstop_ISR, CHANGE);
168 170
     #else
169 171
       // Not all used endstop/probe -pins can raise interrupts. Please deactivate ENDSTOP_INTERRUPTS or change the pin configuration!
170
-      static_assert(digitalPinToPCICR(X2_MAX_PIN) != NULL, "X2_MAX_PIN is not interrupt-capable");
172
+      static_assert(digitalPinToPCICR(X2_MAX_PIN), "X2_MAX_PIN is not interrupt-capable");
171 173
       pciSetup(X2_MAX_PIN);
172 174
     #endif
173 175
   #endif
@@ -177,7 +179,7 @@ void setup_endstop_interrupts( void ) {
177 179
       attachInterrupt(digitalPinToInterrupt(X2_MIN_PIN), endstop_ISR, CHANGE);
178 180
     #else
179 181
       // Not all used endstop/probe -pins can raise interrupts. Please deactivate ENDSTOP_INTERRUPTS or change the pin configuration!
180
-      static_assert(digitalPinToPCICR(X2_MIN_PIN) != NULL, "X2_MIN_PIN is not interrupt-capable");
182
+      static_assert(digitalPinToPCICR(X2_MIN_PIN), "X2_MIN_PIN is not interrupt-capable");
181 183
       pciSetup(X2_MIN_PIN);
182 184
     #endif
183 185
   #endif
@@ -187,7 +189,7 @@ void setup_endstop_interrupts( void ) {
187 189
       attachInterrupt(digitalPinToInterrupt(Y2_MAX_PIN), endstop_ISR, CHANGE);
188 190
     #else
189 191
       // Not all used endstop/probe -pins can raise interrupts. Please deactivate ENDSTOP_INTERRUPTS or change the pin configuration!
190
-      static_assert(digitalPinToPCICR(Y2_MAX_PIN) != NULL, "Y2_MAX_PIN is not interrupt-capable");
192
+      static_assert(digitalPinToPCICR(Y2_MAX_PIN), "Y2_MAX_PIN is not interrupt-capable");
191 193
       pciSetup(Y2_MAX_PIN);
192 194
     #endif
193 195
   #endif
@@ -197,7 +199,7 @@ void setup_endstop_interrupts( void ) {
197 199
       attachInterrupt(digitalPinToInterrupt(Y2_MIN_PIN), endstop_ISR, CHANGE);
198 200
     #else
199 201
       // Not all used endstop/probe -pins can raise interrupts. Please deactivate ENDSTOP_INTERRUPTS or change the pin configuration!
200
-      static_assert(digitalPinToPCICR(Y2_MIN_PIN) != NULL, "Y2_MIN_PIN is not interrupt-capable");
202
+      static_assert(digitalPinToPCICR(Y2_MIN_PIN), "Y2_MIN_PIN is not interrupt-capable");
201 203
       pciSetup(Y2_MIN_PIN);
202 204
     #endif
203 205
   #endif
@@ -207,7 +209,7 @@ void setup_endstop_interrupts( void ) {
207 209
       attachInterrupt(digitalPinToInterrupt(Z2_MAX_PIN), endstop_ISR, CHANGE);
208 210
     #else
209 211
       // Not all used endstop/probe -pins can raise interrupts. Please deactivate ENDSTOP_INTERRUPTS or change the pin configuration!
210
-      static_assert(digitalPinToPCICR(Z2_MAX_PIN) != NULL, "Z2_MAX_PIN is not interrupt-capable");
212
+      static_assert(digitalPinToPCICR(Z2_MAX_PIN), "Z2_MAX_PIN is not interrupt-capable");
211 213
       pciSetup(Z2_MAX_PIN);
212 214
     #endif
213 215
   #endif
@@ -217,7 +219,7 @@ void setup_endstop_interrupts( void ) {
217 219
       attachInterrupt(digitalPinToInterrupt(Z2_MIN_PIN), endstop_ISR, CHANGE);
218 220
     #else
219 221
       // Not all used endstop/probe -pins can raise interrupts. Please deactivate ENDSTOP_INTERRUPTS or change the pin configuration!
220
-      static_assert(digitalPinToPCICR(Z2_MIN_PIN) != NULL, "Z2_MIN_PIN is not interrupt-capable");
222
+      static_assert(digitalPinToPCICR(Z2_MIN_PIN), "Z2_MIN_PIN is not interrupt-capable");
221 223
       pciSetup(Z2_MIN_PIN);
222 224
     #endif
223 225
   #endif
@@ -227,7 +229,7 @@ void setup_endstop_interrupts( void ) {
227 229
       attachInterrupt(digitalPinToInterrupt(Z3_MAX_PIN), endstop_ISR, CHANGE);
228 230
     #else
229 231
       // Not all used endstop/probe -pins can raise interrupts. Please deactivate ENDSTOP_INTERRUPTS or change the pin configuration!
230
-      static_assert(digitalPinToPCICR(Z3_MAX_PIN) != NULL, "Z3_MAX_PIN is not interrupt-capable");
232
+      static_assert(digitalPinToPCICR(Z3_MAX_PIN), "Z3_MAX_PIN is not interrupt-capable");
231 233
       pciSetup(Z3_MAX_PIN);
232 234
     #endif
233 235
   #endif
@@ -237,7 +239,7 @@ void setup_endstop_interrupts( void ) {
237 239
       attachInterrupt(digitalPinToInterrupt(Z3_MIN_PIN), endstop_ISR, CHANGE);
238 240
     #else
239 241
       // Not all used endstop/probe -pins can raise interrupts. Please deactivate ENDSTOP_INTERRUPTS or change the pin configuration!
240
-      static_assert(digitalPinToPCICR(Z3_MIN_PIN) != NULL, "Z3_MIN_PIN is not interrupt-capable");
242
+      static_assert(digitalPinToPCICR(Z3_MIN_PIN), "Z3_MIN_PIN is not interrupt-capable");
241 243
       pciSetup(Z3_MIN_PIN);
242 244
     #endif
243 245
   #endif
@@ -247,7 +249,7 @@ void setup_endstop_interrupts( void ) {
247 249
       attachInterrupt(digitalPinToInterrupt(Z_MIN_PROBE_PIN), endstop_ISR, CHANGE);
248 250
     #else
249 251
       // Not all used endstop/probe -pins can raise interrupts. Please deactivate ENDSTOP_INTERRUPTS or change the pin configuration!
250
-      static_assert(digitalPinToPCICR(Z_MIN_PROBE_PIN) != NULL, "Z_MIN_PROBE_PIN is not interrupt-capable");
252
+      static_assert(digitalPinToPCICR(Z_MIN_PROBE_PIN), "Z_MIN_PROBE_PIN is not interrupt-capable");
251 253
       pciSetup(Z_MIN_PROBE_PIN);
252 254
     #endif
253 255
   #endif

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

@@ -38,9 +38,9 @@
38 38
         #ifdef TCCR2
39 39
           case TIMER2: {
40 40
             Timer timer = {
41
-              /*TCCRnQ*/  { &TCCR2, NULL, NULL},
42
-              /*OCRnQ*/   { (uint16_t*)&OCR2, NULL, NULL},
43
-              /*ICRn*/      NULL,
41
+              /*TCCRnQ*/  { &TCCR2, nullptr, nullptr},
42
+              /*OCRnQ*/   { (uint16_t*)&OCR2, nullptr, nullptr},
43
+              /*ICRn*/      nullptr,
44 44
               /*n, q*/      2, 0
45 45
             };
46 46
           }
@@ -49,9 +49,9 @@
49 49
             case TIMER2A:   break; // protect TIMER2A
50 50
             case TIMER2B: {
51 51
               Timer timer = {
52
-                /*TCCRnQ*/  { &TCCR2A,  &TCCR2B,  NULL},
53
-                /*OCRnQ*/   { (uint16_t*)&OCR2A, (uint16_t*)&OCR2B, NULL},
54
-                /*ICRn*/      NULL,
52
+                /*TCCRnQ*/  { &TCCR2A,  &TCCR2B,  nullptr},
53
+                /*OCRnQ*/   { (uint16_t*)&OCR2A, (uint16_t*)&OCR2B, nullptr},
54
+                /*ICRn*/      nullptr,
55 55
                 /*n, q*/      2, 1
56 56
               };
57 57
               return timer;
@@ -60,9 +60,9 @@
60 60
             case TIMER2B:   ++q;
61 61
             case TIMER2A: {
62 62
               Timer timer = {
63
-                /*TCCRnQ*/  { &TCCR2A,  &TCCR2B,  NULL},
64
-                /*OCRnQ*/   { (uint16_t*)&OCR2A, (uint16_t*)&OCR2B, NULL},
65
-                /*ICRn*/      NULL,
63
+                /*TCCRnQ*/  { &TCCR2A,  &TCCR2B,  nullptr},
64
+                /*OCRnQ*/   { (uint16_t*)&OCR2A, (uint16_t*)&OCR2B, nullptr},
65
+                /*ICRn*/      nullptr,
66 66
                               2, q
67 67
               };
68 68
               return timer;
@@ -111,9 +111,9 @@
111 111
       #endif
112 112
     }
113 113
     Timer timer = {
114
-        /*TCCRnQ*/  { NULL, NULL, NULL},
115
-        /*OCRnQ*/   { NULL, NULL, NULL},
116
-        /*ICRn*/      NULL,
114
+        /*TCCRnQ*/  { nullptr, nullptr, nullptr},
115
+        /*OCRnQ*/   { nullptr, nullptr, nullptr},
116
+        /*ICRn*/      nullptr,
117 117
                       0, 0
118 118
     };
119 119
     return timer;

+ 146
- 146
Marlin/src/HAL/HAL_AVR/fastio_1280.h
File diff suppressed because it is too large
View File


+ 94
- 94
Marlin/src/HAL/HAL_AVR/fastio_1281.h View File

@@ -63,13 +63,13 @@
63 63
 #define DIO0_RPORT  PINE
64 64
 #define DIO0_WPORT  PORTE
65 65
 #define DIO0_DDR    DDRE
66
-#define DIO0_PWM    NULL
66
+#define DIO0_PWM    nullptr
67 67
 
68 68
 #define DIO1_PIN    PINE1
69 69
 #define DIO1_RPORT  PINE
70 70
 #define DIO1_WPORT  PORTE
71 71
 #define DIO1_DDR    DDRE
72
-#define DIO1_PWM    NULL
72
+#define DIO1_PWM    nullptr
73 73
 
74 74
 #define DIO2_PIN    PINE4
75 75
 #define DIO2_RPORT  PINE
@@ -123,339 +123,339 @@
123 123
 #define DIO10_RPORT PINB
124 124
 #define DIO10_WPORT PORTB
125 125
 #define DIO10_DDR   DDRB
126
-#define DIO10_PWM   NULL
126
+#define DIO10_PWM   nullptr
127 127
 
128 128
 #define DIO11_PIN   PINB2
129 129
 #define DIO11_RPORT PINB
130 130
 #define DIO11_WPORT PORTB
131 131
 #define DIO11_DDR   DDRB
132
-#define DIO11_PWM   NULL
132
+#define DIO11_PWM   nullptr
133 133
 
134 134
 #define DIO12_PIN   PINB3
135 135
 #define DIO12_RPORT PINB
136 136
 #define DIO12_WPORT PORTB
137 137
 #define DIO12_DDR   DDRB
138
-#define DIO12_PWM   NULL
138
+#define DIO12_PWM   nullptr
139 139
 
140 140
 #define DIO13_PIN   PINE2
141 141
 #define DIO13_RPORT PINE
142 142
 #define DIO13_WPORT PORTE
143 143
 #define DIO13_DDR   DDRE
144
-#define DIO13_PWM   NULL
144
+#define DIO13_PWM   nullptr
145 145
 
146 146
 #define DIO14_PIN   PINE6
147 147
 #define DIO14_RPORT PINE
148 148
 #define DIO14_WPORT PORTE
149 149
 #define DIO14_DDR   DDRE
150
-#define DIO14_PWM   NULL
150
+#define DIO14_PWM   nullptr
151 151
 
152 152
 #define DIO15_PIN   PINE7
153 153
 #define DIO15_RPORT PINE
154 154
 #define DIO15_WPORT PORTE
155 155
 #define DIO15_DDR   DDRE
156
-#define DIO15_PWM   NULL
156
+#define DIO15_PWM   nullptr
157 157
 
158 158
 #define DIO16_PIN   PINB0
159 159
 #define DIO16_RPORT PINB
160 160
 #define DIO16_WPORT PORTB
161 161
 #define DIO16_DDR   DDRB
162
-#define DIO16_PWM   NULL
162
+#define DIO16_PWM   nullptr
163 163
 
164 164
 #define DIO17_PIN   PIND0
165 165
 #define DIO17_RPORT PIND
166 166
 #define DIO17_WPORT PORTD
167 167
 #define DIO17_DDR   DDRD
168
-#define DIO17_PWM   NULL
168
+#define DIO17_PWM   nullptr
169 169
 
170 170
 #define DIO18_PIN   PIND1
171 171
 #define DIO18_RPORT PIND
172 172
 #define DIO18_WPORT PORTD
173 173
 #define DIO18_DDR   DDRD
174
-#define DIO18_PWM   NULL
174
+#define DIO18_PWM   nullptr
175 175
 
176 176
 #define DIO19_PIN   PIND2
177 177
 #define DIO19_RPORT PIND
178 178
 #define DIO19_WPORT PORTD
179 179
 #define DIO19_DDR   DDRD
180
-#define DIO19_PWM   NULL
180
+#define DIO19_PWM   nullptr
181 181
 
182 182
 #define DIO20_PIN   PIND3
183 183
 #define DIO20_RPORT PIND
184 184
 #define DIO20_WPORT PORTD
185 185
 #define DIO20_DDR   DDRD
186
-#define DIO20_PWM   NULL
186
+#define DIO20_PWM   nullptr
187 187
 
188 188
 #define DIO21_PIN   PIND4
189 189
 #define DIO21_RPORT PIND
190 190
 #define DIO21_WPORT PORTD
191 191
 #define DIO21_DDR   DDRD
192
-#define DIO21_PWM   NULL
192
+#define DIO21_PWM   nullptr
193 193
 
194 194
 #define DIO22_PIN   PIND5
195 195
 #define DIO22_RPORT PIND
196 196
 #define DIO22_WPORT PORTD
197 197
 #define DIO22_DDR   DDRD
198
-#define DIO22_PWM   NULL
198
+#define DIO22_PWM   nullptr
199 199
 
200 200
 #define DIO23_PIN   PIND6
201 201
 #define DIO23_RPORT PIND
202 202
 #define DIO23_WPORT PORTD
203 203
 #define DIO23_DDR   DDRD
204
-#define DIO23_PWM   NULL
204
+#define DIO23_PWM   nullptr
205 205
 
206 206
 #define DIO24_PIN   PIND7
207 207
 #define DIO24_RPORT PIND
208 208
 #define DIO24_WPORT PORTD
209 209
 #define DIO24_DDR   DDRD
210
-#define DIO24_PWM   NULL
210
+#define DIO24_PWM   nullptr
211 211
 
212 212
 #define DIO25_PIN   PING0
213 213
 #define DIO25_RPORT PING
214 214
 #define DIO25_WPORT PORTG
215 215
 #define DIO25_DDR   DDRG
216
-#define DIO25_PWM   NULL
216
+#define DIO25_PWM   nullptr
217 217
 
218 218
 #define DIO26_PIN   PING1
219 219
 #define DIO26_RPORT PING
220 220
 #define DIO26_WPORT PORTG
221 221
 #define DIO26_DDR   DDRG
222
-#define DIO26_PWM   NULL
222
+#define DIO26_PWM   nullptr
223 223
 
224 224
 #define DIO27_PIN   PING2
225 225
 #define DIO27_RPORT PING
226 226
 #define DIO27_WPORT PORTG
227 227
 #define DIO27_DDR   DDRG
228
-#define DIO27_PWM   NULL
228
+#define DIO27_PWM   nullptr
229 229
 
230 230
 #define DIO28_PIN   PING3
231 231
 #define DIO28_RPORT PING
232 232
 #define DIO28_WPORT PORTG
233 233
 #define DIO28_DDR   DDRG
234
-#define DIO28_PWM   NULL
234
+#define DIO28_PWM   nullptr
235 235
 
236 236
 #define DIO29_PIN   PING4
237 237
 #define DIO29_RPORT PING
238 238
 #define DIO29_WPORT PORTG
239 239
 #define DIO29_DDR   DDRG
240
-#define DIO29_PWM   NULL
240
+#define DIO29_PWM   nullptr
241 241
 
242 242
 #define DIO30_PIN   PINC0
243 243
 #define DIO30_RPORT PINC
244 244
 #define DIO30_WPORT PORTC
245 245
 #define DIO30_DDR   DDRC
246
-#define DIO30_PWM   NULL
246
+#define DIO30_PWM   nullptr
247 247
 
248 248
 #define DIO31_PIN   PINC1
249 249
 #define DIO31_RPORT PINC
250 250
 #define DIO31_WPORT PORTC
251 251
 #define DIO31_DDR   DDRC
252
-#define DIO31_PWM   NULL
252
+#define DIO31_PWM   nullptr
253 253
 
254 254
 #define DIO32_PIN   PINC2
255 255
 #define DIO32_RPORT PINC
256 256
 #define DIO32_WPORT PORTC
257 257
 #define DIO32_DDR   DDRC
258
-#define DIO32_PWM   NULL
258
+#define DIO32_PWM   nullptr
259 259
 
260 260
 #define DIO33_PIN   PINC3
261 261
 #define DIO33_RPORT PINC
262 262
 #define DIO33_WPORT PORTC
263 263
 #define DIO33_DDR   DDRC
264
-#define DIO33_PWM   NULL
264
+#define DIO33_PWM   nullptr
265 265
 
266 266
 #define DIO34_PIN   PINC4
267 267
 #define DIO34_RPORT PINC
268 268
 #define DIO34_WPORT PORTC
269 269
 #define DIO34_DDR   DDRC
270
-#define DIO34_PWM   NULL
270
+#define DIO34_PWM   nullptr
271 271
 
272 272
 #define DIO35_PIN   PINC5
273 273
 #define DIO35_RPORT PINC
274 274
 #define DIO35_WPORT PORTC
275 275
 #define DIO35_DDR   DDRC
276
-#define DIO35_PWM   NULL
276
+#define DIO35_PWM   nullptr
277 277
 
278 278
 #define DIO36_PIN   PINC6
279 279
 #define DIO36_RPORT PINC
280 280
 #define DIO36_WPORT PORTC
281 281
 #define DIO36_DDR   DDRC
282
-#define DIO36_PWM   NULL
282
+#define DIO36_PWM   nullptr
283 283
 
284 284
 #define DIO37_PIN   PINC7
285 285
 #define DIO37_RPORT PINC
286 286
 #define DIO37_WPORT PORTC
287 287
 #define DIO37_DDR   DDRC
288
-#define DIO37_PWM   NULL
288
+#define DIO37_PWM   nullptr
289 289
 
290 290
 #define DIO38_PIN   PINA0
291 291
 #define DIO38_RPORT PINA
292 292
 #define DIO38_WPORT PORTA
293 293
 #define DIO38_DDR   DDRA
294
-#define DIO38_PWM   NULL
294
+#define DIO38_PWM   nullptr
295 295
 
296 296
 #define DIO39_PIN   PINA1
297 297
 #define DIO39_RPORT PINA
298 298
 #define DIO39_WPORT PORTA
299 299
 #define DIO39_DDR   DDRA
300
-#define DIO39_PWM   NULL
300
+#define DIO39_PWM   nullptr
301 301
 
302 302
 #define DIO40_PIN   PINA2
303 303
 #define DIO40_RPORT PINA
304 304
 #define DIO40_WPORT PORTA
305 305
 #define DIO40_DDR   DDRA
306
-#define DIO40_PWM   NULL
306
+#define DIO40_PWM   nullptr
307 307
 
308 308
 #define DIO41_PIN   PINA3
309 309
 #define DIO41_RPORT PINA
310 310
 #define DIO41_WPORT PORTA
311 311
 #define DIO41_DDR   DDRA
312
-#define DIO41_PWM   NULL
312
+#define DIO41_PWM   nullptr
313 313
 
314 314
 #define DIO42_PIN   PINA4
315 315
 #define DIO42_RPORT PINA
316 316
 #define DIO42_WPORT PORTA
317 317
 #define DIO42_DDR   DDRA
318
-#define DIO42_PWM   NULL
318
+#define DIO42_PWM   nullptr
319 319
 
320 320
 #define DIO43_PIN   PINA5
321 321
 #define DIO43_RPORT PINA
322 322
 #define DIO43_WPORT PORTA
323 323
 #define DIO43_DDR   DDRA
324
-#define DIO43_PWM   NULL
324
+#define DIO43_PWM   nullptr
325 325
 
326 326
 #define DIO44_PIN   PINA6
327 327
 #define DIO44_RPORT PINA
328 328
 #define DIO44_WPORT PORTA
329 329
 #define DIO44_DDR   DDRA
330
-#define DIO44_PWM   NULL
330
+#define DIO44_PWM   nullptr
331 331
 
332 332
 #define DIO45_PIN   PINA7
333 333
 #define DIO45_RPORT PINA
334 334
 #define DIO45_WPORT PORTA
335 335
 #define DIO45_DDR   DDRA
336
-#define DIO45_PWM   NULL
336
+#define DIO45_PWM   nullptr
337 337
 
338 338
 #define DIO46_PIN   PINF0
339 339
 #define DIO46_RPORT PINF
340 340
 #define DIO46_WPORT PORTF
341 341
 #define DIO46_DDR   DDRF
342
-#define DIO46_PWM   NULL
342
+#define DIO46_PWM   nullptr
343 343
 
344 344
 #define DIO47_PIN   PINF1
345 345
 #define DIO47_RPORT PINF
346 346
 #define DIO47_WPORT PORTF
347 347
 #define DIO47_DDR   DDRF
348
-#define DIO47_PWM   NULL
348
+#define DIO47_PWM   nullptr
349 349
 
350 350
 #define DIO48_PIN   PINF2
351 351
 #define DIO48_RPORT PINF
352 352
 #define DIO48_WPORT PORTF
353 353
 #define DIO48_DDR   DDRF
354
-#define DIO48_PWM   NULL
354
+#define DIO48_PWM   nullptr
355 355
 
356 356
 #define DIO49_PIN   PINF3
357 357
 #define DIO49_RPORT PINF
358 358
 #define DIO49_WPORT PORTF
359 359
 #define DIO49_DDR   DDRF
360
-#define DIO49_PWM   NULL
360
+#define DIO49_PWM   nullptr
361 361
 
362 362
 #define DIO50_PIN   PINF4
363 363
 #define DIO50_RPORT PINF
364 364
 #define DIO50_WPORT PORTF
365 365
 #define DIO50_DDR   DDRF
366
-#define DIO50_PWM   NULL
366
+#define DIO50_PWM   nullptr
367 367
 
368 368
 #define DIO51_PIN   PINF5
369 369
 #define DIO51_RPORT PINF
370 370
 #define DIO51_WPORT PORTF
371 371
 #define DIO51_DDR   DDRF
372
-#define DIO51_PWM   NULL
372
+#define DIO51_PWM   nullptr
373 373
 
374 374
 #define DIO52_PIN   PINF6
375 375
 #define DIO52_RPORT PINF
376 376
 #define DIO52_WPORT PORTF
377 377
 #define DIO52_DDR   DDRF
378
-#define DIO52_PWM   NULL
378
+#define DIO52_PWM   nullptr
379 379
 
380 380
 #define DIO53_PIN   PINF7
381 381
 #define DIO53_RPORT PINF
382 382
 #define DIO53_WPORT PORTF
383 383
 #define DIO53_DDR   DDRF
384
-#define DIO53_PWM   NULL
384
+#define DIO53_PWM   nullptr
385 385
 
386 386
 #undef PA0
387 387
 #define PA0_PIN     PINA0
388 388
 #define PA0_RPORT   PINA
389 389
 #define PA0_WPORT   PORTA
390 390
 #define PA0_DDR     DDRA
391
-#define PA0_PWM     NULL
391
+#define PA0_PWM     nullptr
392 392
 #undef PA1
393 393
 #define PA1_PIN     PINA1
394 394
 #define PA1_RPORT   PINA
395 395
 #define PA1_WPORT   PORTA
396 396
 #define PA1_DDR     DDRA
397
-#define PA1_PWM     NULL
397
+#define PA1_PWM     nullptr
398 398
 #undef PA2
399 399
 #define PA2_PIN     PINA2
400 400
 #define PA2_RPORT   PINA
401 401
 #define PA2_WPORT   PORTA
402 402
 #define PA2_DDR     DDRA
403
-#define PA2_PWM     NULL
403
+#define PA2_PWM     nullptr
404 404
 #undef PA3
405 405
 #define PA3_PIN     PINA3
406 406
 #define PA3_RPORT   PINA
407 407
 #define PA3_WPORT   PORTA
408 408
 #define PA3_DDR     DDRA
409
-#define PA3_PWM     NULL
409
+#define PA3_PWM     nullptr
410 410
 #undef PA4
411 411
 #define PA4_PIN     PINA4
412 412
 #define PA4_RPORT   PINA
413 413
 #define PA4_WPORT   PORTA
414 414
 #define PA4_DDR     DDRA
415
-#define PA4_PWM     NULL
415
+#define PA4_PWM     nullptr
416 416
 #undef PA5
417 417
 #define PA5_PIN     PINA5
418 418
 #define PA5_RPORT   PINA
419 419
 #define PA5_WPORT   PORTA
420 420
 #define PA5_DDR     DDRA
421
-#define PA5_PWM     NULL
421
+#define PA5_PWM     nullptr
422 422
 #undef PA6
423 423
 #define PA6_PIN     PINA6
424 424
 #define PA6_RPORT   PINA
425 425
 #define PA6_WPORT   PORTA
426 426
 #define PA6_DDR     DDRA
427
-#define PA6_PWM     NULL
427
+#define PA6_PWM     nullptr
428 428
 #undef PA7
429 429
 #define PA7_PIN     PINA7
430 430
 #define PA7_RPORT   PINA
431 431
 #define PA7_WPORT   PORTA
432 432
 #define PA7_DDR     DDRA
433
-#define PA7_PWM     NULL
433
+#define PA7_PWM     nullptr
434 434
 
435 435
 #undef PB0
436 436
 #define PB0_PIN     PINB0
437 437
 #define PB0_RPORT   PINB
438 438
 #define PB0_WPORT   PORTB
439 439
 #define PB0_DDR     DDRB
440
-#define PB0_PWM     NULL
440
+#define PB0_PWM     nullptr
441 441
 #undef PB1
442 442
 #define PB1_PIN     PINB1
443 443
 #define PB1_RPORT   PINB
444 444
 #define PB1_WPORT   PORTB
445 445
 #define PB1_DDR     DDRB
446
-#define PB1_PWM     NULL
446
+#define PB1_PWM     nullptr
447 447
 #undef PB2
448 448
 #define PB2_PIN     PINB2
449 449
 #define PB2_RPORT   PINB
450 450
 #define PB2_WPORT   PORTB
451 451
 #define PB2_DDR     DDRB
452
-#define PB2_PWM     NULL
452
+#define PB2_PWM     nullptr
453 453
 #undef PB3
454 454
 #define PB3_PIN     PINB3
455 455
 #define PB3_RPORT   PINB
456 456
 #define PB3_WPORT   PORTB
457 457
 #define PB3_DDR     DDRB
458
-#define PB3_PWM     NULL
458
+#define PB3_PWM     nullptr
459 459
 #undef PB4
460 460
 #define PB4_PIN     PINB4
461 461
 #define PB4_RPORT   PINB
@@ -467,13 +467,13 @@
467 467
 #define PB5_RPORT   PINB
468 468
 #define PB5_WPORT   PORTB
469 469
 #define PB5_DDR     DDRB
470
-#define PB5_PWM     NULL
470
+#define PB5_PWM     nullptr
471 471
 #undef PB6
472 472
 #define PB6_PIN     PINB6
473 473
 #define PB6_RPORT   PINB
474 474
 #define PB6_WPORT   PORTB
475 475
 #define PB6_DDR     DDRB
476
-#define PB6_PWM     NULL
476
+#define PB6_PWM     nullptr
477 477
 #undef PB7
478 478
 #define PB7_PIN     PINB7
479 479
 #define PB7_RPORT   PINB
@@ -486,117 +486,117 @@
486 486
 #define PC0_RPORT   PINC
487 487
 #define PC0_WPORT   PORTC
488 488
 #define PC0_DDR     DDRC
489
-#define PC0_PWM     NULL
489
+#define PC0_PWM     nullptr
490 490
 #undef PC1
491 491
 #define PC1_PIN     PINC1
492 492
 #define PC1_RPORT   PINC
493 493
 #define PC1_WPORT   PORTC
494 494
 #define PC1_DDR     DDRC
495
-#define PC1_PWM     NULL
495
+#define PC1_PWM     nullptr
496 496
 #undef PC2
497 497
 #define PC2_PIN     PINC2
498 498
 #define PC2_RPORT   PINC
499 499
 #define PC2_WPORT   PORTC
500 500
 #define PC2_DDR     DDRC
501
-#define PC2_PWM     NULL
501
+#define PC2_PWM     nullptr
502 502
 #undef PC3
503 503
 #define PC3_PIN     PINC3
504 504
 #define PC3_RPORT   PINC
505 505
 #define PC3_WPORT   PORTC
506 506
 #define PC3_DDR     DDRC
507
-#define PC3_PWM     NULL
507
+#define PC3_PWM     nullptr
508 508
 #undef PC4
509 509
 #define PC4_PIN     PINC4
510 510
 #define PC4_RPORT   PINC
511 511
 #define PC4_WPORT   PORTC
512 512
 #define PC4_DDR     DDRC
513
-#define PC4_PWM     NULL
513
+#define PC4_PWM     nullptr
514 514
 #undef PC5
515 515
 #define PC5_PIN     PINC5
516 516
 #define PC5_RPORT   PINC
517 517
 #define PC5_WPORT   PORTC
518 518
 #define PC5_DDR     DDRC
519
-#define PC5_PWM     NULL
519
+#define PC5_PWM     nullptr
520 520
 #undef PC6
521 521
 #define PC6_PIN     PINC6
522 522
 #define PC6_RPORT   PINC
523 523
 #define PC6_WPORT   PORTC
524 524
 #define PC6_DDR     DDRC
525
-#define PC6_PWM     NULL
525
+#define PC6_PWM     nullptr
526 526
 #undef PC7
527 527
 #define PC7_PIN     PINC7
528 528
 #define PC7_RPORT   PINC
529 529
 #define PC7_WPORT   PORTC
530 530
 #define PC7_DDR     DDRC
531
-#define PC7_PWM     NULL
531
+#define PC7_PWM     nullptr
532 532
 
533 533
 #undef PD0
534 534
 #define PD0_PIN     PIND0
535 535
 #define PD0_RPORT   PIND
536 536
 #define PD0_WPORT   PORTD
537 537
 #define PD0_DDR     DDRD
538
-#define PD0_PWM     NULL
538
+#define PD0_PWM     nullptr
539 539
 #undef PD1
540 540
 #define PD1_PIN     PIND1
541 541
 #define PD1_RPORT   PIND
542 542
 #define PD1_WPORT   PORTD
543 543
 #define PD1_DDR     DDRD
544
-#define PD1_PWM     NULL
544
+#define PD1_PWM     nullptr
545 545
 #undef PD2
546 546
 #define PD2_PIN     PIND2
547 547
 #define PD2_RPORT   PIND
548 548
 #define PD2_WPORT   PORTD
549 549
 #define PD2_DDR     DDRD
550
-#define PD2_PWM     NULL
550
+#define PD2_PWM     nullptr
551 551
 #undef PD3
552 552
 #define PD3_PIN     PIND3
553 553
 #define PD3_RPORT   PIND
554 554
 #define PD3_WPORT   PORTD
555 555
 #define PD3_DDR     DDRD
556
-#define PD3_PWM     NULL
556
+#define PD3_PWM     nullptr
557 557
 #undef PD4
558 558
 #define PD4_PIN     PIND4
559 559
 #define PD4_RPORT   PIND
560 560
 #define PD4_WPORT   PORTD
561 561
 #define PD4_DDR     DDRD
562
-#define PD4_PWM     NULL
562
+#define PD4_PWM     nullptr
563 563
 #undef PD5
564 564
 #define PD5_PIN     PIND5
565 565
 #define PD5_RPORT   PIND
566 566
 #define PD5_WPORT   PORTD
567 567
 #define PD5_DDR     DDRD
568
-#define PD5_PWM     NULL
568
+#define PD5_PWM     nullptr
569 569
 #undef PD6
570 570
 #define PD6_PIN     PIND6
571 571
 #define PD6_RPORT   PIND
572 572
 #define PD6_WPORT   PORTD
573 573
 #define PD6_DDR     DDRD
574
-#define PD6_PWM     NULL
574
+#define PD6_PWM     nullptr
575 575
 #undef PD7
576 576
 #define PD7_PIN     PIND7
577 577
 #define PD7_RPORT   PIND
578 578
 #define PD7_WPORT   PORTD
579 579
 #define PD7_DDR     DDRD
580
-#define PD7_PWM     NULL
580
+#define PD7_PWM     nullptr
581 581
 
582 582
 #undef PE0
583 583
 #define PE0_PIN     PINE0
584 584
 #define PE0_RPORT   PINE
585 585
 #define PE0_WPORT   PORTE
586 586
 #define PE0_DDR     DDRE
587
-#define PE0_PWM     NULL
587
+#define PE0_PWM     nullptr
588 588
 #undef PE1
589 589
 #define PE1_PIN     PINE1
590 590
 #define PE1_RPORT   PINE
591 591
 #define PE1_WPORT   PORTE
592 592
 #define PE1_DDR     DDRE
593
-#define PE1_PWM     NULL
593
+#define PE1_PWM     nullptr
594 594
 #undef PE2
595 595
 #define PE2_PIN     PINE2
596 596
 #define PE2_RPORT   PINE
597 597
 #define PE2_WPORT   PORTE
598 598
 #define PE2_DDR     DDRE
599
-#define PE2_PWM     NULL
599
+#define PE2_PWM     nullptr
600 600
 #undef PE3
601 601
 #define PE3_PIN     PINE3
602 602
 #define PE3_RPORT   PINE
@@ -620,93 +620,93 @@
620 620
 #define PE6_RPORT   PINE
621 621
 #define PE6_WPORT   PORTE
622 622
 #define PE6_DDR     DDRE
623
-#define PE6_PWM     NULL
623
+#define PE6_PWM     nullptr
624 624
 #undef PE7
625 625
 #define PE7_PIN     PINE7
626 626
 #define PE7_RPORT   PINE
627 627
 #define PE7_WPORT   PORTE
628 628
 #define PE7_DDR     DDRE
629
-#define PE7_PWM     NULL
629
+#define PE7_PWM     nullptr
630 630
 
631 631
 #undef PF0
632 632
 #define PF0_PIN     PINF0
633 633
 #define PF0_RPORT   PINF
634 634
 #define PF0_WPORT   PORTF
635 635
 #define PF0_DDR     DDRF
636
-#define PF0_PWM     NULL
636
+#define PF0_PWM     nullptr
637 637
 #undef PF1
638 638
 #define PF1_PIN     PINF1
639 639
 #define PF1_RPORT   PINF
640 640
 #define PF1_WPORT   PORTF
641 641
 #define PF1_DDR     DDRF
642
-#define PF1_PWM     NULL
642
+#define PF1_PWM     nullptr
643 643
 #undef PF2
644 644
 #define PF2_PIN     PINF2
645 645
 #define PF2_RPORT   PINF
646 646
 #define PF2_WPORT   PORTF
647 647
 #define PF2_DDR     DDRF
648
-#define PF2_PWM     NULL
648
+#define PF2_PWM     nullptr
649 649
 #undef PF3
650 650
 #define PF3_PIN     PINF3
651 651
 #define PF3_RPORT   PINF
652 652
 #define PF3_WPORT   PORTF
653 653
 #define PF3_DDR     DDRF
654
-#define PF3_PWM     NULL
654
+#define PF3_PWM     nullptr
655 655
 #undef PF4
656 656
 #define PF4_PIN     PINF4
657 657
 #define PF4_RPORT   PINF
658 658
 #define PF4_WPORT   PORTF
659 659
 #define PF4_DDR     DDRF
660
-#define PF4_PWM     NULL
660
+#define PF4_PWM     nullptr
661 661
 #undef PF5
662 662
 #define PF5_PIN     PINF5
663 663
 #define PF5_RPORT   PINF
664 664
 #define PF5_WPORT   PORTF
665 665
 #define PF5_DDR     DDRF
666
-#define PF5_PWM     NULL
666
+#define PF5_PWM     nullptr
667 667
 #undef PF6
668 668
 #define PF6_PIN     PINF6
669 669
 #define PF6_RPORT   PINF
670 670
 #define PF6_WPORT   PORTF
671 671
 #define PF6_DDR     DDRF
672
-#define PF6_PWM     NULL
672
+#define PF6_PWM     nullptr
673 673
 #undef PF7
674 674
 #define PF7_PIN     PINF7
675 675
 #define PF7_RPORT   PINF
676 676
 #define PF7_WPORT   PORTF
677 677
 #define PF7_DDR     DDRF
678
-#define PF7_PWM     NULL
678
+#define PF7_PWM     nullptr
679 679
 
680 680
 #undef PG0
681 681
 #define PG0_PIN     PING0
682 682
 #define PG0_RPORT   PING
683 683
 #define PG0_WPORT   PORTG
684 684
 #define PG0_DDR     DDRG
685
-#define PG0_PWM     NULL
685
+#define PG0_PWM     nullptr
686 686
 #undef PG1
687 687
 #define PG1_PIN     PING1
688 688
 #define PG1_RPORT   PING
689 689
 #define PG1_WPORT   PORTG
690 690
 #define PG1_DDR     DDRG
691
-#define PG1_PWM     NULL
691
+#define PG1_PWM     nullptr
692 692
 #undef PG2
693 693
 #define PG2_PIN     PING2
694 694
 #define PG2_RPORT   PING
695 695
 #define PG2_WPORT   PORTG
696 696
 #define PG2_DDR     DDRG
697
-#define PG2_PWM     NULL
697
+#define PG2_PWM     nullptr
698 698
 #undef PG3
699 699
 #define PG3_PIN     PING3
700 700
 #define PG3_RPORT   PING
701 701
 #define PG3_WPORT   PORTG
702 702
 #define PG3_DDR     DDRG
703
-#define PG3_PWM     NULL
703
+#define PG3_PWM     nullptr
704 704
 #undef PG4
705 705
 #define PG4_PIN     PING4
706 706
 #define PG4_RPORT   PING
707 707
 #define PG4_WPORT   PORTG
708 708
 #define PG4_DDR     DDRG
709
-#define PG4_PWM     NULL
709
+#define PG4_PWM     nullptr
710 710
 #undef PG5
711 711
 #define PG5_PIN     PING5
712 712
 #define PG5_RPORT   PING

+ 38
- 38
Marlin/src/HAL/HAL_AVR/fastio_168.h View File

@@ -60,19 +60,19 @@
60 60
 #define DIO0_RPORT  PIND
61 61
 #define DIO0_WPORT  PORTD
62 62
 #define DIO0_DDR    DDRD
63
-#define DIO0_PWM    NULL
63
+#define DIO0_PWM    nullptr
64 64
 
65 65
 #define DIO1_PIN    PIND1
66 66
 #define DIO1_RPORT  PIND
67 67
 #define DIO1_WPORT  PORTD
68 68
 #define DIO1_DDR    DDRD
69
-#define DIO1_PWM    NULL
69
+#define DIO1_PWM    nullptr
70 70
 
71 71
 #define DIO2_PIN    PIND2
72 72
 #define DIO2_RPORT  PIND
73 73
 #define DIO2_WPORT  PORTD
74 74
 #define DIO2_DDR    DDRD
75
-#define DIO2_PWM    NULL
75
+#define DIO2_PWM    nullptr
76 76
 
77 77
 #define DIO3_PIN    PIND3
78 78
 #define DIO3_RPORT  PIND
@@ -84,7 +84,7 @@
84 84
 #define DIO4_RPORT  PIND
85 85
 #define DIO4_WPORT  PORTD
86 86
 #define DIO4_DDR    DDRD
87
-#define DIO4_PWM    NULL
87
+#define DIO4_PWM    nullptr
88 88
 
89 89
 #define DIO5_PIN    PIND5
90 90
 #define DIO5_RPORT  PIND
@@ -102,25 +102,25 @@
102 102
 #define DIO7_RPORT  PIND
103 103
 #define DIO7_WPORT  PORTD
104 104
 #define DIO7_DDR    DDRD
105
-#define DIO7_PWM    NULL
105
+#define DIO7_PWM    nullptr
106 106
 
107 107
 #define DIO8_PIN    PINB0
108 108
 #define DIO8_RPORT  PINB
109 109
 #define DIO8_WPORT  PORTB
110 110
 #define DIO8_DDR    DDRB
111
-#define DIO8_PWM    NULL
111
+#define DIO8_PWM    nullptr
112 112
 
113 113
 #define DIO9_PIN    PINB1
114 114
 #define DIO9_RPORT  PINB
115 115
 #define DIO9_WPORT  PORTB
116 116
 #define DIO9_DDR    DDRB
117
-#define DIO9_PWM    NULL
117
+#define DIO9_PWM    nullptr
118 118
 
119 119
 #define DIO10_PIN   PINB2
120 120
 #define DIO10_RPORT PINB
121 121
 #define DIO10_WPORT PORTB
122 122
 #define DIO10_DDR   DDRB
123
-#define DIO10_PWM   NULL
123
+#define DIO10_PWM   nullptr
124 124
 
125 125
 #define DIO11_PIN   PINB3
126 126
 #define DIO11_RPORT PINB
@@ -132,82 +132,82 @@
132 132
 #define DIO12_RPORT PINB
133 133
 #define DIO12_WPORT PORTB
134 134
 #define DIO12_DDR   DDRB
135
-#define DIO12_PWM   NULL
135
+#define DIO12_PWM   nullptr
136 136
 
137 137
 #define DIO13_PIN   PINB5
138 138
 #define DIO13_RPORT PINB
139 139
 #define DIO13_WPORT PORTB
140 140
 #define DIO13_DDR   DDRB
141
-#define DIO13_PWM   NULL
141
+#define DIO13_PWM   nullptr
142 142
 
143 143
 #define DIO14_PIN   PINC0
144 144
 #define DIO14_RPORT PINC
145 145
 #define DIO14_WPORT PORTC
146 146
 #define DIO14_DDR   DDRC
147
-#define DIO14_PWM   NULL
147
+#define DIO14_PWM   nullptr
148 148
 
149 149
 #define DIO15_PIN   PINC1
150 150
 #define DIO15_RPORT PINC
151 151
 #define DIO15_WPORT PORTC
152 152
 #define DIO15_DDR   DDRC
153
-#define DIO15_PWM   NULL
153
+#define DIO15_PWM   nullptr
154 154
 
155 155
 #define DIO16_PIN   PINC2
156 156
 #define DIO16_RPORT PINC
157 157
 #define DIO16_WPORT PORTC
158 158
 #define DIO16_DDR   DDRC
159
-#define DIO16_PWM   NULL
159
+#define DIO16_PWM   nullptr
160 160
 
161 161
 #define DIO17_PIN   PINC3
162 162
 #define DIO17_RPORT PINC
163 163
 #define DIO17_WPORT PORTC
164 164
 #define DIO17_DDR   DDRC
165
-#define DIO17_PWM   NULL
165
+#define DIO17_PWM   nullptr
166 166
 
167 167
 #define DIO18_PIN   PINC4
168 168
 #define DIO18_RPORT PINC
169 169
 #define DIO18_WPORT PORTC
170 170
 #define DIO18_DDR   DDRC
171
-#define DIO18_PWM   NULL
171
+#define DIO18_PWM   nullptr
172 172
 
173 173
 #define DIO19_PIN   PINC5
174 174
 #define DIO19_RPORT PINC
175 175
 #define DIO19_WPORT PORTC
176 176
 #define DIO19_DDR   DDRC
177
-#define DIO19_PWM   NULL
177
+#define DIO19_PWM   nullptr
178 178
 
179 179
 #define DIO20_PIN   PINC6
180 180
 #define DIO20_RPORT PINC
181 181
 #define DIO20_WPORT PORTC
182 182
 #define DIO20_DDR   DDRC
183
-#define DIO20_PWM   NULL
183
+#define DIO20_PWM   nullptr
184 184
 
185 185
 #define DIO21_PIN   PINC7
186 186
 #define DIO21_RPORT PINC
187 187
 #define DIO21_WPORT PORTC
188 188
 #define DIO21_DDR   DDRC
189
-#define DIO21_PWM   NULL
189
+#define DIO21_PWM   nullptr
190 190
 
191 191
 #undef PB0
192 192
 #define PB0_PIN     PINB0
193 193
 #define PB0_RPORT   PINB
194 194
 #define PB0_WPORT   PORTB
195 195
 #define PB0_DDR     DDRB
196
-#define PB0_PWM     NULL
196
+#define PB0_PWM     nullptr
197 197
 
198 198
 #undef PB1
199 199
 #define PB1_PIN     PINB1
200 200
 #define PB1_RPORT   PINB
201 201
 #define PB1_WPORT   PORTB
202 202
 #define PB1_DDR     DDRB
203
-#define PB1_PWM     NULL
203
+#define PB1_PWM     nullptr
204 204
 
205 205
 #undef PB2
206 206
 #define PB2_PIN     PINB2
207 207
 #define PB2_RPORT   PINB
208 208
 #define PB2_WPORT   PORTB
209 209
 #define PB2_DDR     DDRB
210
-#define PB2_PWM     NULL
210
+#define PB2_PWM     nullptr
211 211
 
212 212
 #undef PB3
213 213
 #define PB3_PIN     PINB3
@@ -221,105 +221,105 @@
221 221
 #define PB4_RPORT   PINB
222 222
 #define PB4_WPORT   PORTB
223 223
 #define PB4_DDR     DDRB
224
-#define PB4_PWM     NULL
224
+#define PB4_PWM     nullptr
225 225
 
226 226
 #undef PB5
227 227
 #define PB5_PIN     PINB5
228 228
 #define PB5_RPORT   PINB
229 229
 #define PB5_WPORT   PORTB
230 230
 #define PB5_DDR     DDRB
231
-#define PB5_PWM     NULL
231
+#define PB5_PWM     nullptr
232 232
 
233 233
 #undef PB6
234 234
 #define PB6_PIN     PINB6
235 235
 #define PB6_RPORT   PINB
236 236
 #define PB6_WPORT   PORTB
237 237
 #define PB6_DDR     DDRB
238
-#define PB6_PWM     NULL
238
+#define PB6_PWM     nullptr
239 239
 
240 240
 #undef PB7
241 241
 #define PB7_PIN     PINB7
242 242
 #define PB7_RPORT   PINB
243 243
 #define PB7_WPORT   PORTB
244 244
 #define PB7_DDR     DDRB
245
-#define PB7_PWM     NULL
245
+#define PB7_PWM     nullptr
246 246
 
247 247
 #undef PC0
248 248
 #define PC0_PIN     PINC0
249 249
 #define PC0_RPORT   PINC
250 250
 #define PC0_WPORT   PORTC
251 251
 #define PC0_DDR     DDRC
252
-#define PC0_PWM     NULL
252
+#define PC0_PWM     nullptr
253 253
 
254 254
 #undef PC1
255 255
 #define PC1_PIN     PINC1
256 256
 #define PC1_RPORT   PINC
257 257
 #define PC1_WPORT   PORTC
258 258
 #define PC1_DDR     DDRC
259
-#define PC1_PWM     NULL
259
+#define PC1_PWM     nullptr
260 260
 
261 261
 #undef PC2
262 262
 #define PC2_PIN     PINC2
263 263
 #define PC2_RPORT   PINC
264 264
 #define PC2_WPORT   PORTC
265 265
 #define PC2_DDR     DDRC
266
-#define PC2_PWM     NULL
266
+#define PC2_PWM     nullptr
267 267
 
268 268
 #undef PC3
269 269
 #define PC3_PIN     PINC3
270 270
 #define PC3_RPORT   PINC
271 271
 #define PC3_WPORT   PORTC
272 272
 #define PC3_DDR     DDRC
273
-#define PC3_PWM     NULL
273
+#define PC3_PWM     nullptr
274 274
 
275 275
 #undef PC4
276 276
 #define PC4_PIN     PINC4
277 277
 #define PC4_RPORT   PINC
278 278
 #define PC4_WPORT   PORTC
279 279
 #define PC4_DDR     DDRC
280
-#define PC4_PWM     NULL
280
+#define PC4_PWM     nullptr
281 281
 
282 282
 #undef PC5
283 283
 #define PC5_PIN     PINC5
284 284
 #define PC5_RPORT   PINC
285 285
 #define PC5_WPORT   PORTC
286 286
 #define PC5_DDR     DDRC
287
-#define PC5_PWM     NULL
287
+#define PC5_PWM     nullptr
288 288
 
289 289
 #undef PC6
290 290
 #define PC6_PIN     PINC6
291 291
 #define PC6_RPORT   PINC
292 292
 #define PC6_WPORT   PORTC
293 293
 #define PC6_DDR     DDRC
294
-#define PC6_PWM     NULL
294
+#define PC6_PWM     nullptr
295 295
 
296 296
 #undef PC7
297 297
 #define PC7_PIN     PINC7
298 298
 #define PC7_RPORT   PINC
299 299
 #define PC7_WPORT   PORTC
300 300
 #define PC7_DDR     DDRC
301
-#define PC7_PWM     NULL
301
+#define PC7_PWM     nullptr
302 302
 
303 303
 #undef PD0
304 304
 #define PD0_PIN     PIND0
305 305
 #define PD0_RPORT   PIND
306 306
 #define PD0_WPORT   PORTD
307 307
 #define PD0_DDR     DDRD
308
-#define PD0_PWM     NULL
308
+#define PD0_PWM     nullptr
309 309
 
310 310
 #undef PD1
311 311
 #define PD1_PIN     PIND1
312 312
 #define PD1_RPORT   PIND
313 313
 #define PD1_WPORT   PORTD
314 314
 #define PD1_DDR     DDRD
315
-#define PD1_PWM     NULL
315
+#define PD1_PWM     nullptr
316 316
 
317 317
 #undef PD2
318 318
 #define PD2_PIN     PIND2
319 319
 #define PD2_RPORT   PIND
320 320
 #define PD2_WPORT   PORTD
321 321
 #define PD2_DDR     DDRD
322
-#define PD2_PWM     NULL
322
+#define PD2_PWM     nullptr
323 323
 
324 324
 #undef PD3
325 325
 #define PD3_PIN     PIND3
@@ -333,7 +333,7 @@
333 333
 #define PD4_RPORT   PIND
334 334
 #define PD4_WPORT   PORTD
335 335
 #define PD4_DDR     DDRD
336
-#define PD4_PWM     NULL
336
+#define PD4_PWM     nullptr
337 337
 
338 338
 #undef PD5
339 339
 #define PD5_PIN     PIND5
@@ -354,4 +354,4 @@
354 354
 #define PD7_RPORT   PIND
355 355
 #define PD7_WPORT   PORTD
356 356
 #define PD7_DDR     DDRD
357
-#define PD7_PWM     NULL
357
+#define PD7_PWM     nullptr

+ 72
- 72
Marlin/src/HAL/HAL_AVR/fastio_644.h View File

@@ -91,462 +91,462 @@
91 91
 #define DIO0_RPORT  PINB
92 92
 #define DIO0_WPORT  PORTB
93 93
 #define DIO0_DDR    DDRB
94
-#define DIO0_PWM    NULL
94
+#define DIO0_PWM    nullptr
95 95
 
96 96
 #define DIO1_PIN    PINB1
97 97
 #define DIO1_RPORT  PINB
98 98
 #define DIO1_WPORT  PORTB
99 99
 #define DIO1_DDR    DDRB
100
-#define DIO1_PWM    NULL
100
+#define DIO1_PWM    nullptr
101 101
 
102 102
 #define DIO2_PIN    PINB2
103 103
 #define DIO2_RPORT  PINB
104 104
 #define DIO2_WPORT  PORTB
105 105
 #define DIO2_DDR    DDRB
106
-#define DIO2_PWM    NULL
106
+#define DIO2_PWM    nullptr
107 107
 
108 108
 #define DIO3_PIN    PINB3
109 109
 #define DIO3_RPORT  PINB
110 110
 #define DIO3_WPORT  PORTB
111 111
 #define DIO3_DDR    DDRB
112
-#define DIO3_PWM    OCR0A
112
+#define DIO3_PWM    &OCR0A
113 113
 
114 114
 #define DIO4_PIN    PINB4
115 115
 #define DIO4_RPORT  PINB
116 116
 #define DIO4_WPORT  PORTB
117 117
 #define DIO4_DDR    DDRB
118
-#define DIO4_PWM    OCR0B
118
+#define DIO4_PWM    &OCR0B
119 119
 
120 120
 #define DIO5_PIN    PINB5
121 121
 #define DIO5_RPORT  PINB
122 122
 #define DIO5_WPORT  PORTB
123 123
 #define DIO5_DDR    DDRB
124
-#define DIO5_PWM    NULL
124
+#define DIO5_PWM    nullptr
125 125
 
126 126
 #define DIO6_PIN    PINB6
127 127
 #define DIO6_RPORT  PINB
128 128
 #define DIO6_WPORT  PORTB
129 129
 #define DIO6_DDR    DDRB
130
-#define DIO6_PWM    NULL
130
+#define DIO6_PWM    nullptr
131 131
 
132 132
 #define DIO7_PIN    PINB7
133 133
 #define DIO7_RPORT  PINB
134 134
 #define DIO7_WPORT  PORTB
135 135
 #define DIO7_DDR    DDRB
136
-#define DIO7_PWM    NULL
136
+#define DIO7_PWM    nullptr
137 137
 
138 138
 #define DIO8_PIN    PIND0
139 139
 #define DIO8_RPORT  PIND
140 140
 #define DIO8_WPORT  PORTD
141 141
 #define DIO8_DDR    DDRD
142
-#define DIO8_PWM    NULL
142
+#define DIO8_PWM    nullptr
143 143
 
144 144
 #define DIO9_PIN    PIND1
145 145
 #define DIO9_RPORT  PIND
146 146
 #define DIO9_WPORT  PORTD
147 147
 #define DIO9_DDR    DDRD
148
-#define DIO9_PWM    NULL
148
+#define DIO9_PWM    nullptr
149 149
 
150 150
 #define DIO10_PIN   PIND2
151 151
 #define DIO10_RPORT PIND
152 152
 #define DIO10_WPORT PORTD
153 153
 #define DIO10_DDR   DDRD
154
-#define DIO10_PWM   NULL
154
+#define DIO10_PWM   nullptr
155 155
 
156 156
 #define DIO11_PIN   PIND3
157 157
 #define DIO11_RPORT PIND
158 158
 #define DIO11_WPORT PORTD
159 159
 #define DIO11_DDR   DDRD
160
-#define DIO11_PWM   NULL
160
+#define DIO11_PWM   nullptr
161 161
 
162 162
 #define DIO12_PIN   PIND4
163 163
 #define DIO12_RPORT PIND
164 164
 #define DIO12_WPORT PORTD
165 165
 #define DIO12_DDR   DDRD
166
-#define DIO12_PWM   OCR1B
166
+#define DIO12_PWM   &OCR1B
167 167
 
168 168
 #define DIO13_PIN   PIND5
169 169
 #define DIO13_RPORT PIND
170 170
 #define DIO13_WPORT PORTD
171 171
 #define DIO13_DDR   DDRD
172
-#define DIO13_PWM   OCR1A
172
+#define DIO13_PWM   &OCR1A
173 173
 
174 174
 #define DIO14_PIN   PIND6
175 175
 #define DIO14_RPORT PIND
176 176
 #define DIO14_WPORT PORTD
177 177
 #define DIO14_DDR   DDRD
178
-#define DIO14_PWM   OCR2B
178
+#define DIO14_PWM   &OCR2B
179 179
 
180 180
 #define DIO15_PIN   PIND7
181 181
 #define DIO15_RPORT PIND
182 182
 #define DIO15_WPORT PORTD
183 183
 #define DIO15_DDR   DDRD
184
-#define DIO15_PWM   OCR2A
184
+#define DIO15_PWM   &OCR2A
185 185
 
186 186
 #define DIO16_PIN   PINC0
187 187
 #define DIO16_RPORT PINC
188 188
 #define DIO16_WPORT PORTC
189 189
 #define DIO16_DDR   DDRC
190
-#define DIO16_PWM   NULL
190
+#define DIO16_PWM   nullptr
191 191
 
192 192
 #define DIO17_PIN   PINC1
193 193
 #define DIO17_RPORT PINC
194 194
 #define DIO17_WPORT PORTC
195 195
 #define DIO17_DDR   DDRC
196
-#define DIO17_PWM   NULL
196
+#define DIO17_PWM   nullptr
197 197
 
198 198
 #define DIO18_PIN   PINC2
199 199
 #define DIO18_RPORT PINC
200 200
 #define DIO18_WPORT PORTC
201 201
 #define DIO18_DDR   DDRC
202
-#define DIO18_PWM   NULL
202
+#define DIO18_PWM   nullptr
203 203
 
204 204
 #define DIO19_PIN   PINC3
205 205
 #define DIO19_RPORT PINC
206 206
 #define DIO19_WPORT PORTC
207 207
 #define DIO19_DDR   DDRC
208
-#define DIO19_PWM   NULL
208
+#define DIO19_PWM   nullptr
209 209
 
210 210
 #define DIO20_PIN   PINC4
211 211
 #define DIO20_RPORT PINC
212 212
 #define DIO20_WPORT PORTC
213 213
 #define DIO20_DDR   DDRC
214
-#define DIO20_PWM   NULL
214
+#define DIO20_PWM   nullptr
215 215
 
216 216
 #define DIO21_PIN   PINC5
217 217
 #define DIO21_RPORT PINC
218 218
 #define DIO21_WPORT PORTC
219 219
 #define DIO21_DDR   DDRC
220
-#define DIO21_PWM   NULL
220
+#define DIO21_PWM   nullptr
221 221
 
222 222
 #define DIO22_PIN   PINC6
223 223
 #define DIO22_RPORT PINC
224 224
 #define DIO22_WPORT PORTC
225 225
 #define DIO22_DDR   DDRC
226
-#define DIO22_PWM   NULL
226
+#define DIO22_PWM   nullptr
227 227
 
228 228
 #define DIO23_PIN   PINC7
229 229
 #define DIO23_RPORT PINC
230 230
 #define DIO23_WPORT PORTC
231 231
 #define DIO23_DDR   DDRC
232
-#define DIO23_PWM   NULL
232
+#define DIO23_PWM   nullptr
233 233
 
234 234
 #define DIO24_PIN   PINA7
235 235
 #define DIO24_RPORT PINA
236 236
 #define DIO24_WPORT PORTA
237 237
 #define DIO24_DDR   DDRA
238
-#define DIO24_PWM   NULL
238
+#define DIO24_PWM   nullptr
239 239
 
240 240
 #define DIO25_PIN   PINA6
241 241
 #define DIO25_RPORT PINA
242 242
 #define DIO25_WPORT PORTA
243 243
 #define DIO25_DDR   DDRA
244
-#define DIO25_PWM   NULL
244
+#define DIO25_PWM   nullptr
245 245
 
246 246
 #define DIO26_PIN   PINA5
247 247
 #define DIO26_RPORT PINA
248 248
 #define DIO26_WPORT PORTA
249 249
 #define DIO26_DDR   DDRA
250
-#define DIO26_PWM   NULL
250
+#define DIO26_PWM   nullptr
251 251
 
252 252
 #define DIO27_PIN   PINA4
253 253
 #define DIO27_RPORT PINA
254 254
 #define DIO27_WPORT PORTA
255 255
 #define DIO27_DDR   DDRA
256
-#define DIO27_PWM   NULL
256
+#define DIO27_PWM   nullptr
257 257
 
258 258
 #define DIO28_PIN   PINA3
259 259
 #define DIO28_RPORT PINA
260 260
 #define DIO28_WPORT PORTA
261 261
 #define DIO28_DDR   DDRA
262
-#define DIO28_PWM   NULL
262
+#define DIO28_PWM   nullptr
263 263
 
264 264
 #define DIO29_PIN   PINA2
265 265
 #define DIO29_RPORT PINA
266 266
 #define DIO29_WPORT PORTA
267 267
 #define DIO29_DDR   DDRA
268
-#define DIO29_PWM   NULL
268
+#define DIO29_PWM   nullptr
269 269
 
270 270
 #define DIO30_PIN   PINA1
271 271
 #define DIO30_RPORT PINA
272 272
 #define DIO30_WPORT PORTA
273 273
 #define DIO30_DDR   DDRA
274
-#define DIO30_PWM   NULL
274
+#define DIO30_PWM   nullptr
275 275
 
276 276
 #define DIO31_PIN   PINA0
277 277
 #define DIO31_RPORT PINA
278 278
 #define DIO31_WPORT PORTA
279 279
 #define DIO31_DDR   DDRA
280
-#define DIO31_PWM   NULL
280
+#define DIO31_PWM   nullptr
281 281
 
282 282
 #define AIO0_PIN    PINA0
283 283
 #define AIO0_RPORT  PINA
284 284
 #define AIO0_WPORT  PORTA
285 285
 #define AIO0_DDR    DDRA
286
-#define AIO0_PWM    NULL
286
+#define AIO0_PWM    nullptr
287 287
 
288 288
 #define AIO1_PIN    PINA1
289 289
 #define AIO1_RPORT  PINA
290 290
 #define AIO1_WPORT  PORTA
291 291
 #define AIO1_DDR    DDRA
292
-#define AIO1_PWM    NULL
292
+#define AIO1_PWM    nullptr
293 293
 
294 294
 #define AIO2_PIN    PINA2
295 295
 #define AIO2_RPORT  PINA
296 296
 #define AIO2_WPORT  PORTA
297 297
 #define AIO2_DDR    DDRA
298
-#define AIO2_PWM    NULL
298
+#define AIO2_PWM    nullptr
299 299
 
300 300
 #define AIO3_PIN    PINA3
301 301
 #define AIO3_RPORT  PINA
302 302
 #define AIO3_WPORT  PORTA
303 303
 #define AIO3_DDR    DDRA
304
-#define AIO3_PWM    NULL
304
+#define AIO3_PWM    nullptr
305 305
 
306 306
 #define AIO4_PIN    PINA4
307 307
 #define AIO4_RPORT  PINA
308 308
 #define AIO4_WPORT  PORTA
309 309
 #define AIO4_DDR    DDRA
310
-#define AIO4_PWM    NULL
310
+#define AIO4_PWM    nullptr
311 311
 
312 312
 #define AIO5_PIN    PINA5
313 313
 #define AIO5_RPORT  PINA
314 314
 #define AIO5_WPORT  PORTA
315 315
 #define AIO5_DDR    DDRA
316
-#define AIO5_PWM    NULL
316
+#define AIO5_PWM    nullptr
317 317
 
318 318
 #define AIO6_PIN    PINA6
319 319
 #define AIO6_RPORT  PINA
320 320
 #define AIO6_WPORT  PORTA
321 321
 #define AIO6_DDR    DDRA
322
-#define AIO6_PWM    NULL
322
+#define AIO6_PWM    nullptr
323 323
 
324 324
 #define AIO7_PIN    PINA7
325 325
 #define AIO7_RPORT  PINA
326 326
 #define AIO7_WPORT  PORTA
327 327
 #define AIO7_DDR    DDRA
328
-#define AIO7_PWM    NULL
328
+#define AIO7_PWM    nullptr
329 329
 
330 330
 #undef PA0
331 331
 #define PA0_PIN     PINA0
332 332
 #define PA0_RPORT   PINA
333 333
 #define PA0_WPORT   PORTA
334 334
 #define PA0_DDR     DDRA
335
-#define PA0_PWM     NULL
335
+#define PA0_PWM     nullptr
336 336
 
337 337
 #undef PA1
338 338
 #define PA1_PIN     PINA1
339 339
 #define PA1_RPORT   PINA
340 340
 #define PA1_WPORT   PORTA
341 341
 #define PA1_DDR     DDRA
342
-#define PA1_PWM     NULL
342
+#define PA1_PWM     nullptr
343 343
 
344 344
 #undef PA2
345 345
 #define PA2_PIN     PINA2
346 346
 #define PA2_RPORT   PINA
347 347
 #define PA2_WPORT   PORTA
348 348
 #define PA2_DDR     DDRA
349
-#define PA2_PWM     NULL
349
+#define PA2_PWM     nullptr
350 350
 
351 351
 #undef PA3
352 352
 #define PA3_PIN     PINA3
353 353
 #define PA3_RPORT   PINA
354 354
 #define PA3_WPORT   PORTA
355 355
 #define PA3_DDR     DDRA
356
-#define PA3_PWM     NULL
356
+#define PA3_PWM     nullptr
357 357
 
358 358
 #undef PA4
359 359
 #define PA4_PIN     PINA4
360 360
 #define PA4_RPORT   PINA
361 361
 #define PA4_WPORT   PORTA
362 362
 #define PA4_DDR     DDRA
363
-#define PA4_PWM     NULL
363
+#define PA4_PWM     nullptr
364 364
 
365 365
 #undef PA5
366 366
 #define PA5_PIN     PINA5
367 367
 #define PA5_RPORT   PINA
368 368
 #define PA5_WPORT   PORTA
369 369
 #define PA5_DDR     DDRA
370
-#define PA5_PWM     NULL
370
+#define PA5_PWM     nullptr
371 371
 
372 372
 #undef PA6
373 373
 #define PA6_PIN     PINA6
374 374
 #define PA6_RPORT   PINA
375 375
 #define PA6_WPORT   PORTA
376 376
 #define PA6_DDR     DDRA
377
-#define PA6_PWM     NULL
377
+#define PA6_PWM     nullptr
378 378
 
379 379
 #undef PA7
380 380
 #define PA7_PIN     PINA7
381 381
 #define PA7_RPORT   PINA
382 382
 #define PA7_WPORT   PORTA
383 383
 #define PA7_DDR     DDRA
384
-#define PA7_PWM     NULL
384
+#define PA7_PWM     nullptr
385 385
 
386 386
 #undef PB0
387 387
 #define PB0_PIN     PINB0
388 388
 #define PB0_RPORT   PINB
389 389
 #define PB0_WPORT   PORTB
390 390
 #define PB0_DDR     DDRB
391
-#define PB0_PWM     NULL
391
+#define PB0_PWM     nullptr
392 392
 
393 393
 #undef PB1
394 394
 #define PB1_PIN     PINB1
395 395
 #define PB1_RPORT   PINB
396 396
 #define PB1_WPORT   PORTB
397 397
 #define PB1_DDR     DDRB
398
-#define PB1_PWM     NULL
398
+#define PB1_PWM     nullptr
399 399
 
400 400
 #undef PB2
401 401
 #define PB2_PIN     PINB2
402 402
 #define PB2_RPORT   PINB
403 403
 #define PB2_WPORT   PORTB
404 404
 #define PB2_DDR     DDRB
405
-#define PB2_PWM     NULL
405
+#define PB2_PWM     nullptr
406 406
 
407 407
 #undef PB3
408 408
 #define PB3_PIN     PINB3
409 409
 #define PB3_RPORT   PINB
410 410
 #define PB3_WPORT   PORTB
411 411
 #define PB3_DDR     DDRB
412
-#define PB3_PWM     OCR0A
412
+#define PB3_PWM     &OCR0A
413 413
 
414 414
 #undef PB4
415 415
 #define PB4_PIN     PINB4
416 416
 #define PB4_RPORT   PINB
417 417
 #define PB4_WPORT   PORTB
418 418
 #define PB4_DDR     DDRB
419
-#define PB4_PWM     OCR0B
419
+#define PB4_PWM     &OCR0B
420 420
 
421 421
 #undef PB5
422 422
 #define PB5_PIN     PINB5
423 423
 #define PB5_RPORT   PINB
424 424
 #define PB5_WPORT   PORTB
425 425
 #define PB5_DDR     DDRB
426
-#define PB5_PWM     NULL
426
+#define PB5_PWM     nullptr
427 427
 
428 428
 #undef PB6
429 429
 #define PB6_PIN     PINB6
430 430
 #define PB6_RPORT   PINB
431 431
 #define PB6_WPORT   PORTB
432 432
 #define PB6_DDR     DDRB
433
-#define PB6_PWM     NULL
433
+#define PB6_PWM     nullptr
434 434
 
435 435
 #undef PB7
436 436
 #define PB7_PIN     PINB7
437 437
 #define PB7_RPORT   PINB
438 438
 #define PB7_WPORT   PORTB
439 439
 #define PB7_DDR     DDRB
440
-#define PB7_PWM     NULL
440
+#define PB7_PWM     nullptr
441 441
 
442 442
 #undef PC0
443 443
 #define PC0_PIN     PINC0
444 444
 #define PC0_RPORT   PINC
445 445
 #define PC0_WPORT   PORTC
446 446
 #define PC0_DDR     DDRC
447
-#define PC0_PWM     NULL
447
+#define PC0_PWM     nullptr
448 448
 
449 449
 #undef PC1
450 450
 #define PC1_PIN     PINC1
451 451
 #define PC1_RPORT   PINC
452 452
 #define PC1_WPORT   PORTC
453 453
 #define PC1_DDR     DDRC
454
-#define PC1_PWM     NULL
454
+#define PC1_PWM     nullptr
455 455
 
456 456
 #undef PC2
457 457
 #define PC2_PIN     PINC2
458 458
 #define PC2_RPORT   PINC
459 459
 #define PC2_WPORT   PORTC
460 460
 #define PC2_DDR     DDRC
461
-#define PC2_PWM     NULL
461
+#define PC2_PWM     nullptr
462 462
 
463 463
 #undef PC3
464 464
 #define PC3_PIN     PINC3
465 465
 #define PC3_RPORT   PINC
466 466
 #define PC3_WPORT   PORTC
467 467
 #define PC3_DDR     DDRC
468
-#define PC3_PWM     NULL
468
+#define PC3_PWM     nullptr
469 469
 
470 470
 #undef PC4
471 471
 #define PC4_PIN     PINC4
472 472
 #define PC4_RPORT   PINC
473 473
 #define PC4_WPORT   PORTC
474 474
 #define PC4_DDR     DDRC
475
-#define PC4_PWM     NULL
475
+#define PC4_PWM     nullptr
476 476
 
477 477
 #undef PC5
478 478
 #define PC5_PIN     PINC5
479 479
 #define PC5_RPORT   PINC
480 480
 #define PC5_WPORT   PORTC
481 481
 #define PC5_DDR     DDRC
482
-#define PC5_PWM     NULL
482
+#define PC5_PWM     nullptr
483 483
 
484 484
 #undef PC6
485 485
 #define PC6_PIN     PINC6
486 486
 #define PC6_RPORT   PINC
487 487
 #define PC6_WPORT   PORTC
488 488
 #define PC6_DDR     DDRC
489
-#define PC6_PWM     NULL
489
+#define PC6_PWM     nullptr
490 490
 
491 491
 #undef PC7
492 492
 #define PC7_PIN     PINC7
493 493
 #define PC7_RPORT   PINC
494 494
 #define PC7_WPORT   PORTC
495 495
 #define PC7_DDR     DDRC
496
-#define PC7_PWM     NULL
496
+#define PC7_PWM     nullptr
497 497
 
498 498
 #undef PD0
499 499
 #define PD0_PIN     PIND0
500 500
 #define PD0_RPORT   PIND
501 501
 #define PD0_WPORT   PORTD
502 502
 #define PD0_DDR     DDRD
503
-#define PD0_PWM     NULL
503
+#define PD0_PWM     nullptr
504 504
 
505 505
 #undef PD1
506 506
 #define PD1_PIN     PIND1
507 507
 #define PD1_RPORT   PIND
508 508
 #define PD1_WPORT   PORTD
509 509
 #define PD1_DDR     DDRD
510
-#define PD1_PWM     NULL
510
+#define PD1_PWM     nullptr
511 511
 
512 512
 #undef PD2
513 513
 #define PD2_PIN     PIND2
514 514
 #define PD2_RPORT   PIND
515 515
 #define PD2_WPORT   PORTD
516 516
 #define PD2_DDR     DDRD
517
-#define PD2_PWM     NULL
517
+#define PD2_PWM     nullptr
518 518
 
519 519
 #undef PD3
520 520
 #define PD3_PIN     PIND3
521 521
 #define PD3_RPORT   PIND
522 522
 #define PD3_WPORT   PORTD
523 523
 #define PD3_DDR     DDRD
524
-#define PD3_PWM     NULL
524
+#define PD3_PWM     nullptr
525 525
 
526 526
 #undef PD4
527 527
 #define PD4_PIN     PIND4
528 528
 #define PD4_RPORT   PIND
529 529
 #define PD4_WPORT   PORTD
530 530
 #define PD4_DDR     DDRD
531
-#define PD4_PWM     NULL
531
+#define PD4_PWM     nullptr
532 532
 
533 533
 #undef PD5
534 534
 #define PD5_PIN     PIND5
535 535
 #define PD5_RPORT   PIND
536 536
 #define PD5_WPORT   PORTD
537 537
 #define PD5_DDR     DDRD
538
-#define PD5_PWM     NULL
538
+#define PD5_PWM     nullptr
539 539
 
540 540
 #undef PD6
541 541
 #define PD6_PIN     PIND6
542 542
 #define PD6_RPORT   PIND
543 543
 #define PD6_WPORT   PORTD
544 544
 #define PD6_DDR     DDRD
545
-#define PD6_PWM     OCR2B
545
+#define PD6_PWM     &OCR2B
546 546
 
547 547
 #undef PD7
548 548
 #define PD7_PIN     PIND7
549 549
 #define PD7_RPORT   PIND
550 550
 #define PD7_WPORT   PORTD
551 551
 #define PD7_DDR     DDRD
552
-#define PD7_PWM     OCR2A
552
+#define PD7_PWM     &OCR2A

+ 106
- 106
Marlin/src/HAL/HAL_AVR/fastio_AT90USB.h View File

@@ -45,325 +45,325 @@
45 45
 #define DIO0_PIN    PIND0
46 46
 #define DIO0_RPORT  PIND
47 47
 #define DIO0_WPORT  PORTD
48
-#define DIO0_PWM    NULL
48
+#define DIO0_PWM    0
49 49
 #define DIO0_DDR    DDRD
50 50
 
51 51
 #define DIO1_PIN    PIND1
52 52
 #define DIO1_RPORT  PIND
53 53
 #define DIO1_WPORT  PORTD
54
-#define DIO1_PWM    NULL
54
+#define DIO1_PWM    0
55 55
 #define DIO1_DDR    DDRD
56 56
 
57 57
 #define DIO2_PIN    PIND2
58 58
 #define DIO2_RPORT  PIND
59 59
 #define DIO2_WPORT  PORTD
60
-#define DIO2_PWM    NULL
60
+#define DIO2_PWM    0
61 61
 #define DIO2_DDR    DDRD
62 62
 
63 63
 #define DIO3_PIN    PIND3
64 64
 #define DIO3_RPORT  PIND
65 65
 #define DIO3_WPORT  PORTD
66
-#define DIO3_PWM    NULL
66
+#define DIO3_PWM    0
67 67
 #define DIO3_DDR    DDRD
68 68
 
69 69
 #define DIO4_PIN    PIND4
70 70
 #define DIO4_RPORT  PIND
71 71
 #define DIO4_WPORT  PORTD
72
-#define DIO4_PWM    NULL
72
+#define DIO4_PWM    0
73 73
 #define DIO4_DDR    DDRD
74 74
 
75 75
 #define DIO5_PIN    PIND5
76 76
 #define DIO5_RPORT  PIND
77 77
 #define DIO5_WPORT  PORTD
78
-#define DIO5_PWM    NULL
78
+#define DIO5_PWM    0
79 79
 #define DIO5_DDR    DDRD
80 80
 
81 81
 #define DIO6_PIN    PIND6
82 82
 #define DIO6_RPORT  PIND
83 83
 #define DIO6_WPORT  PORTD
84
-#define DIO6_PWM    NULL
84
+#define DIO6_PWM    0
85 85
 #define DIO6_DDR    DDRD
86 86
 
87 87
 #define DIO7_PIN    PIND7
88 88
 #define DIO7_RPORT  PIND
89 89
 #define DIO7_WPORT  PORTD
90
-#define DIO7_PWM    NULL
90
+#define DIO7_PWM    0
91 91
 #define DIO7_DDR    DDRD
92 92
 
93 93
 #define DIO8_PIN    PINE0
94 94
 #define DIO8_RPORT  PINE
95 95
 #define DIO8_WPORT  PORTE
96
-#define DIO8_PWM    NULL
96
+#define DIO8_PWM    0
97 97
 #define DIO8_DDR    DDRE
98 98
 
99 99
 #define DIO9_PIN    PINE1
100 100
 #define DIO9_RPORT  PINE
101 101
 #define DIO9_WPORT  PORTE
102
-#define DIO9_PWM    NULL
102
+#define DIO9_PWM    0
103 103
 #define DIO9_DDR    DDRE
104 104
 
105 105
 #define DIO10_PIN   PINC0
106 106
 #define DIO10_RPORT PINC
107 107
 #define DIO10_WPORT PORTC
108
-#define DIO10_PWM   NULL
108
+#define DIO10_PWM   0
109 109
 #define DIO10_DDR   DDRC
110 110
 
111 111
 #define DIO11_PIN   PINC1
112 112
 #define DIO11_RPORT PINC
113 113
 #define DIO11_WPORT PORTC
114
-#define DIO11_PWM   NULL
114
+#define DIO11_PWM   0
115 115
 #define DIO11_DDR   DDRC
116 116
 
117 117
 #define DIO12_PIN   PINC2
118 118
 #define DIO12_RPORT PINC
119 119
 #define DIO12_WPORT PORTC
120
-#define DIO12_PWM   NULL
120
+#define DIO12_PWM   0
121 121
 #define DIO12_DDR   DDRC
122 122
 
123 123
 #define DIO13_PIN   PINC3
124 124
 #define DIO13_RPORT PINC
125 125
 #define DIO13_WPORT PORTC
126
-#define DIO13_PWM   NULL
126
+#define DIO13_PWM   0
127 127
 #define DIO13_DDR   DDRC
128 128
 
129 129
 #define DIO14_PIN   PINC4
130 130
 #define DIO14_RPORT PINC
131 131
 #define DIO14_WPORT PORTC
132
-#define DIO14_PWM   NULL
132
+#define DIO14_PWM   0 // OC3C
133 133
 #define DIO14_DDR   DDRC
134 134
 
135 135
 #define DIO15_PIN   PINC5
136 136
 #define DIO15_RPORT PINC
137 137
 #define DIO15_WPORT PORTC
138
-#define DIO15_PWM   NULL
138
+#define DIO15_PWM   0 // OC3B
139 139
 #define DIO15_DDR   DDRC
140 140
 
141 141
 #define DIO16_PIN   PINC6
142 142
 #define DIO16_RPORT PINC
143 143
 #define DIO16_WPORT PORTC
144
-#define DIO16_PWM   NULL
144
+#define DIO16_PWM   0 // OC3A
145 145
 #define DIO16_DDR   DDRC
146 146
 
147 147
 #define DIO17_PIN   PINC7
148 148
 #define DIO17_RPORT PINC
149 149
 #define DIO17_WPORT PORTC
150
-#define DIO17_PWM   NULL
150
+#define DIO17_PWM   0
151 151
 #define DIO17_DDR   DDRC
152 152
 
153 153
 #define DIO18_PIN   PINE6
154 154
 #define DIO18_RPORT PINE
155 155
 #define DIO18_WPORT PORTE
156
-#define DIO18_PWM   NULL
156
+#define DIO18_PWM   0
157 157
 #define DIO18_DDR   DDRE
158 158
 
159 159
 #define DIO19_PIN   PINE7
160 160
 #define DIO19_RPORT PINE
161 161
 #define DIO19_WPORT PORTE
162
-#define DIO19_PWM   NULL
162
+#define DIO19_PWM   0
163 163
 #define DIO19_DDR   DDRE
164 164
 
165 165
 #define DIO20_PIN   PINB0
166 166
 #define DIO20_RPORT PINB
167 167
 #define DIO20_WPORT PORTB
168
-#define DIO20_PWM   NULL
168
+#define DIO20_PWM   0
169 169
 #define DIO20_DDR   DDRB
170 170
 
171 171
 #define DIO21_PIN   PINB1
172 172
 #define DIO21_RPORT PINB
173 173
 #define DIO21_WPORT PORTB
174
-#define DIO21_PWM   NULL
174
+#define DIO21_PWM   0
175 175
 #define DIO21_DDR   DDRB
176 176
 
177 177
 #define DIO22_PIN   PINB2
178 178
 #define DIO22_RPORT PINB
179 179
 #define DIO22_WPORT PORTB
180
-#define DIO22_PWM   NULL
180
+#define DIO22_PWM   0
181 181
 #define DIO22_DDR   DDRB
182 182
 
183 183
 #define DIO23_PIN   PINB3
184 184
 #define DIO23_RPORT PINB
185 185
 #define DIO23_WPORT PORTB
186
-#define DIO23_PWM   NULL
186
+#define DIO23_PWM   0
187 187
 #define DIO23_DDR   DDRB
188 188
 
189 189
 #define DIO24_PIN   PINB4
190 190
 #define DIO24_RPORT PINB
191 191
 #define DIO24_WPORT PORTB
192
-#define DIO24_PWM   NULL
192
+#define DIO24_PWM   0 // OC2A
193 193
 #define DIO24_DDR   DDRB
194 194
 
195 195
 #define DIO25_PIN   PINB5
196 196
 #define DIO25_RPORT PINB
197 197
 #define DIO25_WPORT PORTB
198
-#define DIO25_PWM   NULL
198
+#define DIO25_PWM   0 // OC1A
199 199
 #define DIO25_DDR   DDRB
200 200
 
201 201
 #define DIO26_PIN   PINB6
202 202
 #define DIO26_RPORT PINB
203 203
 #define DIO26_WPORT PORTB
204
-#define DIO26_PWM   NULL
204
+#define DIO26_PWM   0 // OC1B
205 205
 #define DIO26_DDR   DDRB
206 206
 
207 207
 #define DIO27_PIN   PINB7
208 208
 #define DIO27_RPORT PINB
209 209
 #define DIO27_WPORT PORTB
210
-#define DIO27_PWM   NULL
210
+#define DIO27_PWM   0 // OC1C
211 211
 #define DIO27_DDR   DDRB
212 212
 
213 213
 #define DIO28_PIN   PINA0
214 214
 #define DIO28_RPORT PINA
215 215
 #define DIO28_WPORT PORTA
216
-#define DIO28_PWM   NULL
216
+#define DIO28_PWM   0
217 217
 #define DIO28_DDR   DDRA
218 218
 
219 219
 #define DIO29_PIN   PINA1
220 220
 #define DIO29_RPORT PINA
221 221
 #define DIO29_WPORT PORTA
222
-#define DIO29_PWM   NULL
222
+#define DIO29_PWM   0
223 223
 #define DIO29_DDR   DDRA
224 224
 
225 225
 #define DIO30_PIN   PINA2
226 226
 #define DIO30_RPORT PINA
227 227
 #define DIO30_WPORT PORTA
228
-#define DIO30_PWM   NULL
228
+#define DIO30_PWM   0
229 229
 #define DIO30_DDR   DDRA
230 230
 
231 231
 #define DIO31_PIN   PINA3
232 232
 #define DIO31_RPORT PINA
233 233
 #define DIO31_WPORT PORTA
234
-#define DIO31_PWM   NULL
234
+#define DIO31_PWM   0
235 235
 #define DIO31_DDR   DDRA
236 236
 
237 237
 #define DIO32_PIN   PINA4
238 238
 #define DIO32_RPORT PINA
239 239
 #define DIO32_WPORT PORTA
240
-#define DIO32_PWM   NULL
240
+#define DIO32_PWM   0
241 241
 #define DIO32_DDR   DDRA
242 242
 
243 243
 #define DIO33_PIN   PINA5
244 244
 #define DIO33_RPORT PINA
245 245
 #define DIO33_WPORT PORTA
246
-#define DIO33_PWM   NULL
246
+#define DIO33_PWM   0
247 247
 #define DIO33_DDR   DDRA
248 248
 
249 249
 #define DIO34_PIN   PINA6
250 250
 #define DIO34_RPORT PINA
251 251
 #define DIO34_WPORT PORTA
252
-#define DIO34_PWM   NULL
252
+#define DIO34_PWM   0
253 253
 #define DIO34_DDR   DDRA
254 254
 
255 255
 #define DIO35_PIN   PINA7
256 256
 #define DIO35_RPORT PINA
257 257
 #define DIO35_WPORT PORTA
258
-#define DIO35_PWM   NULL
258
+#define DIO35_PWM   0
259 259
 #define DIO35_DDR   DDRA
260 260
 
261 261
 #define DIO36_PIN   PINE4
262 262
 #define DIO36_RPORT PINE
263 263
 #define DIO36_WPORT PORTE
264
-#define DIO36_PWM   NULL
264
+#define DIO36_PWM   0
265 265
 #define DIO36_DDR   DDRE
266 266
 
267 267
 #define DIO37_PIN   PINE5
268 268
 #define DIO37_RPORT PINE
269 269
 #define DIO37_WPORT PORTE
270
-#define DIO37_PWM   NULL
270
+#define DIO37_PWM   0
271 271
 #define DIO37_DDR   DDRE
272 272
 
273 273
 #define DIO38_PIN   PINF0
274 274
 #define DIO38_RPORT PINF
275 275
 #define DIO38_WPORT PORTF
276
-#define DIO38_PWM   NULL
276
+#define DIO38_PWM   0
277 277
 #define DIO38_DDR   DDRF
278 278
 
279 279
 #define DIO39_PIN   PINF1
280 280
 #define DIO39_RPORT PINF
281 281
 #define DIO39_WPORT PORTF
282
-#define DIO39_PWM   NULL
282
+#define DIO39_PWM   0
283 283
 #define DIO39_DDR   DDRF
284 284
 
285 285
 #define DIO40_PIN   PINF2
286 286
 #define DIO40_RPORT PINF
287 287
 #define DIO40_WPORT PORTF
288
-#define DIO40_PWM   NULL
288
+#define DIO40_PWM   0
289 289
 #define DIO40_DDR   DDRF
290 290
 
291 291
 #define DIO41_PIN   PINF3
292 292
 #define DIO41_RPORT PINF
293 293
 #define DIO41_WPORT PORTF
294
-#define DIO41_PWM   NULL
294
+#define DIO41_PWM   0
295 295
 #define DIO41_DDR   DDRF
296 296
 
297 297
 #define DIO42_PIN   PINF4
298 298
 #define DIO42_RPORT PINF
299 299
 #define DIO42_WPORT PORTF
300
-#define DIO42_PWM   NULL
300
+#define DIO42_PWM   0
301 301
 #define DIO42_DDR   DDRF
302 302
 
303 303
 #define DIO43_PIN   PINF5
304 304
 #define DIO43_RPORT PINF
305 305
 #define DIO43_WPORT PORTF
306
-#define DIO43_PWM   NULL
306
+#define DIO43_PWM   0
307 307
 #define DIO43_DDR   DDRF
308 308
 
309 309
 #define DIO44_PIN   PINF6
310 310
 #define DIO44_RPORT PINF
311 311
 #define DIO44_WPORT PORTF
312
-#define DIO44_PWM   NULL
312
+#define DIO44_PWM   0
313 313
 #define DIO44_DDR   DDRF
314 314
 
315 315
 #define DIO45_PIN   PINF7
316 316
 #define DIO45_RPORT PINF
317 317
 #define DIO45_WPORT PORTF
318
-#define DIO45_PWM   NULL
318
+#define DIO45_PWM   0
319 319
 #define DIO45_DDR   DDRF
320 320
 
321 321
 #define AIO0_PIN    PINF0
322 322
 #define AIO0_RPORT  PINF
323 323
 #define AIO0_WPORT  PORTF
324
-#define AIO0_PWM    NULL
324
+#define AIO0_PWM    0
325 325
 #define AIO0_DDR    DDRF
326 326
 
327 327
 #define AIO1_PIN    PINF1
328 328
 #define AIO1_RPORT  PINF
329 329
 #define AIO1_WPORT  PORTF
330
-#define AIO1_PWM    NULL
330
+#define AIO1_PWM    0
331 331
 #define AIO1_DDR    DDRF
332 332
 
333 333
 #define AIO2_PIN    PINF2
334 334
 #define AIO2_RPORT  PINF
335 335
 #define AIO2_WPORT  PORTF
336
-#define AIO2_PWM    NULL
336
+#define AIO2_PWM    0
337 337
 #define AIO2_DDR    DDRF
338 338
 
339 339
 #define AIO3_PIN    PINF3
340 340
 #define AIO3_RPORT  PINF
341 341
 #define AIO3_WPORT  PORTF
342
-#define AIO3_PWM    NULL
342
+#define AIO3_PWM    0
343 343
 #define AIO3_DDR    DDRF
344 344
 
345 345
 #define AIO4_PIN    PINF4
346 346
 #define AIO4_RPORT  PINF
347 347
 #define AIO4_WPORT  PORTF
348
-#define AIO4_PWM    NULL
348
+#define AIO4_PWM    0
349 349
 #define AIO4_DDR    DDRF
350 350
 
351 351
 #define AIO5_PIN    PINF5
352 352
 #define AIO5_RPORT  PINF
353 353
 #define AIO5_WPORT  PORTF
354
-#define AIO5_PWM    NULL
354
+#define AIO5_PWM    0
355 355
 #define AIO5_DDR    DDRF
356 356
 
357 357
 #define AIO6_PIN    PINF6
358 358
 #define AIO6_RPORT  PINF
359 359
 #define AIO6_WPORT  PORTF
360
-#define AIO6_PWM    NULL
360
+#define AIO6_PWM    0
361 361
 #define AIO6_DDR    DDRF
362 362
 
363 363
 #define AIO7_PIN    PINF7
364 364
 #define AIO7_RPORT  PINF
365 365
 #define AIO7_WPORT  PORTF
366
-#define AIO7_PWM    NULL
366
+#define AIO7_PWM    0
367 367
 #define AIO7_DDR    DDRF
368 368
 
369 369
 //-- Begin not supported by Teensyduino
@@ -371,13 +371,13 @@
371 371
 #define DIO46_PIN   PINE2
372 372
 #define DIO46_RPORT PINE
373 373
 #define DIO46_WPORT PORTE
374
-#define DIO46_PWM   NULL
374
+#define DIO46_PWM   0
375 375
 #define DIO46_DDR   DDRE
376 376
 
377 377
 #define DIO47_PIN   PINE3
378 378
 #define DIO47_RPORT PINE
379 379
 #define DIO47_WPORT PORTE
380
-#define DIO47_PWM   NULL
380
+#define DIO47_PWM   0
381 381
 #define DIO47_DDR   DDRE
382 382
 
383 383
 #define TEENSY_E2   46
@@ -389,300 +389,300 @@
389 389
 #define PA0_PIN     PINA0
390 390
 #define PA0_RPORT   PINA
391 391
 #define PA0_WPORT   PORTA
392
-#define PA0_PWM     NULL
392
+#define PA0_PWM     0
393 393
 #define PA0_DDR     DDRA
394 394
 #undef PA1
395 395
 #define PA1_PIN     PINA1
396 396
 #define PA1_RPORT   PINA
397 397
 #define PA1_WPORT   PORTA
398
-#define PA1_PWM     NULL
398
+#define PA1_PWM     0
399 399
 #define PA1_DDR     DDRA
400 400
 #undef PA2
401 401
 #define PA2_PIN     PINA2
402 402
 #define PA2_RPORT   PINA
403 403
 #define PA2_WPORT   PORTA
404
-#define PA2_PWM     NULL
404
+#define PA2_PWM     0
405 405
 #define PA2_DDR     DDRA
406 406
 #undef PA3
407 407
 #define PA3_PIN     PINA3
408 408
 #define PA3_RPORT   PINA
409 409
 #define PA3_WPORT   PORTA
410
-#define PA3_PWM     NULL
410
+#define PA3_PWM     0
411 411
 #define PA3_DDR     DDRA
412 412
 #undef PA4
413 413
 #define PA4_PIN     PINA4
414 414
 #define PA4_RPORT   PINA
415 415
 #define PA4_WPORT   PORTA
416
-#define PA4_PWM     NULL
416
+#define PA4_PWM     0
417 417
 #define PA4_DDR     DDRA
418 418
 #undef PA5
419 419
 #define PA5_PIN     PINA5
420 420
 #define PA5_RPORT   PINA
421 421
 #define PA5_WPORT   PORTA
422
-#define PA5_PWM     NULL
422
+#define PA5_PWM     0
423 423
 #define PA5_DDR     DDRA
424 424
 #undef PA6
425 425
 #define PA6_PIN     PINA6
426 426
 #define PA6_RPORT   PINA
427 427
 #define PA6_WPORT   PORTA
428
-#define PA6_PWM     NULL
428
+#define PA6_PWM     0
429 429
 #define PA6_DDR     DDRA
430 430
 #undef PA7
431 431
 #define PA7_PIN     PINA7
432 432
 #define PA7_RPORT   PINA
433 433
 #define PA7_WPORT   PORTA
434
-#define PA7_PWM     NULL
434
+#define PA7_PWM     0
435 435
 #define PA7_DDR     DDRA
436 436
 
437 437
 #undef PB0
438 438
 #define PB0_PIN     PINB0
439 439
 #define PB0_RPORT   PINB
440 440
 #define PB0_WPORT   PORTB
441
-#define PB0_PWM     NULL
441
+#define PB0_PWM     0
442 442
 #define PB0_DDR     DDRB
443 443
 #undef PB1
444 444
 #define PB1_PIN     PINB1
445 445
 #define PB1_RPORT   PINB
446 446
 #define PB1_WPORT   PORTB
447
-#define PB1_PWM     NULL
447
+#define PB1_PWM     0
448 448
 #define PB1_DDR     DDRB
449 449
 #undef PB2
450 450
 #define PB2_PIN     PINB2
451 451
 #define PB2_RPORT   PINB
452 452
 #define PB2_WPORT   PORTB
453
-#define PB2_PWM     NULL
453
+#define PB2_PWM     0
454 454
 #define PB2_DDR     DDRB
455 455
 #undef PB3
456 456
 #define PB3_PIN     PINB3
457 457
 #define PB3_RPORT   PINB
458 458
 #define PB3_WPORT   PORTB
459
-#define PB3_PWM     NULL
459
+#define PB3_PWM     0
460 460
 #define PB3_DDR     DDRB
461 461
 #undef PB4
462 462
 #define PB4_PIN     PINB4
463 463
 #define PB4_RPORT   PINB
464 464
 #define PB4_WPORT   PORTB
465
-#define PB4_PWM     NULL
465
+#define PB4_PWM     0
466 466
 #define PB4_DDR     DDRB
467 467
 #undef PB5
468 468
 #define PB5_PIN     PINB5
469 469
 #define PB5_RPORT   PINB
470 470
 #define PB5_WPORT   PORTB
471
-#define PB5_PWM     NULL
471
+#define PB5_PWM     0
472 472
 #define PB5_DDR     DDRB
473 473
 #undef PB6
474 474
 #define PB6_PIN     PINB6
475 475
 #define PB6_RPORT   PINB
476 476
 #define PB6_WPORT   PORTB
477
-#define PB6_PWM     NULL
477
+#define PB6_PWM     0
478 478
 #define PB6_DDR     DDRB
479 479
 #undef PB7
480 480
 #define PB7_PIN     PINB7
481 481
 #define PB7_RPORT   PINB
482 482
 #define PB7_WPORT   PORTB
483
-#define PB7_PWM     NULL
483
+#define PB7_PWM     0
484 484
 #define PB7_DDR     DDRB
485 485
 
486 486
 #undef PC0
487 487
 #define PC0_PIN     PINC0
488 488
 #define PC0_RPORT   PINC
489 489
 #define PC0_WPORT   PORTC
490
-#define PC0_PWM     NULL
490
+#define PC0_PWM     0
491 491
 #define PC0_DDR     DDRC
492 492
 #undef PC1
493 493
 #define PC1_PIN     PINC1
494 494
 #define PC1_RPORT   PINC
495 495
 #define PC1_WPORT   PORTC
496
-#define PC1_PWM     NULL
496
+#define PC1_PWM     0
497 497
 #define PC1_DDR     DDRC
498 498
 #undef PC2
499 499
 #define PC2_PIN     PINC2
500 500
 #define PC2_RPORT   PINC
501 501
 #define PC2_WPORT   PORTC
502
-#define PC2_PWM     NULL
502
+#define PC2_PWM     0
503 503
 #define PC2_DDR     DDRC
504 504
 #undef PC3
505 505
 #define PC3_PIN     PINC3
506 506
 #define PC3_RPORT   PINC
507 507
 #define PC3_WPORT   PORTC
508
-#define PC3_PWM     NULL
508
+#define PC3_PWM     0
509 509
 #define PC3_DDR     DDRC
510 510
 #undef PC4
511 511
 #define PC4_PIN     PINC4
512 512
 #define PC4_RPORT   PINC
513 513
 #define PC4_WPORT   PORTC
514
-#define PC4_PWM     NULL
514
+#define PC4_PWM     0
515 515
 #define PC4_DDR     DDRC
516 516
 #undef PC5
517 517
 #define PC5_PIN     PINC5
518 518
 #define PC5_RPORT   PINC
519 519
 #define PC5_WPORT   PORTC
520
-#define PC5_PWM     NULL
520
+#define PC5_PWM     0
521 521
 #define PC5_DDR     DDRC
522 522
 #undef PC6
523 523
 #define PC6_PIN     PINC6
524 524
 #define PC6_RPORT   PINC
525 525
 #define PC6_WPORT   PORTC
526
-#define PC6_PWM     NULL
526
+#define PC6_PWM     0
527 527
 #define PC6_DDR     DDRC
528 528
 #undef PC7
529 529
 #define PC7_PIN     PINC7
530 530
 #define PC7_RPORT   PINC
531 531
 #define PC7_WPORT   PORTC
532
-#define PC7_PWM     NULL
532
+#define PC7_PWM     0
533 533
 #define PC7_DDR     DDRC
534 534
 
535 535
 #undef PD0
536 536
 #define PD0_PIN     PIND0
537 537
 #define PD0_RPORT   PIND
538 538
 #define PD0_WPORT   PORTD
539
-#define PD0_PWM     NULL
539
+#define PD0_PWM     0 // OC0B
540 540
 #define PD0_DDR     DDRD
541 541
 #undef PD1
542 542
 #define PD1_PIN     PIND1
543 543
 #define PD1_RPORT   PIND
544 544
 #define PD1_WPORT   PORTD
545
-#define PD1_PWM     NULL
545
+#define PD1_PWM     0 // OC2B
546 546
 #define PD1_DDR     DDRD
547 547
 #undef PD2
548 548
 #define PD2_PIN     PIND2
549 549
 #define PD2_RPORT   PIND
550 550
 #define PD2_WPORT   PORTD
551
-#define PD2_PWM     NULL
551
+#define PD2_PWM     0
552 552
 #define PD2_DDR     DDRD
553 553
 #undef PD3
554 554
 #define PD3_PIN     PIND3
555 555
 #define PD3_RPORT   PIND
556 556
 #define PD3_WPORT   PORTD
557
-#define PD3_PWM     NULL
557
+#define PD3_PWM     0
558 558
 #define PD3_DDR     DDRD
559 559
 #undef PD4
560 560
 #define PD4_PIN     PIND4
561 561
 #define PD4_RPORT   PIND
562 562
 #define PD4_WPORT   PORTD
563
-#define PD4_PWM     NULL
563
+#define PD4_PWM     0
564 564
 #define PD4_DDR     DDRD
565 565
 #undef PD5
566 566
 #define PD5_PIN     PIND5
567 567
 #define PD5_RPORT   PIND
568 568
 #define PD5_WPORT   PORTD
569
-#define PD5_PWM     NULL
569
+#define PD5_PWM     0
570 570
 #define PD5_DDR     DDRD
571 571
 #undef PD6
572 572
 #define PD6_PIN     PIND6
573 573
 #define PD6_RPORT   PIND
574 574
 #define PD6_WPORT   PORTD
575
-#define PD6_PWM     NULL
575
+#define PD6_PWM     0
576 576
 #define PD6_DDR     DDRD
577 577
 #undef PD7
578 578
 #define PD7_PIN     PIND7
579 579
 #define PD7_RPORT   PIND
580 580
 #define PD7_WPORT   PORTD
581
-#define PD7_PWM     NULL
581
+#define PD7_PWM     0
582 582
 #define PD7_DDR     DDRD
583 583
 
584 584
 #undef PE0
585 585
 #define PE0_PIN     PINE0
586 586
 #define PE0_RPORT   PINE
587 587
 #define PE0_WPORT   PORTE
588
-#define PE0_PWM     NULL
588
+#define PE0_PWM     0
589 589
 #define PE0_DDR     DDRE
590 590
 #undef PE1
591 591
 #define PE1_PIN     PINE1
592 592
 #define PE1_RPORT   PINE
593 593
 #define PE1_WPORT   PORTE
594
-#define PE1_PWM     NULL
594
+#define PE1_PWM     0
595 595
 #define PE1_DDR     DDRE
596 596
 #undef PE2
597 597
 #define PE2_PIN     PINE2
598 598
 #define PE2_RPORT   PINE
599 599
 #define PE2_WPORT   PORTE
600
-#define PE2_PWM     NULL
600
+#define PE2_PWM     0
601 601
 #define PE2_DDR     DDRE
602 602
 #undef PE3
603 603
 #define PE3_PIN     PINE3
604 604
 #define PE3_RPORT   PINE
605 605
 #define PE3_WPORT   PORTE
606
-#define PE3_PWM     NULL
606
+#define PE3_PWM     0
607 607
 #define PE3_DDR     DDRE
608 608
 #undef PE4
609 609
 #define PE4_PIN     PINE4
610 610
 #define PE4_RPORT   PINE
611 611
 #define PE4_WPORT   PORTE
612
-#define PE4_PWM     NULL
612
+#define PE4_PWM     0
613 613
 #define PE4_DDR     DDRE
614 614
 #undef PE5
615 615
 #define PE5_PIN     PINE5
616 616
 #define PE5_RPORT   PINE
617 617
 #define PE5_WPORT   PORTE
618
-#define PE5_PWM     NULL
618
+#define PE5_PWM     0
619 619
 #define PE5_DDR     DDRE
620 620
 #undef PE6
621 621
 #define PE6_PIN     PINE6
622 622
 #define PE6_RPORT   PINE
623 623
 #define PE6_WPORT   PORTE
624
-#define PE6_PWM     NULL
624
+#define PE6_PWM     0
625 625
 #define PE6_DDR     DDRE
626 626
 #undef PE7
627 627
 #define PE7_PIN     PINE7
628 628
 #define PE7_RPORT   PINE
629 629
 #define PE7_WPORT   PORTE
630
-#define PE7_PWM     NULL
630
+#define PE7_PWM     0
631 631
 #define PE7_DDR     DDRE
632 632
 
633 633
 #undef PF0
634 634
 #define PF0_PIN     PINF0
635 635
 #define PF0_RPORT   PINF
636 636
 #define PF0_WPORT   PORTF
637
-#define PF0_PWM     NULL
637
+#define PF0_PWM     0
638 638
 #define PF0_DDR     DDRF
639 639
 #undef PF1
640 640
 #define PF1_PIN     PINF1
641 641
 #define PF1_RPORT   PINF
642 642
 #define PF1_WPORT   PORTF
643
-#define PF1_PWM     NULL
643
+#define PF1_PWM     0
644 644
 #define PF1_DDR     DDRF
645 645
 #undef PF2
646 646
 #define PF2_PIN     PINF2
647 647
 #define PF2_RPORT   PINF
648 648
 #define PF2_WPORT   PORTF
649
-#define PF2_PWM     NULL
649
+#define PF2_PWM     0
650 650
 #define PF2_DDR     DDRF
651 651
 #undef PF3
652 652
 #define PF3_PIN     PINF3
653 653
 #define PF3_RPORT   PINF
654 654
 #define PF3_WPORT   PORTF
655
-#define PF3_PWM     NULL
655
+#define PF3_PWM     0
656 656
 #define PF3_DDR     DDRF
657 657
 #undef PF4
658 658
 #define PF4_PIN     PINF4
659 659
 #define PF4_RPORT   PINF
660 660
 #define PF4_WPORT   PORTF
661
-#define PF4_PWM     NULL
661
+#define PF4_PWM     0
662 662
 #define PF4_DDR     DDRF
663 663
 #undef PF5
664 664
 #define PF5_PIN     PINF5
665 665
 #define PF5_RPORT   PINF
666 666
 #define PF5_WPORT   PORTF
667
-#define PF5_PWM     NULL
667
+#define PF5_PWM     0
668 668
 #define PF5_DDR     DDRF
669 669
 #undef PF6
670 670
 #define PF6_PIN     PINF6
671 671
 #define PF6_RPORT   PINF
672 672
 #define PF6_WPORT   PORTF
673
-#define PF6_PWM     NULL
673
+#define PF6_PWM     0
674 674
 #define PF6_DDR     DDRF
675 675
 #undef PF7
676 676
 #define PF7_PIN     PINF7
677 677
 #define PF7_RPORT   PINF
678 678
 #define PF7_WPORT   PORTF
679
-#define PF7_PWM     NULL
679
+#define PF7_PWM     0
680 680
 #define PF7_DDR     DDRF
681 681
 
682 682
 
683 683
 /**
684
- *  some of the pin mapping functions of the Teensduino extension to the Arduino IDE
685
- *  do not function the same as the other Arduino extensions
684
+ * Some of the pin mapping functions of the Teensduino extension to the Arduino IDE
685
+ * do not function the same as the other Arduino extensions.
686 686
  */
687 687
 
688 688
 //digitalPinToTimer(pin) function works like Arduino but Timers are not defined

+ 1
- 1
Marlin/src/HAL/HAL_AVR/fastio_AVR.h View File

@@ -83,7 +83,7 @@
83 83
 
84 84
 #define _IS_INPUT(IO)        !TEST(DIO ## IO ## _DDR, DIO ## IO ## _PIN)
85 85
 #define _IS_OUTPUT(IO)        TEST(DIO ## IO ## _DDR, DIO ## IO ## _PIN)
86
-#define _HAS_TIMER(IO)        DIO ## IO ## _PWM
86
+#define _HAS_TIMER(IO)        bool(DIO ## IO ## _PWM)
87 87
 
88 88
 // digitalRead/Write wrappers
89 89
 #ifdef FASTIO_EXT_START

+ 1
- 1
Marlin/src/HAL/HAL_DUE/G2_pins.h View File

@@ -248,7 +248,7 @@ const G2_PinDescription G2_g_APinDescription[] = {
248 248
   { PIOB, PIO_PB15A_CANRX1|PIO_PB14A_CANTX1, ID_PIOB, PIO_PERIPH_A, PIO_DEFAULT, (PIN_ATTR_DIGITAL|PIN_ATTR_COMBO), NO_ADC, NO_ADC, NOT_ON_PWM,  NOT_ON_TIMER },
249 249
 
250 250
   // END
251
-  { NULL, 0, 0, PIO_NOT_A_PIN, PIO_DEFAULT, 0, NO_ADC, NO_ADC, NOT_ON_PWM, NOT_ON_TIMER }
251
+  { nullptr, 0, 0, PIO_NOT_A_PIN, PIO_DEFAULT, 0, NO_ADC, NO_ADC, NOT_ON_PWM, NOT_ON_TIMER }
252 252
 };
253 253
 
254 254
 // This section replaces the FASTIO definitions of pins 34-41

+ 1
- 1
Marlin/src/HAL/HAL_DUE/InterruptVectors_Due.cpp View File

@@ -41,7 +41,7 @@
41 41
    practice, we need alignment to 256 bytes to make this work in all
42 42
    cases */
43 43
 __attribute__ ((aligned(256)))
44
-static DeviceVectors ram_tab = { NULL };
44
+static DeviceVectors ram_tab = { nullptr };
45 45
 
46 46
 /**
47 47
  * This function checks if the exception/interrupt table is already in SRAM or not.

+ 3
- 3
Marlin/src/HAL/HAL_ESP32/HAL_timers_ESP32.cpp View File

@@ -64,8 +64,8 @@ static timg_dev_t *TG[2] = {&TIMERG0, &TIMERG1};
64 64
 const tTimerConfig TimerConfig [NUM_HARDWARE_TIMERS] = {
65 65
   { TIMER_GROUP_0, TIMER_0, STEPPER_TIMER_PRESCALE, stepTC_Handler }, // 0 - Stepper
66 66
   { TIMER_GROUP_0, TIMER_1,    TEMP_TIMER_PRESCALE, tempTC_Handler }, // 1 - Temperature
67
-  { TIMER_GROUP_1, TIMER_0,                      1, NULL }, // 2
68
-  { TIMER_GROUP_1, TIMER_1,                      1, NULL }, // 3
67
+  { TIMER_GROUP_1, TIMER_0,                      1, nullptr }, // 2
68
+  { TIMER_GROUP_1, TIMER_1,                      1, nullptr }, // 3
69 69
 };
70 70
 
71 71
 // --------------------------------------------------------------------------
@@ -132,7 +132,7 @@ void HAL_timer_start(const uint8_t timer_num, uint32_t frequency) {
132 132
   timer_enable_intr(timer.group, timer.idx);
133 133
 
134 134
   // TODO need to deal with timer_group1_isr
135
-  timer_isr_register(timer.group, timer.idx, timer_group0_isr, (void*)timer.idx, NULL, NULL);
135
+  timer_isr_register(timer.group, timer.idx, timer_group0_isr, (void*)timer.idx, ESP_INTR_FLAG_INTRDISABLED, nullptr);
136 136
 
137 137
   timer_start(timer.group, timer.idx);
138 138
 }

+ 6
- 6
Marlin/src/HAL/HAL_ESP32/i2s.cpp View File

@@ -183,22 +183,22 @@ int i2s_init() {
183 183
 
184 184
   // Allocate the array of pointers to the buffers
185 185
   dma.buffers = (uint32_t **)malloc(sizeof(uint32_t*) * DMA_BUF_COUNT);
186
-  if (dma.buffers == NULL) return -1;
186
+  if (dma.buffers == nullptr) return -1;
187 187
 
188 188
   // Allocate each buffer that can be used by the DMA controller
189 189
   for (int buf_idx = 0; buf_idx < DMA_BUF_COUNT; buf_idx++) {
190 190
     dma.buffers[buf_idx] = (uint32_t*) heap_caps_calloc(1, DMA_BUF_LEN, MALLOC_CAP_DMA);
191
-    if (dma.buffers[buf_idx] == NULL) return -1;
191
+    if (dma.buffers[buf_idx] == nullptr) return -1;
192 192
   }
193 193
 
194 194
   // Allocate the array of DMA descriptors
195 195
   dma.desc = (lldesc_t**) malloc(sizeof(lldesc_t*) * DMA_BUF_COUNT);
196
-  if (dma.desc == NULL) return -1;
196
+  if (dma.desc == nullptr) return -1;
197 197
 
198 198
   // Allocate each DMA descriptor that will be used by the DMA controller
199 199
   for (int buf_idx = 0; buf_idx < DMA_BUF_COUNT; buf_idx++) {
200 200
     dma.desc[buf_idx] = (lldesc_t*) heap_caps_malloc(sizeof(lldesc_t), MALLOC_CAP_DMA);
201
-    if (dma.desc[buf_idx] == NULL) return -1;
201
+    if (dma.desc[buf_idx] == nullptr) return -1;
202 202
   }
203 203
 
204 204
   // Initialize
@@ -297,11 +297,11 @@ int i2s_init() {
297 297
 
298 298
   // Allocate and Enable the I2S interrupt
299 299
   intr_handle_t i2s_isr_handle;
300
-  esp_intr_alloc(ETS_I2S0_INTR_SOURCE, 0, i2s_intr_handler_default, NULL, &i2s_isr_handle);
300
+  esp_intr_alloc(ETS_I2S0_INTR_SOURCE, 0, i2s_intr_handler_default, nullptr, &i2s_isr_handle);
301 301
   esp_intr_enable(i2s_isr_handle);
302 302
 
303 303
   // Create the task that will feed the buffer
304
-  xTaskCreate(stepperTask, "StepperTask", 10000, NULL, 1, NULL);
304
+  xTaskCreate(stepperTask, "StepperTask", 10000, nullptr, 1, nullptr);
305 305
 
306 306
   // Route the i2s pins to the appropriate GPIO
307 307
   gpio_matrix_out_check(I2S_DATA, I2S0O_DATA_OUT23_IDX, 0, 0);

+ 4
- 4
Marlin/src/HAL/HAL_LINUX/hardware/Timer.cpp View File

@@ -51,7 +51,7 @@ void Timer::init(uint32_t sig_id, uint32_t sim_freq, callback_fn* fn) {
51 51
   sa.sa_flags = SA_SIGINFO;
52 52
   sa.sa_sigaction = Timer::handler;
53 53
   sigemptyset(&sa.sa_mask);
54
-  if (sigaction(SIGRTMIN, &sa, NULL) == -1) {
54
+  if (sigaction(SIGRTMIN, &sa, nullptr) == -1) {
55 55
     return; // todo: handle error
56 56
   }
57 57
 
@@ -74,7 +74,7 @@ void Timer::start(uint32_t frequency) {
74 74
 }
75 75
 
76 76
 void Timer::enable() {
77
-  if (sigprocmask(SIG_UNBLOCK, &mask, NULL) == -1) {
77
+  if (sigprocmask(SIG_UNBLOCK, &mask, nullptr) == -1) {
78 78
     return; // todo: handle error
79 79
   }
80 80
   active = true;
@@ -82,7 +82,7 @@ void Timer::enable() {
82 82
 }
83 83
 
84 84
 void Timer::disable() {
85
-  if (sigprocmask(SIG_SETMASK, &mask, NULL) == -1) {
85
+  if (sigprocmask(SIG_SETMASK, &mask, nullptr) == -1) {
86 86
     return; // todo: handle error
87 87
   }
88 88
   active = false;
@@ -102,7 +102,7 @@ void Timer::setCompare(uint32_t compare) {
102 102
   its.it_interval.tv_sec = its.it_value.tv_sec;
103 103
   its.it_interval.tv_nsec = its.it_value.tv_nsec;
104 104
 
105
-  if (timer_settime(timerid, 0, &its, NULL) == -1) {
105
+  if (timer_settime(timerid, 0, &its, nullptr) == -1) {
106 106
     printf("timer(%ld) failed, compare: %d(%ld)\n", getID(), compare, its.it_value.tv_nsec);
107 107
     return; // todo: handle error
108 108
   }

+ 2
- 2
Marlin/src/HAL/HAL_LINUX/persistent_store_impl.cpp View File

@@ -35,7 +35,7 @@ char filename[] = "eeprom.dat";
35 35
 bool PersistentStore::access_start() {
36 36
   const char eeprom_erase_value = 0xFF;
37 37
   FILE * eeprom_file = fopen(filename, "rb");
38
-  if (eeprom_file == NULL) return false;
38
+  if (eeprom_file == nullptr) return false;
39 39
 
40 40
   fseek(eeprom_file, 0L, SEEK_END);
41 41
   std::size_t file_size = ftell(eeprom_file);
@@ -54,7 +54,7 @@ bool PersistentStore::access_start() {
54 54
 
55 55
 bool PersistentStore::access_finish() {
56 56
   FILE * eeprom_file = fopen(filename, "wb");
57
-  if (eeprom_file == NULL) return false;
57
+  if (eeprom_file == nullptr) return false;
58 58
   fwrite(buffer, sizeof(uint8_t), sizeof(buffer), eeprom_file);
59 59
   fclose(eeprom_file);
60 60
   return true;

+ 1
- 1
Marlin/src/HAL/HAL_STM32F1/HAL.cpp View File

@@ -270,7 +270,7 @@ void HAL_adc_init(void) {
270 270
   adc.calibrate();
271 271
   adc.setSampleRate(ADC_SMPR_41_5); // ?
272 272
   adc.setPins(adc_pins, ADC_PIN_COUNT);
273
-  adc.setDMA(HAL_adc_results, (uint16_t)ADC_PIN_COUNT, (uint32_t)(DMA_MINC_MODE | DMA_CIRC_MODE), (void (*)())NULL);
273
+  adc.setDMA(HAL_adc_results, (uint16_t)ADC_PIN_COUNT, (uint32_t)(DMA_MINC_MODE | DMA_CIRC_MODE), nullptr);
274 274
   adc.setScanMode();
275 275
   adc.setContinuous();
276 276
   adc.startConversion();

+ 1
- 1
Marlin/src/HAL/HAL_STM32F1/HAL.h View File

@@ -129,7 +129,7 @@ void HAL_init();
129 129
 #endif
130 130
 
131 131
 #ifndef digitalPinHasPWM
132
-  #define digitalPinHasPWM(P) (PIN_MAP[P].timer_device != NULL)
132
+  #define digitalPinHasPWM(P) (PIN_MAP[P].timer_device != nullptr)
133 133
 #endif
134 134
 
135 135
 #define CRITICAL_SECTION_START  uint32_t primask = __get_primask(); (void)__iCliRetVal()

+ 1
- 1
Marlin/src/HAL/HAL_STM32F1/fastio_STM32F1.h View File

@@ -47,7 +47,7 @@
47 47
 
48 48
 #define IS_INPUT(IO)          (_GET_MODE(IO) == GPIO_INPUT_FLOATING || _GET_MODE(IO) == GPIO_INPUT_ANALOG || _GET_MODE(IO) == GPIO_INPUT_PU || _GET_MODE(IO) == GPIO_INPUT_PD)
49 49
 #define IS_OUTPUT(IO)         (_GET_MODE(IO) == GPIO_OUTPUT_PP)
50
-#define HAS_TIMER(IO)         (PIN_MAP[IO].timer_device != NULL)
50
+#define HAS_TIMER(IO)         (PIN_MAP[IO].timer_device != nullptr)
51 51
 
52 52
 #define PWM_PIN(P)              HAS_TIMER(P)
53 53
 #define USEABLE_HARDWARE_PWM(P) PWM_PIN(P)

+ 1
- 1
Marlin/src/HAL/HAL_STM32F1/u8g_com_stm32duino_fsmc.cpp View File

@@ -67,7 +67,7 @@ uint8_t u8g_com_stm32duino_fsmc_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, voi
67 67
       LCD_IO_Init(u8g->pin_list[U8G_PI_CS], u8g->pin_list[U8G_PI_A0]);
68 68
       u8g_Delay(100);
69 69
 
70
-      if (arg_ptr != NULL)
70
+      if (arg_ptr != nullptr)
71 71
         *((uint32_t *)arg_ptr) = LCD_IO_ReadData(LCD_READ_ID, 3);
72 72
 
73 73
       isCommand = 0;

+ 1
- 1
Marlin/src/HAL/HAL_STM32F4/HAL_spi_STM32F4.cpp View File

@@ -165,7 +165,7 @@ void spiSendBlock(uint8_t token, const uint8_t* buf) {
165 165
   #ifdef STM32GENERIC
166 166
     SPI.dmaSend(const_cast<uint8_t*>(buf), 512);
167 167
   #else
168
-    SPI.transfer((uint8_t*)buf, (uint8_t*)0, 512);
168
+    SPI.transfer((uint8_t*)buf, nullptr, 512);
169 169
   #endif
170 170
 
171 171
   SPI.endTransaction();

+ 1
- 1
Marlin/src/HAL/shared/backtrace/unwarm.cpp View File

@@ -93,7 +93,7 @@ bool UnwReportRetAddr(UnwState * const state, uint32_t addr) {
93 93
   UnwReport entry;
94 94
 
95 95
   // We found two acceptable values.
96
-  entry.name = NULL;
96
+  entry.name = nullptr;
97 97
   entry.address = addr & 0xFFFFFFFE; // Remove Thumb bit
98 98
   entry.function = 0;
99 99
 

+ 3
- 3
Marlin/src/HAL/shared/backtrace/unwarmbytab.cpp View File

@@ -47,17 +47,17 @@ static const UnwTabEntry *UnwTabSearchIndex(const UnwTabEntry *start, const UnwT
47 47
 }
48 48
 
49 49
 /*
50
- * Get the function name or NULL if not found
50
+ * Get the function name or nullptr if not found
51 51
  */
52 52
 static const char *UnwTabGetFunctionName(const UnwindCallbacks *cb, uint32_t address) {
53 53
   uint32_t flag_word = 0;
54 54
   if (!cb->readW(address-4,&flag_word))
55
-    return NULL;
55
+    return nullptr;
56 56
 
57 57
   if ((flag_word & 0xFF000000) == 0xFF000000) {
58 58
     return (const char *)(address - 4 - (flag_word & 0x00FFFFFF));
59 59
   }
60
-  return NULL;
60
+  return nullptr;
61 61
 }
62 62
 
63 63
 /**

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

@@ -728,7 +728,7 @@ void idle(
728 728
  * Kill all activity and lock the machine.
729 729
  * After this the machine will need to be reset.
730 730
  */
731
-void kill(PGM_P const lcd_msg/*=NULL*/) {
731
+void kill(PGM_P const lcd_msg/*=nullptr*/) {
732 732
   thermalManager.disable_all_heaters();
733 733
 
734 734
   SERIAL_ERROR_MSG(MSG_ERR_KILLED);

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

@@ -321,7 +321,7 @@ void disable_e_stepper(const uint8_t e);
321 321
 void disable_e_steppers();
322 322
 void disable_all_steppers();
323 323
 
324
-void kill(PGM_P const lcd_msg=NULL);
324
+void kill(PGM_P const lcd_msg=nullptr);
325 325
 void minkill();
326 326
 
327 327
 void quickstop_stepper();

+ 1
- 1
Marlin/src/core/serial.cpp View File

@@ -50,7 +50,7 @@ void serial_echopair_PGM(PGM_P const s_P, unsigned long v) { serialprintPGM(s_P)
50 50
 
51 51
 void serial_spaces(uint8_t count) { count *= (PROPORTIONAL_FONT_RATIO); while (count--) SERIAL_CHAR(' '); }
52 52
 
53
-void serial_ternary(const bool onoff, PGM_P const pre, PGM_P const on, PGM_P const off, PGM_P const post/*=NULL*/) {
53
+void serial_ternary(const bool onoff, PGM_P const pre, PGM_P const on, PGM_P const off, PGM_P const post/*=nullptr*/) {
54 54
   if (pre) serialprintPGM(pre);
55 55
   serialprintPGM(onoff ? on : off);
56 56
   if (post) serialprintPGM(post);

+ 2
- 2
Marlin/src/core/serial.h View File

@@ -174,7 +174,7 @@ inline void serial_echopair_PGM(PGM_P const s_P, void *v)   { serial_echopair_PG
174 174
 void serialprintPGM(PGM_P str);
175 175
 void serial_echo_start();
176 176
 void serial_error_start();
177
-void serial_ternary(const bool onoff, PGM_P const pre, PGM_P const on, PGM_P const off, PGM_P const post=NULL);
177
+void serial_ternary(const bool onoff, PGM_P const pre, PGM_P const on, PGM_P const off, PGM_P const post=nullptr);
178 178
 void serialprint_onoff(const bool onoff);
179 179
 void serialprintln_onoff(const bool onoff);
180 180
 void serialprint_truefalse(const bool tf);
@@ -185,4 +185,4 @@ void print_bin(const uint16_t val);
185 185
 void print_xyz(PGM_P const prefix, PGM_P const suffix, const float x, const float y, const float z);
186 186
 void print_xyz(PGM_P const prefix, PGM_P const suffix, const float xyz[]);
187 187
 #define SERIAL_POS(SUFFIX,VAR) do { print_xyz(PSTR("  " STRINGIFY(VAR) "="), PSTR(" : " SUFFIX "\n"), VAR); } while(0)
188
-#define SERIAL_XYZ(PREFIX,...) do { print_xyz(PSTR(PREFIX), NULL, __VA_ARGS__); } while(0)
188
+#define SERIAL_XYZ(PREFIX,...) do { print_xyz(PSTR(PREFIX), nullptr, __VA_ARGS__); } while(0)

+ 5
- 5
Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp View File

@@ -330,7 +330,7 @@
330 330
       else {
331 331
         while (g29_repetition_cnt--) {
332 332
           if (cnt > 20) { cnt = 0; idle(); }
333
-          const mesh_index_pair location = find_closest_mesh_point_of_type(REAL, g29_x_pos, g29_y_pos, USE_NOZZLE_AS_REFERENCE, NULL);
333
+          const mesh_index_pair location = find_closest_mesh_point_of_type(REAL, g29_x_pos, g29_y_pos, USE_NOZZLE_AS_REFERENCE, nullptr);
334 334
           if (location.x_index < 0) {
335 335
             // No more REACHABLE mesh points to invalidate, so we ASSUME the user
336 336
             // meant to invalidate the ENTIRE mesh, which cannot be done with
@@ -528,7 +528,7 @@
528 528
             }
529 529
             else {
530 530
               while (g29_repetition_cnt--) {  // this only populates reachable mesh points near
531
-                const mesh_index_pair location = find_closest_mesh_point_of_type(INVALID, g29_x_pos, g29_y_pos, USE_NOZZLE_AS_REFERENCE, NULL);
531
+                const mesh_index_pair location = find_closest_mesh_point_of_type(INVALID, g29_x_pos, g29_y_pos, USE_NOZZLE_AS_REFERENCE, nullptr);
532 532
                 if (location.x_index < 0) {
533 533
                   // No more REACHABLE INVALID mesh points to populate, so we ASSUME
534 534
                   // user meant to populate ALL INVALID mesh points to value
@@ -759,7 +759,7 @@
759 759
         if (do_furthest)
760 760
           location = find_furthest_invalid_mesh_point();
761 761
         else
762
-          location = find_closest_mesh_point_of_type(INVALID, rx, ry, USE_PROBE_AS_REFERENCE, NULL);
762
+          location = find_closest_mesh_point_of_type(INVALID, rx, ry, USE_PROBE_AS_REFERENCE, nullptr);
763 763
 
764 764
         if (location.x_index >= 0) {    // mesh point found and is reachable by probe
765 765
           const float rawx = mesh_index_to_xpos(location.x_index),
@@ -793,7 +793,7 @@
793 793
 
794 794
     typedef void (*clickFunc_t)();
795 795
 
796
-    bool click_and_hold(const clickFunc_t func=NULL) {
796
+    bool click_and_hold(const clickFunc_t func=nullptr) {
797 797
       if (ui.button_pressed()) {
798 798
         ui.quick_feedback(false);                // Preserve button state for click-and-hold
799 799
         const millis_t nxt = millis() + 1500UL;
@@ -891,7 +891,7 @@
891 891
 
892 892
       mesh_index_pair location;
893 893
       do {
894
-        location = find_closest_mesh_point_of_type(INVALID, rx, ry, USE_NOZZLE_AS_REFERENCE, NULL);
894
+        location = find_closest_mesh_point_of_type(INVALID, rx, ry, USE_NOZZLE_AS_REFERENCE, nullptr);
895 895
         // It doesn't matter if the probe can't reach the NAN location. This is a manual probe.
896 896
         if (location.x_index < 0 && location.y_index < 0) continue;
897 897
 

+ 1
- 1
Marlin/src/feature/host_actions.cpp View File

@@ -84,7 +84,7 @@ void host_action(const char * const pstr, const bool eol) {
84 84
   void host_action_prompt_button(const char * const pstr) { host_action_prompt_plus(PSTR("button"), pstr); }
85 85
   void host_action_prompt_end() { host_action_prompt(PSTR("end")); }
86 86
   void host_action_prompt_show() { host_action_prompt(PSTR("show")); }
87
-  void host_prompt_do(const PromptReason reason, const char * const pstr, const char * const pbtn/*=NULL*/) {
87
+  void host_prompt_do(const PromptReason reason, const char * const pstr, const char * const pbtn/*=nullptr*/) {
88 88
     host_prompt_reason = reason;
89 89
     host_action_prompt_end();
90 90
     host_action_prompt_begin(pstr);

+ 2
- 2
Marlin/src/feature/host_actions.h View File

@@ -64,8 +64,8 @@ void host_action(const char * const pstr, const bool eol=true);
64 64
   void host_action_prompt_button(const char * const pstr);
65 65
   void host_action_prompt_end();
66 66
   void host_action_prompt_show();
67
-  void host_prompt_do(const PromptReason type, const char * const pstr, const char * const pbtn=NULL);
68
-  inline void host_prompt_open(const PromptReason reason, const char * const pstr, const char * const pbtn=NULL) {
67
+  void host_prompt_do(const PromptReason type, const char * const pstr, const char * const pbtn=nullptr);
68
+  inline void host_prompt_open(const PromptReason reason, const char * const pstr, const char * const pbtn=nullptr) {
69 69
     if (host_prompt_reason == PROMPT_NOT_DEFINED) host_prompt_do(reason, pstr, pbtn);
70 70
   }
71 71
 

+ 1
- 1
Marlin/src/feature/twibus.cpp View File

@@ -162,7 +162,7 @@ void TWIBus::flush() {
162 162
     echodata(bytes, PSTR("i2c-receive"), 0);
163 163
   }
164 164
 
165
-  void TWIBus::reply(char str[]/*=NULL*/) {
165
+  void TWIBus::reply(char str[]/*=nullptr*/) {
166 166
     #if ENABLED(DEBUG_TWIBUS)
167 167
       debug(PSTR("reply"), str);
168 168
     #endif

+ 1
- 1
Marlin/src/feature/twibus.h View File

@@ -217,7 +217,7 @@ class TWIBus {
217 217
        * @details Send the buffer and clear it.
218 218
        *          If a string is passed, write it into the buffer first.
219 219
        */
220
-      void reply(char str[]=NULL);
220
+      void reply(char str[]=nullptr);
221 221
       inline void reply(const char str[]) { this->reply((char*)str); }
222 222
 
223 223
     #endif

+ 1
- 1
Marlin/src/gcode/bedlevel/ubl/M421.cpp View File

@@ -55,7 +55,7 @@ void GcodeSuite::M421() {
55 55
              hasQ = !hasZ && parser.seen('Q');
56 56
 
57 57
   if (hasC) {
58
-    const mesh_index_pair location = ubl.find_closest_mesh_point_of_type(REAL, current_position[X_AXIS], current_position[Y_AXIS], USE_NOZZLE_AS_REFERENCE, NULL);
58
+    const mesh_index_pair location = ubl.find_closest_mesh_point_of_type(REAL, current_position[X_AXIS], current_position[Y_AXIS], USE_NOZZLE_AS_REFERENCE, nullptr);
59 59
     ix = location.x_index;
60 60
     iy = location.y_index;
61 61
   }

+ 1
- 1
Marlin/src/gcode/calibrate/G425.cpp View File

@@ -205,7 +205,7 @@ float measuring_movement(const AxisEnum axis, const int dir, const bool stop_sta
205 205
  *   axis               in     - Axis along which the measurement will take place
206 206
  *   dir                in     - Direction along that axis (-1 or 1)
207 207
  *   stop_state         in     - Move until probe pin becomes this value
208
- *   backlash_ptr       in/out - When not NULL, measure and record axis backlash
208
+ *   backlash_ptr       in/out - When not nullptr, measure and record axis backlash
209 209
  *   uncertainty        in     - If uncertainty is CALIBRATION_MEASUREMENT_UNKNOWN, do a fast probe.
210 210
  */
211 211
 inline float measure(const AxisEnum axis, const int dir, const bool stop_state, float * const backlash_ptr, const float uncertainty) {

+ 2
- 2
Marlin/src/gcode/calibrate/M100.cpp View File

@@ -194,7 +194,7 @@ inline int check_for_free_memory_corruption(PGM_P const title) {
194 194
   }
195 195
   SERIAL_ECHOPAIR("  block_found=", block_cnt);
196 196
 
197
-  if (block_cnt != 1 || __brkval != NULL)
197
+  if (block_cnt != 1 || __brkval != nullptr)
198 198
     SERIAL_ECHOLNPGM("\nMemory Corruption detected in free memory area.");
199 199
 
200 200
   if (block_cnt == 0)       // Make sure the special case of no free blocks shows up as an
@@ -217,7 +217,7 @@ inline int check_for_free_memory_corruption(PGM_P const title) {
217 217
  */
218 218
 inline void free_memory_pool_report(char * const ptr, const int32_t size) {
219 219
   int32_t max_cnt = -1, block_cnt = 0;
220
-  char *max_addr = NULL;
220
+  char *max_addr = nullptr;
221 221
   // Find the longest block of test bytes in the buffer
222 222
   for (int32_t i = 0; i < size; i++) {
223 223
     char *addr = ptr + i;

+ 4
- 4
Marlin/src/gcode/parser.cpp View File

@@ -80,7 +80,7 @@ GCodeParser parser;
80 80
  * this may be optimized by commenting out ZERO(param)
81 81
  */
82 82
 void GCodeParser::reset() {
83
-  string_arg = NULL;                    // No whole line argument
83
+  string_arg = nullptr;                 // No whole line argument
84 84
   command_letter = '?';                 // No command letter
85 85
   codenum = 0;                          // No command code
86 86
   #if USE_GCODE_SUBCODES
@@ -245,7 +245,7 @@ void GCodeParser::parse(char *p) {
245 245
    * This allows M0/M1 with expire time to work: "M0 S5 You Win!"
246 246
    * For 'M118' you must use 'E1' and 'A1' rather than just 'E' or 'A'
247 247
    */
248
-  string_arg = NULL;
248
+  string_arg = nullptr;
249 249
   while (const char code = *p++) {                    // Get the next parameter. A NUL ends the loop
250 250
 
251 251
     // Special handling for M32 [P] !/path/to/file.g#
@@ -289,7 +289,7 @@ void GCodeParser::parse(char *p) {
289 289
       #endif
290 290
 
291 291
       #if ENABLED(FASTER_GCODE_PARSER)
292
-        set(code, has_num ? p : NULL);          // Set parameter exists and pointer (NULL for no number)
292
+        set(code, has_num ? p : nullptr);       // Set parameter exists and pointer (nullptr for no number)
293 293
       #endif
294 294
     }
295 295
     else if (!string_arg) {                     // Not A-Z? First time, keep as the string_arg
@@ -315,7 +315,7 @@ void GCodeParser::parse(char *p) {
315 315
       if (next_command) {
316 316
         while (*next_command && *next_command != ' ') ++next_command;
317 317
         while (*next_command == ' ') ++next_command;
318
-        if (!*next_command) next_command = NULL;
318
+        if (!*next_command) next_command = nullptr;
319 319
       }
320 320
     #else
321 321
       const char *next_command = command_args;

+ 7
- 7
Marlin/src/gcode/parser.h View File

@@ -135,7 +135,7 @@ public:
135 135
       const bool b = TEST32(codebits, ind);
136 136
       if (b) {
137 137
         char * const ptr = command_ptr + param[ind];
138
-        value_ptr = param[ind] && valid_float(ptr) ? ptr : (char*)NULL;
138
+        value_ptr = param[ind] && valid_float(ptr) ? ptr : nullptr;
139 139
       }
140 140
       return b;
141 141
     }
@@ -178,7 +178,7 @@ public:
178 178
     static inline bool seen(const char c) {
179 179
       char *p = strchr(command_args, c);
180 180
       const bool b = !!p;
181
-      if (b) value_ptr = valid_float(&p[1]) ? &p[1] : (char*)NULL;
181
+      if (b) value_ptr = valid_float(&p[1]) ? &p[1] : nullptr;
182 182
       return b;
183 183
     }
184 184
 
@@ -210,7 +210,7 @@ public:
210 210
   #endif
211 211
 
212 212
   // The code value pointer was set
213
-  FORCE_INLINE static bool has_value() { return value_ptr != NULL; }
213
+  FORCE_INLINE static bool has_value() { return value_ptr != nullptr; }
214 214
 
215 215
   // Seen a parameter with a value
216 216
   static inline bool seenval(const char c) { return seen(c) && has_value(); }
@@ -224,20 +224,20 @@ public:
224 224
         if (c == '\0' || c == ' ') break;
225 225
         if (c == 'E' || c == 'e') {
226 226
           *e = '\0';
227
-          const float ret = strtof(value_ptr, NULL);
227
+          const float ret = strtof(value_ptr, nullptr);
228 228
           *e = c;
229 229
           return ret;
230 230
         }
231 231
         ++e;
232 232
       }
233
-      return strtof(value_ptr, NULL);
233
+      return strtof(value_ptr, nullptr);
234 234
     }
235 235
     return 0;
236 236
   }
237 237
 
238 238
   // Code value as a long or ulong
239
-  static inline int32_t value_long() { return value_ptr ? strtol(value_ptr, NULL, 10) : 0L; }
240
-  static inline uint32_t value_ulong() { return value_ptr ? strtoul(value_ptr, NULL, 10) : 0UL; }
239
+  static inline int32_t value_long() { return value_ptr ? strtol(value_ptr, nullptr, 10) : 0L; }
240
+  static inline uint32_t value_ulong() { return value_ptr ? strtoul(value_ptr, nullptr, 10) : 0UL; }
241 241
 
242 242
   // Code value for use as time
243 243
   static inline millis_t value_millis() { return value_ulong(); }

+ 10
- 10
Marlin/src/gcode/queue.cpp View File

@@ -76,11 +76,11 @@ static int serial_count[NUM_SERIAL] = { 0 };
76 76
 bool send_ok[BUFSIZE];
77 77
 
78 78
 /**
79
- * Next Injected Command pointer. NULL if no commands are being injected.
79
+ * Next Injected Command pointer. nullptr if no commands are being injected.
80 80
  * Used by Marlin internally to ensure that commands initiated from within
81 81
  * are enqueued ahead of any pending serial or sd card commands.
82 82
  */
83
-static PGM_P injected_commands_P = NULL;
83
+static PGM_P injected_commands_P = nullptr;
84 84
 
85 85
 void queue_setup() {
86 86
   // Send "ok" after commands by default
@@ -157,7 +157,7 @@ bool enqueue_and_echo_command(const char* cmd) {
157 157
  * Return true if any immediate commands remain to inject.
158 158
  */
159 159
 static bool drain_injected_commands_P() {
160
-  if (injected_commands_P != NULL) {
160
+  if (injected_commands_P != nullptr) {
161 161
     size_t i = 0;
162 162
     char c, cmd[60];
163 163
     strncpy_P(cmd, injected_commands_P, sizeof(cmd) - 1);
@@ -165,9 +165,9 @@ static bool drain_injected_commands_P() {
165 165
     while ((c = cmd[i]) && c != '\n') i++; // find the end of this gcode command
166 166
     cmd[i] = '\0';
167 167
     if (enqueue_and_echo_command(cmd))     // success?
168
-      injected_commands_P = c ? injected_commands_P + i + 1 : NULL; // next command or done
168
+      injected_commands_P = c ? injected_commands_P + i + 1 : nullptr; // next command or done
169 169
   }
170
-  return (injected_commands_P != NULL);    // return whether any more remain
170
+  return (injected_commands_P != nullptr);    // return whether any more remain
171 171
 }
172 172
 
173 173
 /**
@@ -597,18 +597,18 @@ inline void get_serial_commands() {
597 597
         char* command = serial_line_buffer[i];
598 598
 
599 599
         while (*command == ' ') command++;                // Skip leading spaces
600
-        char *npos = (*command == 'N') ? command : NULL;  // Require the N parameter to start the line
600
+        char *npos = (*command == 'N') ? command : nullptr;  // Require the N parameter to start the line
601 601
 
602 602
         if (npos) {
603 603
 
604
-          bool M110 = strstr_P(command, PSTR("M110")) != NULL;
604
+          bool M110 = strstr_P(command, PSTR("M110")) != nullptr;
605 605
 
606 606
           if (M110) {
607 607
             char* n2pos = strchr(command + 4, 'N');
608 608
             if (n2pos) npos = n2pos;
609 609
           }
610 610
 
611
-          gcode_N = strtol(npos + 1, NULL, 10);
611
+          gcode_N = strtol(npos + 1, nullptr, 10);
612 612
 
613 613
           if (gcode_N != gcode_LastN + 1 && !M110)
614 614
             return gcode_line_error(PSTR(MSG_ERR_LINE_NO), i);
@@ -617,7 +617,7 @@ inline void get_serial_commands() {
617 617
           if (apos) {
618 618
             uint8_t checksum = 0, count = uint8_t(apos - command);
619 619
             while (count) checksum ^= command[--count];
620
-            if (strtol(apos + 1, NULL, 10) != checksum)
620
+            if (strtol(apos + 1, nullptr, 10) != checksum)
621 621
               return gcode_line_error(PSTR(MSG_ERR_CHECKSUM_MISMATCH), i);
622 622
           }
623 623
           else
@@ -635,7 +635,7 @@ inline void get_serial_commands() {
635 635
         if (IsStopped()) {
636 636
           char* gpos = strchr(command, 'G');
637 637
           if (gpos) {
638
-            switch (strtol(gpos + 1, NULL, 10)) {
638
+            switch (strtol(gpos + 1, nullptr, 10)) {
639 639
               case 0:
640 640
               case 1:
641 641
               #if ENABLED(ARC_SUPPORT)

+ 3
- 3
Marlin/src/inc/SanityCheck.h View File

@@ -560,7 +560,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
560 560
 #endif
561 561
 
562 562
 #if defined(EVENT_GCODE_SD_STOP) && DISABLED(NOZZLE_PARK_FEATURE)
563
-  static_assert(NULL == strstr(EVENT_GCODE_SD_STOP, "G27"), "NOZZLE_PARK_FEATURE is required to use G27 in EVENT_GCODE_SD_STOP.");
563
+  static_assert(nullptr == strstr(EVENT_GCODE_SD_STOP, "G27"), "NOZZLE_PARK_FEATURE is required to use G27 in EVENT_GCODE_SD_STOP.");
564 564
 #endif
565 565
 
566 566
 /**
@@ -620,7 +620,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
620 620
   #elif FILAMENT_RUNOUT_DISTANCE_MM < 0
621 621
     #error "FILAMENT_RUNOUT_DISTANCE_MM must be greater than or equal to zero."
622 622
   #elif DISABLED(ADVANCED_PAUSE_FEATURE)
623
-    static_assert(NULL == strstr(FILAMENT_RUNOUT_SCRIPT, "M600"), "ADVANCED_PAUSE_FEATURE is required to use M600 with FILAMENT_RUNOUT_SENSOR.");
623
+    static_assert(nullptr == strstr(FILAMENT_RUNOUT_SCRIPT, "M600"), "ADVANCED_PAUSE_FEATURE is required to use M600 with FILAMENT_RUNOUT_SENSOR.");
624 624
   #endif
625 625
 #endif
626 626
 
@@ -2176,7 +2176,7 @@ static_assert(   _ARR_TEST(3,0) && _ARR_TEST(3,1) && _ARR_TEST(3,2)
2176 2176
   #elif EXTRUDERS != 5
2177 2177
     #error "PRUSA_MMU2 requires EXTRUDERS = 5."
2178 2178
   #elif DISABLED(ADVANCED_PAUSE_FEATURE)
2179
-    static_assert(NULL == strstr(MMU2_FILAMENT_RUNOUT_SCRIPT, "M600"), "ADVANCED_PAUSE_FEATURE is required to use M600 with PRUSA_MMU2.");
2179
+    static_assert(nullptr == strstr(MMU2_FILAMENT_RUNOUT_SCRIPT, "M600"), "ADVANCED_PAUSE_FEATURE is required to use M600 with PRUSA_MMU2.");
2180 2180
   #endif
2181 2181
 #endif
2182 2182
 

+ 2
- 2
Marlin/src/lcd/HD44780/lcdprint_hd44780.cpp View File

@@ -889,7 +889,7 @@ int lcd_put_wchar_max(wchar_t c, pixel_len_t max_length) {
889 889
   int ret;
890 890
   size_t idx = 0;
891 891
   hd44780_charmap_t pinval;
892
-  hd44780_charmap_t *copy_address = NULL;
892
+  hd44780_charmap_t *copy_address = nullptr;
893 893
   pinval.uchar = c;
894 894
   pinval.idx = -1;
895 895
 
@@ -900,7 +900,7 @@ int lcd_put_wchar_max(wchar_t c, pixel_len_t max_length) {
900 900
     lcd.write((uint8_t)c);
901 901
     return 1;
902 902
   }
903
-  copy_address = NULL;
903
+  copy_address = nullptr;
904 904
   ret = pf_bsearch_r((void *)g_hd44780_charmap_device, COUNT(g_hd44780_charmap_device), pf_bsearch_cb_comp_hd4map_pgm, (void *)&pinval, &idx);
905 905
   if (ret >= 0) {
906 906
     copy_address = (hd44780_charmap_t *)(g_hd44780_charmap_device + idx);

+ 3
- 3
Marlin/src/lcd/HD44780/ultralcd_HD44780.cpp View File

@@ -992,7 +992,7 @@ void MarlinUI::draw_status_screen() {
992 992
 
993 993
   #endif // ADVANCED_PAUSE_FEATURE
994 994
 
995
-  void draw_menu_item_static(const uint8_t row, PGM_P pstr, const bool center/*=true*/, const bool invert/*=false*/, const char *valstr/*=NULL*/) {
995
+  void draw_menu_item_static(const uint8_t row, PGM_P pstr, const bool center/*=true*/, const bool invert/*=false*/, const char *valstr/*=nullptr*/) {
996 996
     UNUSED(invert);
997 997
     int8_t n = LCD_WIDTH;
998 998
     lcd_moveto(0, row);
@@ -1024,10 +1024,10 @@ void MarlinUI::draw_status_screen() {
1024 1024
     if (pgm) lcd_put_u8str_P(data); else lcd_put_u8str(data);
1025 1025
   }
1026 1026
 
1027
-  void draw_edit_screen(PGM_P const pstr, const char* const value/*=NULL*/) {
1027
+  void draw_edit_screen(PGM_P const pstr, const char* const value/*=nullptr*/) {
1028 1028
     lcd_moveto(0, 1);
1029 1029
     lcd_put_u8str_P(pstr);
1030
-    if (value != NULL) {
1030
+    if (value != nullptr) {
1031 1031
       lcd_put_wchar(':');
1032 1032
       int len = utf8_strlen(value);
1033 1033
       const uint8_t valrow = (utf8_strlen_P(pstr) + 1 + len + 1) > (LCD_WIDTH - 2) ? 2 : 1;   // Value on the next row if it won't fit

+ 6
- 6
Marlin/src/lcd/dogm/u8g_fontutf8.cpp View File

@@ -64,10 +64,10 @@ static const font_t* fontgroup_find(font_group_t * root, wchar_t val) {
64 64
   uxg_fontinfo_t vcmp = {(uint16_t)(val / 128), (uint8_t)(val % 128 + 128), (uint8_t)(val % 128 + 128), 0, 0};
65 65
   size_t idx = 0;
66 66
 
67
-  if (val < 256) return NULL;
67
+  if (val < 256) return nullptr;
68 68
 
69 69
   if (pf_bsearch_r((void*)root->m_fntifo, root->m_fntinfo_num, pf_bsearch_cb_comp_fntifo_pgm, (void*)&vcmp, &idx) < 0)
70
-    return NULL;
70
+    return nullptr;
71 71
 
72 72
   memcpy_P(&vcmp, root->m_fntifo + idx, sizeof(vcmp));
73 73
   return vcmp.fntdata;
@@ -114,7 +114,7 @@ static void fontgroup_drawstring(font_group_t *group, const font_t *fnt_default,
114 114
 }
115 115
 
116 116
 static bool flag_fontgroup_was_inited = false;
117
-static font_group_t g_fontgroup_root = {NULL, 0};
117
+static font_group_t g_fontgroup_root = { nullptr, 0 };
118 118
 
119 119
 /**
120 120
  * @brief check if font is loaded
@@ -176,7 +176,7 @@ unsigned int uxg_DrawWchar(u8g_t *pu8g, unsigned int x, unsigned int y, wchar_t
176 176
   data.y = y;
177 177
   data.adv = 0;
178 178
   data.max_width = max_width;
179
-  data.fnt_prev = NULL;
179
+  data.fnt_prev = nullptr;
180 180
   fontgroup_drawwchar(group, fnt_default, ch, (void*)&data, fontgroup_cb_draw_u8g);
181 181
   u8g_SetFont(pu8g, (const u8g_fntpgm_uint8_t*)fnt_default);
182 182
 
@@ -210,7 +210,7 @@ unsigned int uxg_DrawUtf8Str(u8g_t *pu8g, unsigned int x, unsigned int y, const
210 210
   data.y = y;
211 211
   data.adv = 0;
212 212
   data.max_width = max_width;
213
-  data.fnt_prev = NULL;
213
+  data.fnt_prev = nullptr;
214 214
   fontgroup_drawstring(group, fnt_default, utf8_msg, read_byte_ram, (void*)&data, fontgroup_cb_draw_u8g);
215 215
   u8g_SetFont(pu8g, (const u8g_fntpgm_uint8_t*)fnt_default);
216 216
 
@@ -244,7 +244,7 @@ unsigned int uxg_DrawUtf8StrP(u8g_t *pu8g, unsigned int x, unsigned int y, PGM_P
244 244
   data.y = y;
245 245
   data.adv = 0;
246 246
   data.max_width = max_width;
247
-  data.fnt_prev = NULL;
247
+  data.fnt_prev = nullptr;
248 248
   fontgroup_drawstring(group, fnt_default, utf8_msg, read_byte_rom, (void*)&data, fontgroup_cb_draw_u8g);
249 249
   u8g_SetFont(pu8g, (const u8g_fntpgm_uint8_t*)fnt_default);
250 250
 

+ 3
- 3
Marlin/src/lcd/dogm/ultralcd_DOGM.cpp View File

@@ -330,7 +330,7 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop
330 330
   }
331 331
 
332 332
   // Draw a static line of text in the same idiom as a menu item
333
-  void draw_menu_item_static(const uint8_t row, PGM_P pstr, const bool center/*=true*/, const bool invert/*=false*/, const char* valstr/*=NULL*/) {
333
+  void draw_menu_item_static(const uint8_t row, PGM_P pstr, const bool center/*=true*/, const bool invert/*=false*/, const char* valstr/*=nullptr*/) {
334 334
 
335 335
     if (mark_as_selected(row, invert)) {
336 336
 
@@ -373,7 +373,7 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop
373 373
     }
374 374
   }
375 375
 
376
-  void draw_edit_screen(PGM_P const pstr, const char* const value/*=NULL*/) {
376
+  void draw_edit_screen(PGM_P const pstr, const char* const value/*=nullptr*/) {
377 377
     const uint8_t labellen = utf8_strlen_P(pstr), vallen = utf8_strlen(value);
378 378
 
379 379
     bool extra_row = labellen > LCD_WIDTH - 2 - vallen;
@@ -410,7 +410,7 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop
410 410
     }
411 411
 
412 412
     // If a value is included, print a colon, then print the value right-justified
413
-    if (value != NULL) {
413
+    if (value != nullptr) {
414 414
       lcd_put_wchar(':');
415 415
       if (extra_row) {
416 416
         // Assume that value is numeric (with no descender)

+ 1
- 1
Marlin/src/lcd/menu/game/invaders.cpp View File

@@ -302,7 +302,7 @@ void InvadersGame::game_screen() {
302 302
         if (invader_count && !random(0, 20)) {
303 303
 
304 304
           // Find a free bullet
305
-          laser_t *b = NULL;
305
+          laser_t *b = nullptr;
306 306
           LOOP_L_N(i, COUNT(bullet)) if (!bullet[i].v) { b = &bullet[i]; break; }
307 307
           if (b) {
308 308
             // Pick a random shooter and update the bullet

+ 3
- 3
Marlin/src/lcd/menu/menu.cpp View File

@@ -136,7 +136,7 @@ void MenuItemBase::edit(strfunc_t strfunc, loadfunc_t loadfunc) {
136 136
   if (ui.should_draw())
137 137
     draw_edit_screen(editLabel, strfunc(ui.encoderPosition + minEditValue));
138 138
   if (ui.lcd_clicked || (liveEdit && ui.should_draw())) {
139
-    if (editValue != NULL) loadfunc(editValue, ui.encoderPosition + minEditValue);
139
+    if (editValue != nullptr) loadfunc(editValue, ui.encoderPosition + minEditValue);
140 140
     if (callbackFunc && (liveEdit || ui.lcd_clicked)) (*callbackFunc)();
141 141
     if (ui.use_click()) ui.goto_previous_screen();
142 142
   }
@@ -300,7 +300,7 @@ void MarlinUI::_synchronize() {
300 300
 
301 301
 // Display the synchronize screen with a custom message
302 302
 // ** This blocks the command queue! **
303
-void MarlinUI::synchronize(PGM_P const msg/*=NULL*/) {
303
+void MarlinUI::synchronize(PGM_P const msg/*=nullptr*/) {
304 304
   static const char moving[] PROGMEM = MSG_MOVING;
305 305
   sync_message = msg ? msg : moving;
306 306
   _synchronize();
@@ -445,7 +445,7 @@ void _lcd_draw_homing() {
445 445
 //
446 446
 bool ui_selection; // = false
447 447
 void set_ui_selection(const bool sel) { ui_selection = sel; }
448
-void do_select_screen(PGM_P const yes, PGM_P const no, selectFunc_t yesFunc, selectFunc_t noFunc, PGM_P const pref, const char * const string/*=NULL*/, PGM_P const suff/*=NULL*/) {
448
+void do_select_screen(PGM_P const yes, PGM_P const no, selectFunc_t yesFunc, selectFunc_t noFunc, PGM_P const pref, const char * const string/*=nullptr*/, PGM_P const suff/*=nullptr*/) {
449 449
   if (ui.encoderPosition) {
450 450
     ui_selection = int16_t(ui.encoderPosition) > 0;
451 451
     ui.encoderPosition = 0;

+ 6
- 6
Marlin/src/lcd/menu/menu.h View File

@@ -70,14 +70,14 @@ DECLARE_MENU_EDIT_TYPE(uint32_t, long5_25,    ftostr5rj,       0.04f );   // 123
70 70
 typedef void (*selectFunc_t)();
71 71
 void draw_select_screen(PGM_P const yes, PGM_P const no, const bool yesno, PGM_P const pref, const char * const string, PGM_P const suff);
72 72
 void set_ui_selection(const bool sel);
73
-void do_select_screen(PGM_P const yes, PGM_P const no, selectFunc_t yesFunc, selectFunc_t noFunc, PGM_P const pref, const char * const string=NULL, PGM_P const suff=NULL);
74
-inline void do_select_screen_yn(selectFunc_t yesFunc, selectFunc_t noFunc, PGM_P const pref, const char * const string=NULL, PGM_P const suff=NULL) {
73
+void do_select_screen(PGM_P const yes, PGM_P const no, selectFunc_t yesFunc, selectFunc_t noFunc, PGM_P const pref, const char * const string=nullptr, PGM_P const suff=nullptr);
74
+inline void do_select_screen_yn(selectFunc_t yesFunc, selectFunc_t noFunc, PGM_P const pref, const char * const string=nullptr, PGM_P const suff=nullptr) {
75 75
   do_select_screen(PSTR(MSG_YES), PSTR(MSG_NO), yesFunc, noFunc, pref, string, suff);
76 76
 }
77 77
 
78
-void draw_edit_screen(PGM_P const pstr, const char* const value=NULL);
78
+void draw_edit_screen(PGM_P const pstr, const char* const value=nullptr);
79 79
 void draw_menu_item(const bool sel, const uint8_t row, PGM_P const pstr, const char pre_char, const char post_char);
80
-void draw_menu_item_static(const uint8_t row, PGM_P const pstr, const bool center=true, const bool invert=false, const char *valstr=NULL);
80
+void draw_menu_item_static(const uint8_t row, PGM_P const pstr, const bool center=true, const bool invert=false, const char *valstr=nullptr);
81 81
 void _draw_menu_item_edit(const bool sel, const uint8_t row, PGM_P const pstr, const char* const data, const bool pgm);
82 82
 FORCE_INLINE void draw_menu_item_back(const bool sel, const uint8_t row, PGM_P const pstr) { draw_menu_item(sel, row, pstr, LCD_STR_UPLEVEL[0], LCD_STR_UPLEVEL[0]); }
83 83
 FORCE_INLINE void draw_menu_item_edit(const bool sel, const uint8_t row, PGM_P const pstr, const char* const data) { _draw_menu_item_edit(sel, row, pstr, data, false); }
@@ -187,7 +187,7 @@ class TMenuItem : MenuItemBase {
187 187
     static void load(void *ptr, const int16_t value)  { *((type_t*)ptr) = unscale(value);     }
188 188
     static char* to_string(const int16_t value)       { return NAME::strfunc(unscale(value)); }
189 189
   public:
190
-    static void action_edit(PGM_P const pstr, type_t * const ptr, const type_t minValue, const type_t maxValue, const screenFunc_t callback=NULL, const bool live=false) {
190
+    static void action_edit(PGM_P const pstr, type_t * const ptr, const type_t minValue, const type_t maxValue, const screenFunc_t callback=nullptr, const bool live=false) {
191 191
       // Make sure minv and maxv fit within int16_t
192 192
       const int16_t minv = MAX(scale(minValue), INT16_MIN),
193 193
                     maxv = MIN(scale(maxValue), INT16_MAX);
@@ -218,7 +218,7 @@ DECLARE_MENU_EDIT_ITEM(long5_25);
218 218
 
219 219
 class MenuItem_bool {
220 220
   public:
221
-    static void action_edit(PGM_P const pstr, bool* ptr, const screenFunc_t callbackFunc=NULL);
221
+    static void action_edit(PGM_P const pstr, bool* ptr, const screenFunc_t callbackFunc=nullptr);
222 222
 };
223 223
 
224 224
 ////////////////////////////////////////////

+ 1
- 1
Marlin/src/lcd/menu/menu_advanced.cpp View File

@@ -610,7 +610,7 @@ void menu_backlash();
610 610
         PSTR(MSG_BUTTON_INIT), PSTR(MSG_BUTTON_CANCEL),
611 611
         []{ ui.completion_feedback(settings.init_eeprom()); },
612 612
         ui.goto_previous_screen,
613
-        PSTR(MSG_INIT_EEPROM), NULL, PSTR("?")
613
+        PSTR(MSG_INIT_EEPROM), nullptr, PSTR("?")
614 614
       );
615 615
     }
616 616
 

+ 1
- 1
Marlin/src/lcd/menu/menu_bed_corners.cpp View File

@@ -102,7 +102,7 @@ static inline void menu_level_bed_corners() {
102 102
       #else
103 103
         MSG_NEXT_CORNER
104 104
       #endif
105
-    ), NULL, PSTR("?")
105
+    ), nullptr, PSTR("?")
106 106
   );
107 107
 }
108 108
 

+ 2
- 2
Marlin/src/lcd/menu/menu_filament.cpp View File

@@ -367,7 +367,7 @@ void menu_pause_option() {
367 367
 // ADVANCED_PAUSE_FEATURE message screens
368 368
 //
369 369
 
370
-void _lcd_pause_message(PGM_P const msg1, PGM_P const msg2=NULL, PGM_P const msg3=NULL) {
370
+void _lcd_pause_message(PGM_P const msg1, PGM_P const msg2=nullptr, PGM_P const msg3=nullptr) {
371 371
   START_SCREEN();
372 372
   STATIC_ITEM_P(pause_header(), true, true);
373 373
   STATIC_ITEM_P(msg1);
@@ -516,7 +516,7 @@ FORCE_INLINE screenFunc_t ap_message_screen(const PauseMessage message) {
516 516
     case PAUSE_MESSAGE_STATUS:
517 517
     default: break;
518 518
   }
519
-  return NULL;
519
+  return nullptr;
520 520
 }
521 521
 
522 522
 void lcd_pause_show_message(

+ 5
- 5
Marlin/src/lcd/menu/menu_main.cpp View File

@@ -101,7 +101,7 @@
101 101
   }
102 102
 
103 103
   void menu_abort_confirm() {
104
-    do_select_screen(PSTR(MSG_BUTTON_STOP), PSTR(MSG_BACK), lcd_abort_job, ui.goto_previous_screen, PSTR(MSG_STOP_PRINT), NULL, PSTR("?"));
104
+    do_select_screen(PSTR(MSG_BUTTON_STOP), PSTR(MSG_BACK), lcd_abort_job, ui.goto_previous_screen, PSTR(MSG_STOP_PRINT), nullptr, PSTR("?"));
105 105
   }
106 106
 
107 107
 #endif // MACHINE_CAN_STOP
@@ -189,10 +189,10 @@ void menu_main() {
189 189
       }
190 190
       else {
191 191
         #if PIN_EXISTS(SD_DETECT)
192
-          MENU_ITEM(function, MSG_NO_CARD, NULL);
192
+          MENU_ITEM(function, MSG_NO_CARD, nullptr);
193 193
         #else
194 194
           MENU_ITEM(gcode, MSG_INIT_SDCARD, PSTR("M21"));
195
-          MENU_ITEM(function, MSG_SD_RELEASED, NULL);
195
+          MENU_ITEM(function, MSG_SD_RELEASED, nullptr);
196 196
         #endif
197 197
       }
198 198
     #endif // !HAS_ENCODER_WHEEL && SDSUPPORT
@@ -276,10 +276,10 @@ void menu_main() {
276 276
     }
277 277
     else {
278 278
       #if PIN_EXISTS(SD_DETECT)
279
-        MENU_ITEM(function, MSG_NO_CARD, NULL);
279
+        MENU_ITEM(function, MSG_NO_CARD, nullptr);
280 280
       #else
281 281
         MENU_ITEM(gcode, MSG_INIT_SDCARD, PSTR("M21"));
282
-        MENU_ITEM(function, MSG_SD_RELEASED, NULL);
282
+        MENU_ITEM(function, MSG_SD_RELEASED, nullptr);
283 283
       #endif
284 284
     }
285 285
   #endif // HAS_ENCODER_WHEEL && SDSUPPORT

+ 1
- 1
Marlin/src/lcd/menu/menu_mixer.cpp View File

@@ -259,7 +259,7 @@ void menu_mixer_vtools_reset_confirm() {
259 259
       ui.return_to_status();
260 260
     },
261 261
     ui.goto_previous_screen,
262
-    PSTR(MSG_RESET_VTOOLS), NULL, PSTR("?")
262
+    PSTR(MSG_RESET_VTOOLS), nullptr, PSTR("?")
263 263
   );
264 264
 }
265 265
 

+ 1
- 1
Marlin/src/lcd/ultralcd.cpp View File

@@ -211,7 +211,7 @@ millis_t next_button_update_ms;
211 211
     }
212 212
   }
213 213
 
214
-  void MarlinUI::draw_select_screen_prompt(PGM_P const pref, const char * const string/*=NULL*/, PGM_P const suff/*=NULL*/) {
214
+  void MarlinUI::draw_select_screen_prompt(PGM_P const pref, const char * const string/*=nullptr*/, PGM_P const suff/*=nullptr*/) {
215 215
     const uint8_t plen = utf8_strlen_P(pref), slen = suff ? utf8_strlen_P(suff) : 0;
216 216
     uint8_t x = 0, y = 0;
217 217
     if (!string && plen + slen <= LCD_WIDTH) {

+ 2
- 2
Marlin/src/lcd/ultralcd.h View File

@@ -419,7 +419,7 @@ public:
419 419
     static bool lcd_clicked;
420 420
     static bool use_click();
421 421
 
422
-    static void synchronize(PGM_P const msg=NULL);
422
+    static void synchronize(PGM_P const msg=nullptr);
423 423
 
424 424
     static screenFunc_t currentScreen;
425 425
     static void goto_screen(const screenFunc_t screen, const uint16_t encoder=0, const uint8_t top=0, const uint8_t items=0);
@@ -458,7 +458,7 @@ public:
458 458
       static void ubl_plot(const uint8_t x, const uint8_t inverted_y);
459 459
     #endif
460 460
 
461
-    static void draw_select_screen_prompt(PGM_P const pref, const char * const string=NULL, PGM_P const suff=NULL);
461
+    static void draw_select_screen_prompt(PGM_P const pref, const char * const string=nullptr, PGM_P const suff=nullptr);
462 462
 
463 463
   #elif HAS_SPI_LCD
464 464
 

+ 1
- 1
Marlin/src/libs/L6470/L6470_Marlin.cpp View File

@@ -624,7 +624,7 @@ void L6470_Marlin::error_status_decode(const uint16_t status, const uint8_t axis
624 624
     #endif
625 625
   };
626 626
 
627
-  inline void append_stepper_err(char * &p, const uint8_t stepper_index, const char * const err=NULL) {
627
+  inline void append_stepper_err(char * &p, const uint8_t stepper_index, const char * const err=nullptr) {
628 628
     p += sprintf_P(p, PSTR("Stepper %c%c "), char(index_to_axis[stepper_index][0]), char(index_to_axis[stepper_index][1]));
629 629
     if (err) p += sprintf_P(p, err);
630 630
   }

+ 1
- 1
Marlin/src/libs/vector_3.cpp View File

@@ -140,7 +140,7 @@ matrix_3x3 matrix_3x3::transpose(const matrix_3x3 &original) {
140 140
 }
141 141
 
142 142
 void matrix_3x3::debug(PGM_P const title) {
143
-  if (title != NULL) {
143
+  if (title != nullptr) {
144 144
     serialprintPGM(title);
145 145
     SERIAL_EOL();
146 146
   }

+ 2
- 2
Marlin/src/module/configuration_store.cpp View File

@@ -2132,7 +2132,7 @@ void MarlinSettings::postprocess() {
2132 2132
       #endif
2133 2133
     }
2134 2134
 
2135
-    void MarlinSettings::load_mesh(const int8_t slot, void * const into/*=NULL*/) {
2135
+    void MarlinSettings::load_mesh(const int8_t slot, void * const into/*=nullptr*/) {
2136 2136
 
2137 2137
       #if ENABLED(AUTO_BED_LEVELING_UBL)
2138 2138
 
@@ -2545,7 +2545,7 @@ void MarlinSettings::reset() {
2545 2545
   #if HAS_TRINAMIC
2546 2546
     inline void say_M906(const bool forReplay) { CONFIG_ECHO_START(); SERIAL_ECHOPGM("  M906"); }
2547 2547
     #if HAS_STEALTHCHOP
2548
-      void say_M569(const char * const etc=NULL) {
2548
+      void say_M569(const char * const etc=nullptr) {
2549 2549
         SERIAL_ECHOPGM("  M569 S1");
2550 2550
         if (etc) {
2551 2551
           SERIAL_CHAR(' ');

+ 1
- 1
Marlin/src/module/configuration_store.h View File

@@ -65,7 +65,7 @@ class MarlinSettings {
65 65
         static uint16_t calc_num_meshes();
66 66
         static int mesh_slot_offset(const int8_t slot);
67 67
         static void store_mesh(const int8_t slot);
68
-        static void load_mesh(const int8_t slot, void * const into=NULL);
68
+        static void load_mesh(const int8_t slot, void * const into=nullptr);
69 69
 
70 70
         //static void delete_mesh();    // necessary if we have a MAT
71 71
         //static void defrag_meshes();  // "

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

@@ -377,7 +377,7 @@ void Endstops::event_handler() {
377 377
   prev_hit_state = hit_state;
378 378
 }
379 379
 
380
-static void print_es_state(const bool is_hit, PGM_P const label=NULL) {
380
+static void print_es_state(const bool is_hit, PGM_P const label=nullptr) {
381 381
   if (label) serialprintPGM(label);
382 382
   SERIAL_ECHOPGM(": ");
383 383
   serialprintPGM(is_hit ? PSTR(MSG_ENDSTOP_HIT) : PSTR(MSG_ENDSTOP_OPEN));

+ 3
- 3
Marlin/src/module/planner.cpp View File

@@ -900,7 +900,7 @@ void Planner::reverse_pass() {
900 900
   // Reverse Pass: Coarsely maximize all possible deceleration curves back-planning from the last
901 901
   // block in buffer. Cease planning when the last optimal planned or tail pointer is reached.
902 902
   // NOTE: Forward pass will later refine and correct the reverse pass to create an optimal plan.
903
-  const block_t *next = NULL;
903
+  const block_t *next = nullptr;
904 904
   while (block_index != planned_block_index) {
905 905
 
906 906
     // Perform the reverse pass
@@ -995,7 +995,7 @@ void Planner::forward_pass() {
995 995
   uint8_t block_index = block_buffer_planned;
996 996
 
997 997
   block_t *current;
998
-  const block_t * previous = NULL;
998
+  const block_t * previous = nullptr;
999 999
   while (block_index != block_buffer_head) {
1000 1000
 
1001 1001
     // Perform the forward pass
@@ -1045,7 +1045,7 @@ void Planner::recalculate_trapezoids() {
1045 1045
   }
1046 1046
 
1047 1047
   // Go from the tail (currently executed block) to the first block, without including it)
1048
-  block_t *current = NULL, *next = NULL;
1048
+  block_t *current = nullptr, *next = nullptr;
1049 1049
   float current_entry_speed = 0.0, next_entry_speed = 0.0;
1050 1050
   while (block_index != head_block_index) {
1051 1051
 

+ 4
- 4
Marlin/src/module/planner.h View File

@@ -746,7 +746,7 @@ class Planner {
746 746
     FORCE_INLINE static bool has_blocks_queued() { return (block_buffer_head != block_buffer_tail); }
747 747
 
748 748
     /**
749
-     * The current block. NULL if the buffer is empty.
749
+     * The current block. nullptr if the buffer is empty.
750 750
      * This also marks the block as busy.
751 751
      * WARNING: Called from Stepper ISR context!
752 752
      */
@@ -763,7 +763,7 @@ class Planner {
763 763
           --delay_before_delivering;
764 764
           // If the number of movements queued is less than 3, and there is still time
765 765
           //  to wait, do not deliver anything
766
-          if (nr_moves < 3 && delay_before_delivering) return NULL;
766
+          if (nr_moves < 3 && delay_before_delivering) return nullptr;
767 767
           delay_before_delivering = 0;
768 768
         }
769 769
 
@@ -771,7 +771,7 @@ class Planner {
771 771
         block_t * const block = &block_buffer[block_buffer_tail];
772 772
 
773 773
         // No trapezoid calculated? Don't execute yet.
774
-        if (TEST(block->flag, BLOCK_BIT_RECALCULATE)) return NULL;
774
+        if (TEST(block->flag, BLOCK_BIT_RECALCULATE)) return nullptr;
775 775
 
776 776
         #if ENABLED(ULTRA_LCD)
777 777
           block_buffer_runtime_us -= block->segment_time_us; // We can't be sure how long an active block will take, so don't count it.
@@ -793,7 +793,7 @@ class Planner {
793 793
         clear_block_buffer_runtime(); // paranoia. Buffer is empty now - so reset accumulated time to zero.
794 794
       #endif
795 795
 
796
-      return NULL;
796
+      return nullptr;
797 797
     }
798 798
 
799 799
     /**

+ 3
- 3
Marlin/src/module/stepper.cpp View File

@@ -133,7 +133,7 @@ Stepper stepper; // Singleton
133 133
 
134 134
 // private:
135 135
 
136
-block_t* Stepper::current_block; // (= NULL) A pointer to the block currently being traced
136
+block_t* Stepper::current_block; // (= nullptr) A pointer to the block currently being traced
137 137
 
138 138
 uint8_t Stepper::last_direction_bits, // = 0
139 139
         Stepper::axis_did_move; // = 0
@@ -1394,7 +1394,7 @@ void Stepper::stepper_pulse_phase_isr() {
1394 1394
     abort_current_block = false;
1395 1395
     if (current_block) {
1396 1396
       axis_did_move = 0;
1397
-      current_block = NULL;
1397
+      current_block = nullptr;
1398 1398
       planner.discard_current_block();
1399 1399
     }
1400 1400
   }
@@ -1541,7 +1541,7 @@ uint32_t Stepper::stepper_block_phase_isr() {
1541 1541
         runout.block_completed(current_block);
1542 1542
       #endif
1543 1543
       axis_did_move = 0;
1544
-      current_block = NULL;
1544
+      current_block = nullptr;
1545 1545
       planner.discard_current_block();
1546 1546
     }
1547 1547
     else {

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

@@ -1264,7 +1264,7 @@ void Temperature::manage_heater() {
1264 1264
       #if ENABLED(CHAMBER_USER_THERMISTOR)
1265 1265
         t_index == CTI_CHAMBER ? PSTR("CHAMBER") :
1266 1266
       #endif
1267
-      NULL
1267
+      nullptr
1268 1268
     );
1269 1269
     SERIAL_EOL();
1270 1270
   }

+ 6
- 6
Marlin/src/module/thermistor/thermistors.h View File

@@ -147,7 +147,7 @@
147 147
 #elif defined(HEATER_0_USES_THERMISTOR)
148 148
   #error "No heater 0 thermistor table specified"
149 149
 #else
150
-  #define HEATER_0_TEMPTABLE NULL
150
+  #define HEATER_0_TEMPTABLE nullptr
151 151
   #define HEATER_0_TEMPTABLE_LEN 0
152 152
 #endif
153 153
 
@@ -157,7 +157,7 @@
157 157
 #elif defined(HEATER_1_USES_THERMISTOR)
158 158
   #error "No heater 1 thermistor table specified"
159 159
 #else
160
-  #define HEATER_1_TEMPTABLE NULL
160
+  #define HEATER_1_TEMPTABLE nullptr
161 161
   #define HEATER_1_TEMPTABLE_LEN 0
162 162
 #endif
163 163
 
@@ -167,7 +167,7 @@
167 167
 #elif defined(HEATER_2_USES_THERMISTOR)
168 168
   #error "No heater 2 thermistor table specified"
169 169
 #else
170
-  #define HEATER_2_TEMPTABLE NULL
170
+  #define HEATER_2_TEMPTABLE nullptr
171 171
   #define HEATER_2_TEMPTABLE_LEN 0
172 172
 #endif
173 173
 
@@ -177,7 +177,7 @@
177 177
 #elif defined(HEATER_3_USES_THERMISTOR)
178 178
   #error "No heater 3 thermistor table specified"
179 179
 #else
180
-  #define HEATER_3_TEMPTABLE NULL
180
+  #define HEATER_3_TEMPTABLE nullptr
181 181
   #define HEATER_3_TEMPTABLE_LEN 0
182 182
 #endif
183 183
 
@@ -187,7 +187,7 @@
187 187
 #elif defined(HEATER_4_USES_THERMISTOR)
188 188
   #error "No heater 4 thermistor table specified"
189 189
 #else
190
-  #define HEATER_4_TEMPTABLE NULL
190
+  #define HEATER_4_TEMPTABLE nullptr
191 191
   #define HEATER_4_TEMPTABLE_LEN 0
192 192
 #endif
193 193
 
@@ -197,7 +197,7 @@
197 197
 #elif defined(HEATER_5_USES_THERMISTOR)
198 198
   #error "No heater 5 thermistor table specified"
199 199
 #else
200
-  #define HEATER_5_TEMPTABLE NULL
200
+  #define HEATER_5_TEMPTABLE nullptr
201 201
   #define HEATER_5_TEMPTABLE_LEN 0
202 202
 #endif
203 203
 

+ 2
- 2
Marlin/src/sd/SdBaseFile.cpp View File

@@ -81,7 +81,7 @@ bool SdBaseFile::addDirCluster() {
81 81
 // cache a file's directory entry
82 82
 // return pointer to cached entry or null for failure
83 83
 dir_t* SdBaseFile::cacheDirEntry(uint8_t action) {
84
-  if (!vol_->cacheRawBlock(dirBlock_, action)) return NULL;
84
+  if (!vol_->cacheRawBlock(dirBlock_, action)) return nullptr;
85 85
   return vol_->cache()->dir + dirIndex_;
86 86
 }
87 87
 
@@ -841,7 +841,7 @@ bool SdBaseFile::openParent(SdBaseFile* dir) {
841 841
 
842 842
   // search for parent in '../..'
843 843
   do {
844
-    if (file.readDir(&entry, NULL) != 32) return false;
844
+    if (file.readDir(&entry, nullptr) != 32) return false;
845 845
     c = entry.firstClusterLow;
846 846
     c |= (uint32_t)entry.firstClusterHigh << 16;
847 847
   } while (c != cluster);

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

@@ -158,7 +158,7 @@ char *createFilename(char *buffer, const dir_t &p) {
158 158
 
159 159
 uint16_t nrFile_index;
160 160
 
161
-void CardReader::lsDive(const char *prepend, SdFile parent, const char * const match/*=NULL*/) {
161
+void CardReader::lsDive(const char *prepend, SdFile parent, const char * const match/*=nullptr*/) {
162 162
   dir_t p;
163 163
   uint8_t cnt = 0;
164 164
 
@@ -226,7 +226,7 @@ void CardReader::lsDive(const char *prepend, SdFile parent, const char * const m
226 226
 
227 227
         case LS_GetFilename:
228 228
           createFilename(filename, p);
229
-          if (match != NULL) {
229
+          if (match != nullptr) {
230 230
             if (strcasecmp(match, filename) == 0) return;
231 231
           }
232 232
           else if (cnt == nrFile_index) return;  // 0 based index
@@ -241,7 +241,7 @@ void CardReader::lsDive(const char *prepend, SdFile parent, const char * const m
241 241
 void CardReader::ls() {
242 242
   lsAction = LS_SerialPrint;
243 243
   root.rewind();
244
-  lsDive(NULL, root);
244
+  lsDive(nullptr, root);
245 245
 }
246 246
 
247 247
 #if ENABLED(LONG_FILENAME_HOST_SUPPORT)
@@ -276,7 +276,7 @@ void CardReader::ls() {
276 276
 
277 277
       // Find the item, setting the long filename
278 278
       diveDir.rewind();
279
-      lsDive(NULL, diveDir, segment);
279
+      lsDive(nullptr, diveDir, segment);
280 280
 
281 281
       // Print /LongNamePart to serial output
282 282
       SERIAL_CHAR('/');
@@ -528,11 +528,11 @@ void CardReader::report_status() {
528 528
 
529 529
 void CardReader::write_command(char *buf) {
530 530
   char* begin = buf;
531
-  char* npos = NULL;
531
+  char* npos = nullptr;
532 532
   char* end = buf + strlen(buf) - 1;
533 533
 
534 534
   file.writeError = false;
535
-  if ((npos = strchr(buf, 'N')) != NULL) {
535
+  if ((npos = strchr(buf, 'N')) != nullptr) {
536 536
     begin = strchr(npos, ' ') + 1;
537 537
     end = strchr(npos, '*') - 1;
538 538
   }
@@ -566,7 +566,7 @@ void CardReader::checkautostart() {
566 566
     sprintf_P(autoname, PSTR("auto%c.g"), autostart_index + '0');
567 567
     dir_t p;
568 568
     root.rewind();
569
-    while (root.readDir(&p, NULL) > 0) {
569
+    while (root.readDir(&p, nullptr) > 0) {
570 570
       for (int8_t i = (int8_t)strlen((char*)p.name); i--;) p.name[i] = tolower(p.name[i]);
571 571
       if (p.name[9] != '~' && strncmp((char*)p.name, autoname, 5) == 0) {
572 572
         openAndPrintFile(autoname);
@@ -602,9 +602,9 @@ void CardReader::closefile(const bool store_location) {
602 602
  * Get the name of a file in the current directory by index
603 603
  * with optional name to match.
604 604
  */
605
-void CardReader::getfilename(uint16_t nr, const char * const match/*=NULL*/) {
605
+void CardReader::getfilename(uint16_t nr, const char * const match/*=nullptr*/) {
606 606
   #if ENABLED(SDSORT_CACHE_NAMES)
607
-    if (match != NULL) {
607
+    if (match != nullptr) {
608 608
       while (nr < sort_count) {
609 609
         if (strcasecmp(match, sortshort[nr]) == 0) break;
610 610
         nr++;
@@ -620,14 +620,14 @@ void CardReader::getfilename(uint16_t nr, const char * const match/*=NULL*/) {
620 620
   lsAction = LS_GetFilename;
621 621
   nrFile_index = nr;
622 622
   workDir.rewind();
623
-  lsDive(NULL, workDir, match);
623
+  lsDive(nullptr, workDir, match);
624 624
 }
625 625
 
626 626
 uint16_t CardReader::getnrfilenames() {
627 627
   lsAction = LS_Count;
628 628
   nrFiles = 0;
629 629
   workDir.rewind();
630
-  lsDive(NULL, workDir);
630
+  lsDive(nullptr, workDir);
631 631
   //SERIAL_ECHOLN(nrFiles);
632 632
   return nrFiles;
633 633
 }
@@ -639,7 +639,7 @@ uint16_t CardReader::getnrfilenames() {
639 639
  *
640 640
  * Returns a pointer to the last segment (filename) of the given DOS 8.3 path.
641 641
  *
642
- * A NULL result indicates an unrecoverable error.
642
+ * A nullptr result indicates an unrecoverable error.
643 643
  */
644 644
 const char* CardReader::diveToFile(SdFile*& curDir, const char * const path, const bool echo/*=false*/) {
645 645
   // Track both parent and subfolder
@@ -647,13 +647,13 @@ const char* CardReader::diveToFile(SdFile*& curDir, const char * const path, con
647 647
   SdFile *sub = &newDir1, *startDir;
648 648
 
649 649
   const char *dirname_start = path;
650
-  if (path[0] == '/') { 
650
+  if (path[0] == '/') {
651 651
     curDir = &root;
652 652
     workDirDepth = 0;
653 653
     dirname_start++;
654 654
   }
655 655
   else
656
-    curDir = &workDir; 
656
+    curDir = &workDir;
657 657
 
658 658
   startDir = curDir;
659 659
 
@@ -674,7 +674,7 @@ const char* CardReader::diveToFile(SdFile*& curDir, const char * const path, con
674 674
     // Open curDir
675 675
     if (!sub->open(curDir, dosSubdirname, O_READ)) {
676 676
       SERIAL_ECHOLNPAIR(MSG_SD_OPEN_FILE_FAIL, dosSubdirname, ".");
677
-      return NULL;
677
+      return nullptr;
678 678
     }
679 679
 
680 680
     // Close curDir if not at starting-point

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

@@ -78,7 +78,7 @@ public:
78 78
     static void printLongPath(char *path);
79 79
   #endif
80 80
 
81
-  static void getfilename(uint16_t nr, const char* const match=NULL);
81
+  static void getfilename(uint16_t nr, const char* const match=nullptr);
82 82
   static uint16_t getnrfilenames();
83 83
 
84 84
   static void getAbsFilename(char *t);
@@ -224,7 +224,7 @@ private:
224 224
   static LsAction lsAction; //stored for recursion.
225 225
   static 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.
226 226
   static char *diveDirName;
227
-  static void lsDive(const char *prepend, SdFile parent, const char * const match=NULL);
227
+  static void lsDive(const char *prepend, SdFile parent, const char * const match=nullptr);
228 228
 
229 229
   #if ENABLED(SDCARD_SORT_ALPHA)
230 230
     static void flush_presort();

+ 15
- 15
Marlin/src/sd/usb_flashdrive/lib/Usb.cpp View File

@@ -57,7 +57,7 @@ EpInfo* USB::getEpInfoEntry(uint8_t addr, uint8_t ep) {
57 57
   UsbDevice *p = addrPool.GetUsbDevicePtr(addr);
58 58
 
59 59
   if (!p || !p->epinfo)
60
-    return NULL;
60
+    return nullptr;
61 61
 
62 62
   EpInfo *pep = p->epinfo;
63 63
 
@@ -67,7 +67,7 @@ EpInfo* USB::getEpInfoEntry(uint8_t addr, uint8_t ep) {
67 67
 
68 68
     pep++;
69 69
   }
70
-  return NULL;
70
+  return nullptr;
71 71
 }
72 72
 
73 73
 /* set device table entry */
@@ -141,7 +141,7 @@ uint8_t USB::ctrlReq(uint8_t addr, uint8_t ep, uint8_t bmReqType, uint8_t bReque
141 141
   uint8_t rcode;
142 142
   SETUP_PKT setup_pkt;
143 143
 
144
-  EpInfo *pep = NULL;
144
+  EpInfo *pep = nullptr;
145 145
   uint16_t nak_limit = 0;
146 146
 
147 147
   rcode = SetAddress(addr, ep, &pep, &nak_limit);
@@ -162,7 +162,7 @@ uint8_t USB::ctrlReq(uint8_t addr, uint8_t ep, uint8_t bmReqType, uint8_t bReque
162 162
   rcode = dispatchPkt(tokSETUP, ep, nak_limit); //dispatch packet
163 163
   if (rcode) return rcode; // Return HRSLT if not zero
164 164
 
165
-  if (dataptr != NULL) { //data stage, if present
165
+  if (dataptr != nullptr) { //data stage, if present
166 166
     if (direction) { //IN transfer
167 167
       uint16_t left = total;
168 168
       pep->bmRcvToggle = 1; //bmRCVTOG1;
@@ -205,7 +205,7 @@ uint8_t USB::ctrlReq(uint8_t addr, uint8_t ep, uint8_t bmReqType, uint8_t bReque
205 205
 /* rcode 0 if no errors. rcode 01-0f is relayed from dispatchPkt(). Rcode f0 means RCVDAVIRQ error,
206 206
       fe USB xfer timeout */
207 207
 uint8_t USB::inTransfer(uint8_t addr, uint8_t ep, uint16_t *nbytesptr, uint8_t* data, uint8_t bInterval /*= 0*/) {
208
-  EpInfo *pep = NULL;
208
+  EpInfo *pep = nullptr;
209 209
   uint16_t nak_limit = 0;
210 210
 
211 211
   uint8_t rcode = SetAddress(addr, ep, &pep, &nak_limit);
@@ -289,7 +289,7 @@ uint8_t USB::InTransfer(EpInfo *pep, uint16_t nak_limit, uint16_t *nbytesptr, ui
289 289
 
290 290
 /* rcode 0 if no errors. rcode 01-0f is relayed from HRSL                       */
291 291
 uint8_t USB::outTransfer(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t* data) {
292
-  EpInfo *pep = NULL;
292
+  EpInfo *pep = nullptr;
293 293
   uint16_t nak_limit = 0;
294 294
 
295 295
   uint8_t rcode = SetAddress(addr, ep, &pep, &nak_limit);
@@ -529,7 +529,7 @@ void USB::Task(void) { //USB state machine
529 529
 uint8_t USB::DefaultAddressing(uint8_t parent, uint8_t port, bool lowspeed) {
530 530
   //uint8_t                buf[12];
531 531
   uint8_t rcode;
532
-  UsbDevice *p0 = NULL, *p = NULL;
532
+  UsbDevice *p0 = nullptr, *p = nullptr;
533 533
 
534 534
   // Get pointer to pseudo device with address 0 assigned
535 535
   p0 = addrPool.GetUsbDevicePtr(0);
@@ -649,8 +649,8 @@ uint8_t USB::Configuring(uint8_t parent, uint8_t port, bool lowspeed) {
649 649
   uint8_t rcode = 0;
650 650
   uint8_t buf[sizeof (USB_DEVICE_DESCRIPTOR)];
651 651
   USB_DEVICE_DESCRIPTOR *udd = reinterpret_cast<USB_DEVICE_DESCRIPTOR *>(buf);
652
-  UsbDevice *p = NULL;
653
-  EpInfo *oldep_ptr = NULL;
652
+  UsbDevice *p = nullptr;
653
+  EpInfo *oldep_ptr = nullptr;
654 654
   EpInfo epInfo;
655 655
 
656 656
   epInfo.epAddr = 0;
@@ -749,12 +749,12 @@ uint8_t USB::ReleaseDevice(uint8_t addr) {
749 749
 //get device descriptor
750 750
 
751 751
 uint8_t USB::getDevDescr(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t* dataptr) {
752
-  return ctrlReq(addr, ep, bmREQ_GET_DESCR, USB_REQUEST_GET_DESCRIPTOR, 0x00, USB_DESCRIPTOR_DEVICE, 0x0000, nbytes, nbytes, dataptr, NULL);
752
+  return ctrlReq(addr, ep, bmREQ_GET_DESCR, USB_REQUEST_GET_DESCRIPTOR, 0x00, USB_DESCRIPTOR_DEVICE, 0x0000, nbytes, nbytes, dataptr, nullptr);
753 753
 }
754 754
 //get configuration descriptor
755 755
 
756 756
 uint8_t USB::getConfDescr(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t conf, uint8_t* dataptr) {
757
-  return ctrlReq(addr, ep, bmREQ_GET_DESCR, USB_REQUEST_GET_DESCRIPTOR, conf, USB_DESCRIPTOR_CONFIGURATION, 0x0000, nbytes, nbytes, dataptr, NULL);
757
+  return ctrlReq(addr, ep, bmREQ_GET_DESCR, USB_REQUEST_GET_DESCRIPTOR, conf, USB_DESCRIPTOR_CONFIGURATION, 0x0000, nbytes, nbytes, dataptr, nullptr);
758 758
 }
759 759
 
760 760
 /* Requests Configuration Descriptor. Sends two Get Conf Descr requests. The first one gets the total length of all descriptors, then the second one requests this
@@ -777,21 +777,21 @@ uint8_t USB::getConfDescr(uint8_t addr, uint8_t ep, uint8_t conf, USBReadParser
777 777
 //get string descriptor
778 778
 
779 779
 uint8_t USB::getStrDescr(uint8_t addr, uint8_t ep, uint16_t ns, uint8_t index, uint16_t langid, uint8_t* dataptr) {
780
-  return ctrlReq(addr, ep, bmREQ_GET_DESCR, USB_REQUEST_GET_DESCRIPTOR, index, USB_DESCRIPTOR_STRING, langid, ns, ns, dataptr, NULL);
780
+  return ctrlReq(addr, ep, bmREQ_GET_DESCR, USB_REQUEST_GET_DESCRIPTOR, index, USB_DESCRIPTOR_STRING, langid, ns, ns, dataptr, nullptr);
781 781
 }
782 782
 //set address
783 783
 
784 784
 uint8_t USB::setAddr(uint8_t oldaddr, uint8_t ep, uint8_t newaddr) {
785
-  uint8_t rcode = ctrlReq(oldaddr, ep, bmREQ_SET, USB_REQUEST_SET_ADDRESS, newaddr, 0x00, 0x0000, 0x0000, 0x0000, NULL, NULL);
785
+  uint8_t rcode = ctrlReq(oldaddr, ep, bmREQ_SET, USB_REQUEST_SET_ADDRESS, newaddr, 0x00, 0x0000, 0x0000, 0x0000, nullptr, nullptr);
786 786
   //delay(2); //per USB 2.0 sect.9.2.6.3
787 787
   delay(300); // Older spec says you should wait at least 200ms
788 788
   return rcode;
789
-  //return ctrlReq(oldaddr, ep, bmREQ_SET, USB_REQUEST_SET_ADDRESS, newaddr, 0x00, 0x0000, 0x0000, 0x0000, NULL, NULL);
789
+  //return ctrlReq(oldaddr, ep, bmREQ_SET, USB_REQUEST_SET_ADDRESS, newaddr, 0x00, 0x0000, 0x0000, 0x0000, nullptr, nullptr);
790 790
 }
791 791
 //set configuration
792 792
 
793 793
 uint8_t USB::setConf(uint8_t addr, uint8_t ep, uint8_t conf_value) {
794
-  return ctrlReq(addr, ep, bmREQ_SET, USB_REQUEST_SET_CONFIGURATION, conf_value, 0x00, 0x0000, 0x0000, 0x0000, NULL, NULL);
794
+  return ctrlReq(addr, ep, bmREQ_SET, USB_REQUEST_SET_CONFIGURATION, conf_value, 0x00, 0x0000, 0x0000, 0x0000, nullptr, nullptr);
795 795
 }
796 796
 
797 797
 #endif // defined(USB_METHODS_INLINE)

+ 2
- 2
Marlin/src/sd/usb_flashdrive/lib/UsbCore.h View File

@@ -301,12 +301,12 @@ inline uint8_t USB::getStrDescr(uint8_t addr, uint8_t ep, uint16_t nuint8_ts, ui
301 301
 //set address
302 302
 
303 303
 inline uint8_t USB::setAddr(uint8_t oldaddr, uint8_t ep, uint8_t newaddr) {
304
-  return ( ctrlReq(oldaddr, ep, bmREQ_SET, USB_REQUEST_SET_ADDRESS, newaddr, 0x00, 0x0000, 0x0000, NULL));
304
+  return ( ctrlReq(oldaddr, ep, bmREQ_SET, USB_REQUEST_SET_ADDRESS, newaddr, 0x00, 0x0000, 0x0000, nullptr));
305 305
 }
306 306
 //set configuration
307 307
 
308 308
 inline uint8_t USB::setConf(uint8_t addr, uint8_t ep, uint8_t conf_value) {
309
-  return ( ctrlReq(addr, ep, bmREQ_SET, USB_REQUEST_SET_CONFIGURATION, conf_value, 0x00, 0x0000, 0x0000, NULL));
309
+  return ( ctrlReq(addr, ep, bmREQ_SET, USB_REQUEST_SET_CONFIGURATION, conf_value, 0x00, 0x0000, 0x0000, nullptr));
310 310
 }
311 311
 
312 312
 #endif // defined(USB_METHODS_INLINE)

+ 1
- 1
Marlin/src/sd/usb_flashdrive/lib/address.h View File

@@ -183,7 +183,7 @@ public:
183 183
   virtual UsbDevice* GetUsbDevicePtr(uint8_t addr) {
184 184
     if (!addr) return thePool;
185 185
     uint8_t index = FindAddressIndex(addr);
186
-    return index ? thePool + index : NULL;
186
+    return index ? thePool + index : nullptr;
187 187
   }
188 188
 
189 189
   // Perform an operation specified by pfunc for each addressed device

+ 8
- 8
Marlin/src/sd/usb_flashdrive/lib/masstorage.cpp View File

@@ -118,7 +118,7 @@ uint8_t BulkOnly::LockMedia(uint8_t lun, uint8_t lock) {
118 118
   Notify(PSTR("---------\r\n"), 0x80);
119 119
 
120 120
   CDB6_t cdb = CDB6_t(SCSI_CMD_PREVENT_REMOVAL, lun, (uint8_t)0, lock);
121
-  return SCSITransaction6(&cdb, (uint16_t)0, NULL, (uint8_t)MASS_CMD_DIR_IN);
121
+  return SCSITransaction6(&cdb, (uint16_t)0, nullptr, (uint8_t)MASS_CMD_DIR_IN);
122 122
 }
123 123
 
124 124
 /**
@@ -136,7 +136,7 @@ uint8_t BulkOnly::MediaCTL(uint8_t lun, uint8_t ctl) {
136 136
   uint8_t rcode = MASS_ERR_UNIT_NOT_READY;
137 137
   if (bAddress) {
138 138
     CDB6_t cdb = CDB6_t(SCSI_CMD_START_STOP_UNIT, lun, ctl & 0x03, 0);
139
-    rcode = SCSITransaction6(&cdb, (uint16_t)0, NULL, (uint8_t)MASS_CMD_DIR_OUT);
139
+    rcode = SCSITransaction6(&cdb, (uint16_t)0, nullptr, (uint8_t)MASS_CMD_DIR_OUT);
140 140
   }
141 141
   else
142 142
     SetCurLUN(lun);
@@ -255,8 +255,8 @@ uint8_t BulkOnly::ConfigureDevice(uint8_t parent, uint8_t port, bool lowspeed) {
255 255
   uint8_t buf[constBufSize];
256 256
   USB_DEVICE_DESCRIPTOR * udd = reinterpret_cast<USB_DEVICE_DESCRIPTOR*>(buf);
257 257
   uint8_t rcode;
258
-  UsbDevice *p = NULL;
259
-  EpInfo *oldep_ptr = NULL;
258
+  UsbDevice *p = nullptr;
259
+  EpInfo *oldep_ptr = nullptr;
260 260
   USBTRACE("MS ConfigureDevice\r\n");
261 261
   ClearAllEP();
262 262
   AddressPool &addrPool = pUsb->GetAddressPool();
@@ -668,7 +668,7 @@ uint8_t BulkOnly::Poll() {
668 668
  * @return
669 669
  */
670 670
 uint8_t BulkOnly::GetMaxLUN(uint8_t *plun) {
671
-        uint8_t ret = pUsb->ctrlReq(bAddress, 0, bmREQ_MASSIN, MASS_REQ_GET_MAX_LUN, 0, 0, bIface, 1, 1, plun, NULL);
671
+        uint8_t ret = pUsb->ctrlReq(bAddress, 0, bmREQ_MASSIN, MASS_REQ_GET_MAX_LUN, 0, 0, bIface, 1, 1, plun, nullptr);
672 672
 
673 673
         if (ret == hrSTALL)
674 674
                 *plun = 0;
@@ -709,7 +709,7 @@ uint8_t BulkOnly::TestUnitReady(uint8_t lun) {
709 709
         Notify(PSTR("-----------------\r\n"), 0x80);
710 710
 
711 711
         CDB6_t cdb = CDB6_t(SCSI_CMD_TEST_UNIT_READY, lun, (uint8_t)0, 0);
712
-        return SCSITransaction6(&cdb, 0, NULL, (uint8_t)MASS_CMD_DIR_IN);
712
+        return SCSITransaction6(&cdb, 0, nullptr, (uint8_t)MASS_CMD_DIR_IN);
713 713
 
714 714
 }
715 715
 
@@ -813,7 +813,7 @@ uint8_t BulkOnly::ClearEpHalt(uint8_t index) {
813 813
 
814 814
         uint8_t ret = 0;
815 815
 
816
-        while ((ret = (pUsb->ctrlReq(bAddress, 0, USB_SETUP_HOST_TO_DEVICE | USB_SETUP_TYPE_STANDARD | USB_SETUP_RECIPIENT_ENDPOINT, USB_REQUEST_CLEAR_FEATURE, USB_FEATURE_ENDPOINT_HALT, 0, ((index == epDataInIndex) ? (0x80 | epInfo[index].epAddr) : epInfo[index].epAddr), 0, 0, NULL, NULL)) == 0x01))
816
+        while ((ret = (pUsb->ctrlReq(bAddress, 0, USB_SETUP_HOST_TO_DEVICE | USB_SETUP_TYPE_STANDARD | USB_SETUP_RECIPIENT_ENDPOINT, USB_REQUEST_CLEAR_FEATURE, USB_FEATURE_ENDPOINT_HALT, 0, ((index == epDataInIndex) ? (0x80 | epInfo[index].epAddr) : epInfo[index].epAddr), 0, 0, nullptr, nullptr)) == 0x01))
817 817
                 delay(6);
818 818
 
819 819
         if (ret) {
@@ -831,7 +831,7 @@ uint8_t BulkOnly::ClearEpHalt(uint8_t index) {
831 831
  *
832 832
  */
833 833
 void BulkOnly::Reset() {
834
-        while (pUsb->ctrlReq(bAddress, 0, bmREQ_MASSOUT, MASS_REQ_BOMSR, 0, 0, bIface, 0, 0, NULL, NULL) == 0x01) delay(6);
834
+        while (pUsb->ctrlReq(bAddress, 0, bmREQ_MASSOUT, MASS_REQ_BOMSR, 0, 0, bIface, 0, 0, nullptr, nullptr) == 0x01) delay(6);
835 835
 }
836 836
 
837 837
 /**

+ 4
- 4
Marlin/src/sd/usb_flashdrive/lib/parsetools.h View File

@@ -40,7 +40,7 @@ class MultiByteValueParser {
40 40
 
41 41
 public:
42 42
 
43
-  MultiByteValueParser() : pBuf(NULL), countDown(0), valueSize(0) {
43
+  MultiByteValueParser() : pBuf(nullptr), countDown(0), valueSize(0) {
44 44
   };
45 45
 
46 46
   const uint8_t* GetBuffer() { return pBuf; }
@@ -60,7 +60,7 @@ class ByteSkipper {
60 60
 
61 61
 public:
62 62
 
63
-  ByteSkipper() : pBuf(NULL), nStage(0), countDown(0) {
63
+  ByteSkipper() : pBuf(nullptr), nStage(0), countDown(0) {
64 64
   }
65 65
 
66 66
   void Initialize(MultiValueBuffer *pbuf) {
@@ -119,7 +119,7 @@ public:
119 119
     arLenCntdn(0),
120 120
     lenSize(0),
121 121
     valSize(0),
122
-    pBuf(NULL),
122
+    pBuf(nullptr),
123 123
     prsMode(modeArray) { }
124 124
   ;
125 125
 
@@ -141,5 +141,5 @@ public:
141 141
     theParser.Initialize(p);
142 142
   }
143 143
 
144
-  bool Parse(uint8_t **pp, uint16_t *pcntdn, PTP_ARRAY_EL_FUNC pf, const void *me = NULL);
144
+  bool Parse(uint8_t **pp, uint16_t *pcntdn, PTP_ARRAY_EL_FUNC pf, const void *me = nullptr);
145 145
 };

+ 1
- 1
buildroot/share/pin_interrupt_test/pin_interrupt_test.ino View File

@@ -5,7 +5,7 @@
5 5
     #undef  digitalPinToPCICR
6 6
     #define digitalPinToPCICR(p)    ( ((p) >= 10 && (p) <= 15) || \
7 7
                                       ((p) >= 50 && (p) <= 53) || \
8
-                                      ((p) >= 62 && (p) <= 69) ? &PCICR : (uint8_t *)0)
8
+                                      ((p) >= 62 && (p) <= 69) ? &PCICR : nullptr)
9 9
 #endif
10 10
 
11 11
 void setup() {

Loading…
Cancel
Save