ソースを参照

Apply #ifdef/#ifndef where possible

Scott Lahteine 4年前
コミット
34b73426e5
32個のファイルの変更141行の追加141行の削除
  1. 3
    3
      Marlin/src/HAL/HAL_DUE/usb/compiler.h
  2. 5
    5
      Marlin/src/HAL/HAL_DUE/usb/osc.h
  3. 3
    3
      Marlin/src/HAL/HAL_DUE/usb/spc_protocol.h
  4. 1
    1
      Marlin/src/HAL/HAL_DUE/usb/udi_cdc.h
  5. 1
    1
      Marlin/src/HAL/HAL_DUE/usb/udi_cdc_conf.h
  6. 1
    1
      Marlin/src/HAL/HAL_STM32F1/SPI.h
  7. 1
    1
      Marlin/src/inc/SanityCheck.h
  8. 1
    1
      Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/basic/ftdi_basic.h
  9. 6
    6
      Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/basic/spi.cpp
  10. 2
    2
      Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/basic/spi.h
  11. 1
    1
      Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/compat.h
  12. 1
    1
      Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/extended/ftdi_extended.h
  13. 1
    1
      Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/screens.h
  14. 1
    1
      Marlin/src/pins/lpc1768/pins_RAMPS_RE_ARM.h
  15. 1
    1
      Marlin/src/pins/ramps/pins_Z_BOLT_X_SERIES.h
  16. 1
    1
      Marlin/src/sd/usb_flashdrive/lib-uhs2/settings.h
  17. 1
    1
      Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_BULK_STORAGE/UHS_BULK_STORAGE.h
  18. 2
    2
      Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_UsbCore.h
  19. 1
    1
      Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_address.h
  20. 8
    8
      Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_host.h
  21. 10
    10
      Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_macros.h
  22. 7
    7
      Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_printf_HELPER.h
  23. 6
    6
      Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_usbhost.h
  24. 23
    23
      Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/USB_HOST_SHIELD/USB_HOST_SHIELD.h
  25. 7
    7
      Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/USB_HOST_SHIELD/USB_HOST_SHIELD_INLINE.h
  26. 1
    1
      Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/macro_logic.h
  27. 16
    16
      Marlin/src/sd/usb_flashdrive/lib-uhs3/dyn_SWI/SWI_INLINE.h
  28. 9
    9
      Marlin/src/sd/usb_flashdrive/lib-uhs3/dyn_SWI/dyn_SWI.h
  29. 8
    8
      buildroot/share/PlatformIO/variants/BIGTREE_GENERIC_STM32F407_5X/stm32f4xx_hal_conf.h
  30. 8
    8
      buildroot/share/PlatformIO/variants/MARLIN_F407VE/stm32f4xx_hal_conf.h
  31. 2
    2
      config/examples/Alfawise/U20-bltouch/Configuration.h
  32. 2
    2
      config/examples/Alfawise/U20/Configuration.h

+ 3
- 3
Marlin/src/HAL/HAL_DUE/usb/compiler.h ファイルの表示

@@ -230,7 +230,7 @@
230 230
 
231 231
 /* Define NO_INIT attribute */
232 232
 #if 0 //ndef NO_INIT
233
-#if defined   ( __CC_ARM   )
233
+#ifdef __CC_ARM
234 234
 #   define NO_INIT __attribute__((zero_init))
235 235
 #elif defined ( __ICCARM__ )
236 236
 #   define NO_INIT __no_init
@@ -262,7 +262,7 @@
262 262
 //! @{
263 263
 typedef unsigned char           Bool; //!< Boolean.
264 264
 #ifndef __cplusplus
265
-#if !defined(__bool_true_false_are_defined)
265
+#ifndef __bool_true_false_are_defined
266 266
 typedef unsigned char           bool; //!< Boolean.
267 267
 #endif
268 268
 #endif
@@ -443,7 +443,7 @@ typedef struct
443 443
 #define DISABLE   0
444 444
 #define ENABLE    1
445 445
 #ifndef __cplusplus
446
-#if !defined(__bool_true_false_are_defined)
446
+#ifndef __bool_true_false_are_defined
447 447
 #define false 0
448 448
 #define true 1
449 449
 #endif

+ 5
- 5
Marlin/src/HAL/HAL_DUE/usb/osc.h ファイルの表示

@@ -61,27 +61,27 @@ extern "C" {
61 61
  * Below BOARD_XXX macros are related to the specific board, and
62 62
  * should be defined by the board code, otherwise default value are used.
63 63
  */
64
-#if !defined(BOARD_FREQ_SLCK_XTAL)
64
+#ifndef BOARD_FREQ_SLCK_XTAL
65 65
 #  warning The board slow clock xtal frequency has not been defined.
66 66
 #  define BOARD_FREQ_SLCK_XTAL      (32768UL)
67 67
 #endif
68 68
 
69
-#if !defined(BOARD_FREQ_SLCK_BYPASS)
69
+#ifndef BOARD_FREQ_SLCK_BYPASS
70 70
 #  warning The board slow clock bypass frequency has not been defined.
71 71
 #  define BOARD_FREQ_SLCK_BYPASS    (32768UL)
72 72
 #endif
73 73
 
74
-#if !defined(BOARD_FREQ_MAINCK_XTAL)
74
+#ifndef BOARD_FREQ_MAINCK_XTAL
75 75
 #  warning The board main clock xtal frequency has not been defined.
76 76
 #  define BOARD_FREQ_MAINCK_XTAL    (12000000UL)
77 77
 #endif
78 78
 
79
-#if !defined(BOARD_FREQ_MAINCK_BYPASS)
79
+#ifndef BOARD_FREQ_MAINCK_BYPASS
80 80
 #  warning The board main clock bypass frequency has not been defined.
81 81
 #  define BOARD_FREQ_MAINCK_BYPASS  (12000000UL)
82 82
 #endif
83 83
 
84
-#if !defined(BOARD_OSC_STARTUP_US)
84
+#ifndef BOARD_OSC_STARTUP_US
85 85
 #  warning The board main clock xtal startup time has not been defined.
86 86
 #  define BOARD_OSC_STARTUP_US      (15625UL)
87 87
 #endif

+ 3
- 3
Marlin/src/HAL/HAL_DUE/usb/spc_protocol.h ファイルの表示

@@ -43,12 +43,12 @@
43 43
  * \asf_license_stop
44 44
  *
45 45
  */
46
+
46 47
 /*
47 48
  * Support and FAQ: visit <a href="http://www.atmel.com/design-support/">Atmel Support</a>
48 49
  */
49
-#ifndef  _SPC_PROTOCOL_H_
50
-#define  _SPC_PROTOCOL_H_
51
-
50
+#ifndef _SPC_PROTOCOL_H_
51
+#define _SPC_PROTOCOL_H_
52 52
 
53 53
 /**
54 54
  * \ingroup usb_msc_protocol

+ 1
- 1
Marlin/src/HAL/HAL_DUE/usb/udi_cdc.h ファイルの表示

@@ -55,7 +55,7 @@
55 55
 #include "udi.h"
56 56
 
57 57
 // Check the number of port
58
-#ifndef  UDI_CDC_PORT_NB
58
+#ifndef UDI_CDC_PORT_NB
59 59
 # define  UDI_CDC_PORT_NB 1
60 60
 #endif
61 61
 #if (UDI_CDC_PORT_NB < 1) || (UDI_CDC_PORT_NB > 7)

+ 1
- 1
Marlin/src/HAL/HAL_DUE/usb/udi_cdc_conf.h ファイルの表示

@@ -50,7 +50,7 @@
50 50
 #include "usb_protocol_cdc.h"
51 51
 #include "conf_usb.h"
52 52
 
53
-#ifndef  UDI_CDC_PORT_NB
53
+#ifndef UDI_CDC_PORT_NB
54 54
 # define  UDI_CDC_PORT_NB 1
55 55
 #endif
56 56
 

+ 1
- 1
Marlin/src/HAL/HAL_STM32F1/SPI.h ファイルの表示

@@ -58,7 +58,7 @@
58 58
 #define SPI_2XCLOCK_MASK 0x01  // SPI2X = bit 0 on SPSR
59 59
 
60 60
 // define SPI_AVR_EIMSK for AVR boards with external interrupt pins
61
-#if defined(EIMSK)
61
+#ifdef EIMSK
62 62
   #define SPI_AVR_EIMSK EIMSK
63 63
 #elif defined(GICR)
64 64
   #define SPI_AVR_EIMSK GICR

+ 1
- 1
Marlin/src/inc/SanityCheck.h ファイルの表示

@@ -892,7 +892,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
892 892
  * Switching Toolhead requirements
893 893
  */
894 894
 #if ENABLED(SWITCHING_TOOLHEAD)
895
-  #if !defined(SWITCHING_TOOLHEAD_SERVO_NR)
895
+  #ifndef SWITCHING_TOOLHEAD_SERVO_NR
896 896
     #error "SWITCHING_TOOLHEAD requires SWITCHING_TOOLHEAD_SERVO_NR."
897 897
   #elif EXTRUDERS < 2
898 898
     #error "SWITCHING_TOOLHEAD requires at least 2 EXTRUDERS."

+ 1
- 1
Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/basic/ftdi_basic.h ファイルの表示

@@ -24,7 +24,7 @@
24 24
 
25 25
 #include "../compat.h"
26 26
 
27
-#if !defined(__MARLIN_FIRMWARE__)
27
+#ifndef __MARLIN_FIRMWARE__
28 28
   #define FTDI_BASIC
29 29
 #endif
30 30
 

+ 6
- 6
Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/basic/spi.cpp ファイルの表示

@@ -27,7 +27,7 @@
27 27
 /********************************* SPI Functions *********************************/
28 28
 
29 29
 namespace FTDI {
30
-  #if !defined(CLCD_USE_SOFT_SPI)
30
+  #ifndef CLCD_USE_SOFT_SPI
31 31
     SPISettings SPI::spi_settings(SPI_FREQUENCY, MSBFIRST, SPI_MODE0);
32 32
   #endif
33 33
 
@@ -108,7 +108,7 @@ namespace FTDI {
108 108
 
109 109
   void SPI::spi_read_bulk (void *data, uint16_t len) {
110 110
     uint8_t* p = (uint8_t *)data;
111
-    #if !defined(CLCD_USE_SOFT_SPI)
111
+    #ifndef CLCD_USE_SOFT_SPI
112 112
       ::SPI.transfer(p, len);
113 113
     #else
114 114
       while (len--) *p++ = spi_recv();
@@ -123,7 +123,7 @@ namespace FTDI {
123 123
 
124 124
   // CLCD SPI - Chip Select
125 125
   void SPI::spi_ftdi_select (void) {
126
-    #if !defined(CLCD_USE_SOFT_SPI)
126
+    #ifndef CLCD_USE_SOFT_SPI
127 127
       ::SPI.beginTransaction(spi_settings);
128 128
     #endif
129 129
     WRITE(CLCD_SPI_CS, 0);
@@ -133,7 +133,7 @@ namespace FTDI {
133 133
   // CLCD SPI - Chip Deselect
134 134
   void SPI::spi_ftdi_deselect (void) {
135 135
     WRITE(CLCD_SPI_CS, 1);
136
-    #if !defined(CLCD_USE_SOFT_SPI)
136
+    #ifndef CLCD_USE_SOFT_SPI
137 137
       ::SPI.endTransaction();
138 138
     #endif
139 139
   }
@@ -141,7 +141,7 @@ namespace FTDI {
141 141
   #ifdef SPI_FLASH_SS
142 142
   // Serial SPI Flash SPI - Chip Select
143 143
   void SPI::spi_flash_select () {
144
-    #if !defined(CLCD_USE_SOFT_SPI)
144
+    #ifndef CLCD_USE_SOFT_SPI
145 145
     ::SPI.beginTransaction(spi_settings);
146 146
     #endif
147 147
     WRITE(SPI_FLASH_SS, 0);
@@ -151,7 +151,7 @@ namespace FTDI {
151 151
   // Serial SPI Flash SPI - Chip Deselect
152 152
   void SPI::spi_flash_deselect () {
153 153
     WRITE(SPI_FLASH_SS, 1);
154
-    #if !defined(CLCD_USE_SOFT_SPI)
154
+    #ifndef CLCD_USE_SOFT_SPI
155 155
     ::SPI.endTransaction();
156 156
     #endif
157 157
   }

+ 2
- 2
Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/basic/spi.h ファイルの表示

@@ -22,13 +22,13 @@
22 22
 
23 23
 #pragma once
24 24
 
25
-#if !defined(CLCD_USE_SOFT_SPI)
25
+#ifndef CLCD_USE_SOFT_SPI
26 26
   #include <SPI.h>
27 27
 #endif
28 28
 
29 29
 namespace FTDI {
30 30
   namespace SPI {
31
-    #if !defined(CLCD_USE_SOFT_SPI)
31
+    #ifndef CLCD_USE_SOFT_SPI
32 32
       extern SPISettings spi_settings;
33 33
     #endif
34 34
 

+ 1
- 1
Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/compat.h ファイルの表示

@@ -31,7 +31,7 @@
31 31
 
32 32
   #include <Arduino.h>
33 33
 
34
-  #if !defined(CLCD_USE_SOFT_SPI)
34
+  #ifndef CLCD_USE_SOFT_SPI
35 35
     #include <SPI.h>
36 36
   #endif
37 37
 

+ 1
- 1
Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/extended/ftdi_extended.h ファイルの表示

@@ -25,7 +25,7 @@
25 25
 #include "../compat.h"
26 26
 #include "../basic/ftdi_basic.h"
27 27
 
28
-#if !defined(__MARLIN_FIRMWARE__)
28
+#ifndef __MARLIN_FIRMWARE__
29 29
   #define FTDI_EXTENDED
30 30
 #endif
31 31
 

+ 1
- 1
Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/screens.h ファイルの表示

@@ -209,7 +209,7 @@ class SpinnerDialogBox : public DialogBoxBaseClass, public CachedScreen<SPINNER_
209 209
     static void enqueueAndWait_P(const progmem_str message, const progmem_str commands);
210 210
 };
211 211
 
212
-#if !defined(LULZBOT_USE_BIOPRINTER_UI)
212
+#ifndef LULZBOT_USE_BIOPRINTER_UI
213 213
 class StatusScreen : public BaseScreen, public CachedScreen<STATUS_SCREEN_CACHE,STATUS_SCREEN_DL_SIZE> {
214 214
   private:
215 215
     static void draw_axis_position(draw_mode_t);

+ 1
- 1
Marlin/src/pins/lpc1768/pins_RAMPS_RE_ARM.h ファイルの表示

@@ -128,7 +128,7 @@
128 128
   // P2_08 E1-Step
129 129
   // P2_13 E1-Dir
130 130
 
131
-  #ifndef  X_SERIAL_TX_PIN
131
+  #ifndef X_SERIAL_TX_PIN
132 132
     #define X_SERIAL_TX_PIN  P0_01
133 133
   #endif
134 134
   #ifndef X_SERIAL_RX_PIN

+ 1
- 1
Marlin/src/pins/ramps/pins_Z_BOLT_X_SERIES.h ファイルの表示

@@ -25,7 +25,7 @@
25 25
  *  Z-Bolt X Series board – based on Arduino Mega2560
26 26
  */
27 27
 
28
-#if !defined(__AVR_ATmega2560__)
28
+#ifndef __AVR_ATmega2560__
29 29
   #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'"
30 30
 #elif HOTENDS > 4 || E_STEPPERS > 4
31 31
   #error "Z-Bolt X Series board supports up to 4 hotends / E-steppers."

+ 1
- 1
Marlin/src/sd/usb_flashdrive/lib-uhs2/settings.h ファイルの表示

@@ -153,7 +153,7 @@
153 153
 // define XMEM_ACQUIRE_SPI and XMEM_RELEASE_SPI to point to your lock and unlock.
154 154
 // NOTE: NO argument is passed. You have to do this within your routine for
155 155
 // whatever you are using to lock and unlock.
156
-#if !defined(XMEM_ACQUIRE_SPI)
156
+#ifndef XMEM_ACQUIRE_SPI
157 157
   #if USE_XMEM_SPI_LOCK || defined(USE_MULTIPLE_APP_API)
158 158
     #include <xmem.h>
159 159
   #else

+ 1
- 1
Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_BULK_STORAGE/UHS_BULK_STORAGE.h ファイルの表示

@@ -24,7 +24,7 @@ Web      :  http://www.circuitsathome.com
24 24
 e-mail   :  support@circuitsathome.com
25 25
  */
26 26
 
27
-#if !defined(__UHS_BULK_STORAGE_H__)
27
+#ifndef __UHS_BULK_STORAGE_H__
28 28
 #define __UHS_BULK_STORAGE_H__
29 29
 
30 30
 

+ 2
- 2
Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_UsbCore.h ファイルの表示

@@ -33,11 +33,11 @@ e-mail   :  support@circuitsathome.com
33 33
 #define                UHS_HOST_MAX_INTERFACE_DRIVERS 0x10U // Default maximum number of USB interface drivers
34 34
 #endif
35 35
 
36
-#if !defined(SYSTEM_OR_SPECIAL_YIELD)
36
+#ifndef SYSTEM_OR_SPECIAL_YIELD
37 37
 #define SYSTEM_OR_SPECIAL_YIELD(...) VOID0
38 38
 #endif
39 39
 
40
-#if !defined(SYSTEM_OR_SPECIAL_YIELD_FROM_ISR)
40
+#ifndef SYSTEM_OR_SPECIAL_YIELD_FROM_ISR
41 41
 #define SYSTEM_OR_SPECIAL_YIELD_FROM_ISR(...) SYSTEM_OR_SPECIAL_YIELD
42 42
 #endif
43 43
 

+ 1
- 1
Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_address.h ファイルの表示

@@ -226,7 +226,7 @@ public:
226 226
                 }
227 227
                 thePool[index].address = addr;
228 228
 #if DEBUG_PRINTF_EXTRA_HUGE
229
-#if defined(UHS_DEBUG_USB_ADDRESS)
229
+#ifdef UHS_DEBUG_USB_ADDRESS
230 230
                 printf("Address: %x (%x.%x.%x)\r\n", addr.devAddress, addr.bmHub, addr.bmParent, addr.bmAddress);
231 231
 #endif
232 232
 #endif

+ 8
- 8
Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_host.h ファイルの表示

@@ -58,7 +58,7 @@ e-mail   :  support@circuitsathome.com
58 58
 #include "UHS_host_INLINE.h"
59 59
 #include "UHS_printf_HELPER.h"
60 60
 
61
-#if defined(LOAD_USB_HOST_SHIELD)
61
+#ifdef LOAD_USB_HOST_SHIELD
62 62
 #include "USB_HOST_SHIELD/USB_HOST_SHIELD.h"
63 63
 #endif
64 64
 
@@ -72,24 +72,24 @@ e-mail   :  support@circuitsathome.com
72 72
 
73 73
 // Load USB drivers and multiplexers
74 74
 
75
-#if defined(LOAD_UHS_HUB)
75
+#ifdef LOAD_UHS_HUB
76 76
 #include "UHS_HUB/UHS_HUB.h"
77 77
 #endif // HUB loaded
78 78
 
79
-#if defined(LOAD_UHS_BULK_STORAGE)
79
+#ifdef LOAD_UHS_BULK_STORAGE
80 80
 #include "UHS_BULK_STORAGE/UHS_BULK_STORAGE.h"
81 81
 #endif
82 82
 
83
-#if defined(LOAD_GENERIC_STORAGE)
83
+#ifdef LOAD_GENERIC_STORAGE
84 84
 #include "../UHS_FS/UHS_FS.h"
85 85
 #endif
86 86
 // Add BT and optionally HID if directed to do so
87
-#if defined(LOAD_UHS_BT)
87
+#ifdef LOAD_UHS_BT
88 88
 #include "UHS_BT/UHS_BT.h"
89 89
 #endif // BT and optionally HID loaded
90 90
 
91 91
 // Add HID
92
-#if defined(LOAD_UHS_HID)
92
+#ifdef LOAD_UHS_HID
93 93
 #include "UHS_HID/UHS_HID.h"
94 94
 #endif // HID loaded
95 95
 
@@ -98,11 +98,11 @@ e-mail   :  support@circuitsathome.com
98 98
 #include "UHS_CDC/UHS_CDC.h"
99 99
 #endif // CDC loaded
100 100
 
101
-#if defined(LOAD_UHS_ADK)
101
+#ifdef LOAD_UHS_ADK
102 102
 #include "UHS_ADK/UHS_ADK.h"
103 103
 #endif
104 104
 
105
-#if defined(LOAD_UHS_MIDI)
105
+#ifdef LOAD_UHS_MIDI
106 106
 #include "UHS_MIDI/UHS_MIDI.h"
107 107
 #endif
108 108
 

+ 10
- 10
Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_macros.h ファイルの表示

@@ -24,7 +24,7 @@ Web      :  http://www.circuitsathome.com
24 24
 e-mail   :  support@circuitsathome.com
25 25
  */
26 26
 
27
-#if !defined(MACROS_H)
27
+#ifndef MACROS_H
28 28
 #define MACROS_H
29 29
 #include "macro_logic.h"
30 30
 /*
@@ -49,18 +49,18 @@ e-mail   :  support@circuitsathome.com
49 49
 
50 50
 // Nuke screwed up macro junk from the IDE.
51 51
 #ifdef __cplusplus
52
-#if defined(true)
52
+#ifdef true
53 53
 #undef true
54 54
 #endif
55
-#if defined(false)
55
+#ifdef false
56 56
 #undef false
57 57
 #endif
58 58
 #endif
59 59
 
60 60
 
61
-#if !defined(UHS_DEVICE_WINDOWS_USB_SPEC_VIOLATION_DESCRIPTOR_DEVICE)
61
+#ifndef UHS_DEVICE_WINDOWS_USB_SPEC_VIOLATION_DESCRIPTOR_DEVICE
62 62
 
63
-#if !defined(UHS_BIG_FLASH)
63
+#ifndef UHS_BIG_FLASH
64 64
 
65 65
 #if defined(FLASHEND) && defined(FLASHSTART)
66 66
 #if (FLASHEND - FLASHSTART) > 0x0FFFFU
@@ -122,10 +122,10 @@ e-mail   :  support@circuitsathome.com
122 122
 // TODO: Fast inline code for AVR and SAM based microcontrollers
123 123
 //       This can be done pretty easily.
124 124
 //       For now, this will just work out-of-the-box.
125
-#if !defined(UHS_PIN_WRITE)
125
+#ifndef UHS_PIN_WRITE
126 126
 #define UHS_PIN_WRITE(p, v) digitalWrite(p, v)
127 127
 #endif
128
-#if !defined(UHS_PIN_READ)
128
+#ifndef UHS_PIN_READ
129 129
 #define UHS_PIN_READ(p) digitalRead(p)
130 130
 #endif
131 131
 
@@ -134,8 +134,8 @@ e-mail   :  support@circuitsathome.com
134 134
 #edfine noInterrupts() __builtin_disable_interrupts()
135 135
 #endif
136 136
 
137
-#if !defined(ARDUINO_SAMD_ZERO)
138
-#if defined(ARDUINO_AVR_ADK)
137
+#ifndef ARDUINO_SAMD_ZERO
138
+#ifdef ARDUINO_AVR_ADK
139 139
 #define UHS_GET_DPI(x) (x == 54 ? 6 : digitalPinToInterrupt(x))
140 140
 #else
141 141
 #define UHS_GET_DPI(x) digitalPinToInterrupt(x)
@@ -386,7 +386,7 @@ e-mail   :  support@circuitsathome.com
386 386
 #define USBTRACE2X(s,r) (USBTRACE3X((s),(r),0x80)); USB_HOST_SERIAL.flush()
387 387
 
388 388
 #define VOID0 ((void)0)
389
-#if !defined(NOTUSED)
389
+#ifndef NOTUSED
390 390
 #define NOTUSED(...)  __VA_ARGS__ __attribute__((unused))
391 391
 #endif
392 392
 #endif /* MACROS_H */

+ 7
- 7
Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_printf_HELPER.h ファイルの表示

@@ -27,7 +27,7 @@ e-mail   :  support@circuitsathome.com
27 27
 #ifndef UHS_PRINTF_HELPER_H
28 28
 #define	UHS_PRINTF_HELPER_H
29 29
 
30
-#if defined(LOAD_UHS_PRINTF_HELPER)
30
+#ifdef LOAD_UHS_PRINTF_HELPER
31 31
 #include <Arduino.h>
32 32
 #ifdef true
33 33
 #undef true
@@ -36,14 +36,14 @@ e-mail   :  support@circuitsathome.com
36 36
 #undef false
37 37
 #endif
38 38
 
39
-#if !defined(STDIO_IS_OK_TO_USE_AS_IS)
39
+#ifndef STDIO_IS_OK_TO_USE_AS_IS
40 40
 #if defined(ARDUINO_SAMD_ZERO) || defined(ARDUINO_SAM_DUE) || defined(ARDUINO_spresense_ast)
41 41
 // STDIO patching not required.
42 42
 #define STDIO_IS_OK_TO_USE_AS_IS
43 43
 #endif
44 44
 #endif
45 45
 
46
-#if !defined(STDIO_IS_OK_TO_USE_AS_IS)
46
+#ifndef STDIO_IS_OK_TO_USE_AS_IS
47 47
 // We need to patch STDIO so it can be used.
48 48
 
49 49
 #ifndef SERIAL_PORT_MONITOR
@@ -64,7 +64,7 @@ e-mail   :  support@circuitsathome.com
64 64
 #endif
65 65
 #endif
66 66
 
67
-#if !defined(NOTUSED)
67
+#ifndef NOTUSED
68 68
 #define NOTUSED(...)  __VA_ARGS__ __attribute__((unused))
69 69
 #endif
70 70
 
@@ -74,7 +74,7 @@ e-mail   :  support@circuitsathome.com
74 74
 #endif
75 75
 #endif
76 76
 
77
-#if defined(ARDUINO_ARCH_PIC32)
77
+#ifdef ARDUINO_ARCH_PIC32
78 78
 /*
79 79
  * For printf() output with pic32 Arduino
80 80
  */
@@ -169,7 +169,7 @@ extern "C" {
169 169
 
170 170
 
171 171
 
172
-#if defined(__AVR__)
172
+#ifdef __AVR__
173 173
 // The only wierdo in the bunch...
174 174
 void UHS_AVR_printf_HELPER_init(void) {
175 175
         // Set up stdio/stderr
@@ -194,7 +194,7 @@ void UHS_AVR_printf_HELPER_init(void) {
194 194
 #endif /* STDIO_IS_OK_TO_USE_AS_IS */
195 195
 #endif  /* load.... */
196 196
 
197
-#if !defined(UHS_printf_HELPER_init)
197
+#ifndef UHS_printf_HELPER_init
198 198
 #define UHS_printf_HELPER_init() (void(0))
199 199
 #endif
200 200
 #endif	/* UHS_PRINTF_HELPER_H */

+ 6
- 6
Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_usbhost.h ファイルの表示

@@ -24,19 +24,19 @@ Web      :  http://www.circuitsathome.com
24 24
 e-mail   :  support@circuitsathome.com
25 25
  */
26 26
 
27
-#if !defined(_UHS_host_h_)
27
+#ifndef _UHS_host_h_
28 28
 #error "Never include UHS_usbhost.h directly; include UHS_host.h instead"
29 29
 #else
30
-#if !defined(_USBHOST_H_)
30
+#ifndef _USBHOST_H_
31 31
 #define _USBHOST_H_
32 32
 
33 33
 // Very early prototypes
34
-#if defined(UHS_LOAD_BT)
34
+#ifdef UHS_LOAD_BT
35 35
 void UHS_BT_SetUSBInterface(UHS_USB_HOST_BASE *host, ENUMERATION_INFO *ei);
36 36
 void UHS_BT_ScanUninitialized(UHS_USB_HOST_BASE *host);
37 37
 void UHS_BT_Poll(UHS_USB_HOST_BASE *host);
38 38
 #endif
39
-#if defined(UHS_LOAD_HID)
39
+#ifdef UHS_LOAD_HID
40 40
 void UHS_HID_SetUSBInterface(UHS_USB_HOST_BASE *host, ENUMERATION_INFO *ei);
41 41
 void UHS_HID_ScanUninitialized(UHS_USB_HOST_BASE *host);
42 42
 void UHS_HID_Poll(UHS_USB_HOST_BASE *host);
@@ -185,10 +185,10 @@ public:
185 185
         /////////////////////////////////////////////
186 186
         // these two probably will go away, and won't be used, TBD
187 187
         inline void Poll_Others(void) {
188
-#if defined(UHS_LOAD_BT)
188
+#ifdef UHS_LOAD_BT
189 189
                 UHS_BT_Poll(this);
190 190
 #endif
191
-#if defined(UHS_LOAD_HID)
191
+#ifdef UHS_LOAD_HID
192 192
                 UHS_HID_Poll(this);
193 193
 #endif
194 194
         }

+ 23
- 23
Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/USB_HOST_SHIELD/USB_HOST_SHIELD.h ファイルの表示

@@ -28,10 +28,10 @@ e-mail   :  support@circuitsathome.com
28 28
 #include <SPI.h>
29 29
 
30 30
 
31
-#if !defined(SPI_HAS_TRANSACTION)
31
+#ifndef SPI_HAS_TRANSACTION
32 32
 #error "Your SPI library installation is too old."
33 33
 #else
34
-#if !defined(SPI_ATOMIC_VERSION)
34
+#ifndef SPI_ATOMIC_VERSION
35 35
 #warning "Your SPI library installation lacks 'SPI_ATOMIC_VERSION'. Please complain to the maintainer."
36 36
 #elif SPI_ATOMIC_VERSION < 1
37 37
 #error "Your SPI library installation is too old."
@@ -48,8 +48,8 @@ e-mail   :  support@circuitsathome.com
48 48
 #define MAX_HOST_DEBUG(...) VOID0
49 49
 #endif
50 50
 
51
-#if !defined(USB_HOST_SHIELD_USE_ISR)
52
-#if defined(USE_MULTIPLE_APP_API)
51
+#ifndef USB_HOST_SHIELD_USE_ISR
52
+#ifdef USE_MULTIPLE_APP_API
53 53
 #define USB_HOST_SHIELD_USE_ISR 0
54 54
 #else
55 55
 #define USB_HOST_SHIELD_USE_ISR 1
@@ -66,7 +66,7 @@ e-mail   :  support@circuitsathome.com
66 66
 //
67 67
 // Polled defaults
68 68
 //
69
-#if defined(BOARD_BLACK_WIDDOW)
69
+#ifdef BOARD_BLACK_WIDDOW
70 70
 #define UHS_MAX3421E_SS_ 6
71 71
 #define UHS_MAX3421E_INT_ 3
72 72
 #elif defined(CORE_TEENSY) && (defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB1286__))
@@ -91,7 +91,7 @@ e-mail   :  support@circuitsathome.com
91 91
 #endif
92 92
 
93 93
 #else
94
-#if defined(ARDUINO_ARCH_PIC32)
94
+#ifdef ARDUINO_ARCH_PIC32
95 95
 // PIC32 only allows edge interrupts, isn't that lovely? We'll emulate it...
96 96
 #if CHANGE < 2
97 97
 #error core too old.
@@ -113,8 +113,8 @@ e-mail   :  support@circuitsathome.com
113 113
 #endif
114 114
 
115 115
 // More stupidity from our friends @ Sony...
116
-#if defined(ARDUINO_spresense_ast)
117
-#if !defined(NOT_AN_INTERRUPT)
116
+#ifdef ARDUINO_spresense_ast
117
+#ifndef NOT_AN_INTERRUPT
118 118
 #define NOT_AN_INTERRUPT -1
119 119
 #endif
120 120
 #endif
@@ -158,7 +158,7 @@ e-mail   :  support@circuitsathome.com
158 158
 #else
159 159
 #define UHS_MAX3421E_SS_ 10
160 160
 #ifdef __AVR__
161
-#if defined(__AVR_ATmega32U4__)
161
+#ifdef __AVR_ATmega32U4__
162 162
 #define INT_FOR_PIN2 1
163 163
 #define INT_FOR_PIN3 0
164 164
 #else
@@ -169,7 +169,7 @@ e-mail   :  support@circuitsathome.com
169 169
 #define UHS_MAX3421E_INT_ 3
170 170
 #else
171 171
 // Non-avr
172
-#if defined(ARDUINO_ARCH_PIC32)
172
+#ifdef ARDUINO_ARCH_PIC32
173 173
 // UNO32 External Interrupts:
174 174
 // Pin 38 (INT0), Pin 2 (INT1), Pin 7 (INT2), Pin 8 (INT3), Pin 35 (INT4)
175 175
 #define UHS_MAX3421E_INT_ 7
@@ -182,7 +182,7 @@ e-mail   :  support@circuitsathome.com
182 182
 
183 183
 
184 184
 
185
-#if defined(NO_AUTO_SPEED)
185
+#ifdef NO_AUTO_SPEED
186 186
 // Ugly details section...
187 187
 // MAX3421E characteristics
188 188
 // SPI Serial - Clock Input. An external SPI master supplies SCLK with frequencies up to 26MHz. The
@@ -195,8 +195,8 @@ e-mail   :  support@circuitsathome.com
195 195
 // Theoretical deadline for reply 17.7ns
196 196
 // 26MHz 38.4615ns period <-- MAX3421E theoretical maximum
197 197
 
198
-#if !defined(UHS_MAX3421E_SPD)
199
-#if defined(ARDUINO_SAMD_ZERO)
198
+#ifndef UHS_MAX3421E_SPD
199
+#ifdef ARDUINO_SAMD_ZERO
200 200
 // Zero violates spec early, needs a long setup time, or doesn't like high latency.
201 201
 #define UHS_MAX3421E_SPD 10000000
202 202
 #elif defined(ARDUINO_ARCH_PIC32)
@@ -225,7 +225,7 @@ e-mail   :  support@circuitsathome.com
225 225
 // Why not 26MHz? Because I have not found any MCU board that
226 226
 // can actually go that fast without problems.
227 227
 // Could be a shield limitation too.
228
-#if !defined(UHS_MAX3421E_SPD)
228
+#ifndef UHS_MAX3421E_SPD
229 229
 #define UHS_MAX3421E_SPD 25000000
230 230
 #endif
231 231
 #endif
@@ -271,7 +271,7 @@ e-mail   :  support@circuitsathome.com
271 271
 //      |______|         |______| |______| |______________|
272 272
 //
273 273
 #define IRQ_SENSE FALLING
274
-#if defined(ARDUINO_ARCH_PIC32)
274
+#ifdef ARDUINO_ARCH_PIC32
275 275
 //#define bmPULSEWIDTH PUSLEWIDTH10_6
276 276
 #define bmPULSEWIDTH 0
277 277
 #define bmIRQ_SENSE 0
@@ -280,20 +280,20 @@ e-mail   :  support@circuitsathome.com
280 280
 #define bmIRQ_SENSE 0
281 281
 #endif
282 282
 #else
283
-#if !defined(IRQ_SENSE)
283
+#ifndef IRQ_SENSE
284 284
 #define IRQ_SENSE LOW
285 285
 #endif
286
-#if !defined(bmPULSEWIDTH)
286
+#ifndef bmPULSEWIDTH
287 287
 #define bmPULSEWIDTH 0
288 288
 #endif
289
-#if !defined(bmIRQ_SENSE)
289
+#ifndef bmIRQ_SENSE
290 290
 #define bmIRQ_SENSE bmINTLEVEL
291 291
 #endif
292 292
 #endif
293 293
 
294 294
 class MAX3421E_HOST :
295 295
 public UHS_USB_HOST_BASE
296
-#if defined(SWI_IRQ_NUM)
296
+#ifdef SWI_IRQ_NUM
297 297
 , public dyn_SWI
298 298
 #endif
299 299
 {
@@ -487,7 +487,7 @@ public:
487 487
         uint8_t* bytesRd(uint8_t reg, uint8_t nbytes, uint8_t* data_p);
488 488
 
489 489
         // ARM/NVIC specific, used to emulate reentrant ISR.
490
-#if defined(SWI_IRQ_NUM)
490
+#ifdef SWI_IRQ_NUM
491 491
 
492 492
         void dyn_SWISR(void) {
493 493
                 ISRbottom();
@@ -498,7 +498,7 @@ public:
498 498
                 // Used on MCU that lack control of IRQ priority (AVR).
499 499
                 // Suspends ISRs, for critical code. IRQ will be serviced after it is resumed.
500 500
                 // NOTE: you must track the state yourself!
501
-#if defined(__AVR__)
501
+#ifdef __AVR__
502 502
                 noInterrupts();
503 503
                 detachInterrupt(UHS_GET_DPI(irq_pin));
504 504
                 interrupts();
@@ -507,10 +507,10 @@ public:
507 507
 
508 508
         virtual void UHS_NI resume_host(void);
509 509
 };
510
-#if !defined(SPIclass)
510
+#ifndef SPIclass
511 511
 #define SPIclass SPI
512 512
 #endif
513
-#if !defined(USB_HOST_SHIELD_LOADED)
513
+#ifndef USB_HOST_SHIELD_LOADED
514 514
 #include "USB_HOST_SHIELD_INLINE.h"
515 515
 #endif
516 516
 #else

+ 7
- 7
Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/USB_HOST_SHIELD/USB_HOST_SHIELD_INLINE.h ファイルの表示

@@ -21,7 +21,7 @@ e-mail   :  support@circuitsathome.com
21 21
 #define USB_HOST_SHIELD_LOADED
22 22
 #include <Arduino.h>
23 23
 
24
-#if !defined(digitalPinToInterrupt)
24
+#ifndef digitalPinToInterrupt
25 25
 #error digitalPinToInterrupt not defined, complain to your board maintainer.
26 26
 #endif
27 27
 
@@ -49,7 +49,7 @@ void UHS_NI MAX3421E_HOST::resume_host(void) {
49 49
                 // Used on MCU that lack control of IRQ priority (AVR).
50 50
                 // Resumes ISRs.
51 51
                 // NOTE: you must track the state yourself!
52
-#if defined(__AVR__)
52
+#ifdef __AVR__
53 53
                 noInterrupts();
54 54
                 if(irq_pin & 1) {
55 55
                         ISRodd = this;
@@ -314,7 +314,7 @@ int16_t UHS_NI MAX3421E_HOST::Init(int16_t mseconds) {
314 314
 #if USB_HOST_SHIELD_USE_ISR
315 315
         int intr = digitalPinToInterrupt(irq_pin);
316 316
         if(intr == NOT_AN_INTERRUPT) {
317
-#if defined(ARDUINO_AVR_ADK)
317
+#ifdef ARDUINO_AVR_ADK
318 318
                 if(irq_pin == 54)
319 319
                         intr = 6;
320 320
                 else
@@ -325,7 +325,7 @@ int16_t UHS_NI MAX3421E_HOST::Init(int16_t mseconds) {
325 325
 #else
326 326
         SPIclass.usingInterrupt(255);
327 327
 #endif
328
-#if !defined(NO_AUTO_SPEED)
328
+#ifndef NO_AUTO_SPEED
329 329
         // test to get to reset acceptance.
330 330
         uint32_t spd = UHS_MAX3421E_SPD;
331 331
 again:
@@ -901,7 +901,7 @@ void UHS_NI MAX3421E_HOST::ISRTask(void)
901 901
 {
902 902
         DDSB();
903 903
 
904
-#if !defined(SWI_IRQ_NUM)
904
+#ifndef SWI_IRQ_NUM
905 905
         suspend_host();
906 906
 #if USB_HOST_SHIELD_USE_ISR
907 907
         // Enable interrupts
@@ -965,7 +965,7 @@ void UHS_NI MAX3421E_HOST::ISRTask(void)
965 965
                 //        usb_task_polling_disabled? "T" : "F");
966 966
                 DDSB();
967 967
                 regWr(rHIRQ, HIRQ_sendback);
968
-#if !defined(SWI_IRQ_NUM)
968
+#ifndef SWI_IRQ_NUM
969 969
         resume_host();
970 970
 #if USB_HOST_SHIELD_USE_ISR
971 971
         // Disable interrupts
@@ -981,7 +981,7 @@ void UHS_NI MAX3421E_HOST::ISRTask(void)
981 981
                         UHS_PIN_WRITE(USB_HOST_SHIELD_TIMING_PIN, HIGH);
982 982
 #endif
983 983
 
984
-#if defined(SWI_IRQ_NUM)
984
+#ifdef SWI_IRQ_NUM
985 985
                         // MAX_HOST_DEBUG(PSTR("--------------- Doing SWI ----------------"));
986 986
                         exec_SWI(this);
987 987
 #else

+ 1
- 1
Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/macro_logic.h ファイルの表示

@@ -139,7 +139,7 @@ AJK_IIF(AJK_BITAND(AJK_IS_COMPARABLE(x))(AJK_IS_COMPARABLE(y)) ) \
139 139
 
140 140
 #define AJK_FUN(AJK_count, AJK_v, AJK_args, AJK_body) AJK_v ## AJK_count (AJK_args) { AJK_body(AJK_count) }
141 141
 #define AJK_MAKE_FUNS(AJK_v, AJK_args, AJK_count, AJK_body) AJK_EVAL(AJK_REPEAT(AJK_count, AJK_FUN, AJK_v, AJK_args, AJK_body))
142
-#if defined(AJK_TEST_MACRO_LOGIC)
142
+#ifdef AJK_TEST_MACRO_LOGIC
143 143
 
144 144
 #define BODY(AJKindex) some(C, statement); contaning(a, test[AJKindex]);
145 145
 #define ZERO_TIMES_TEST 0

+ 16
- 16
Marlin/src/sd/usb_flashdrive/lib-uhs3/dyn_SWI/SWI_INLINE.h ファイルの表示

@@ -35,8 +35,8 @@
35 35
 static char dyn_SWI_initied = 0;
36 36
 static dyn_SWI* dyn_SWI_LIST[SWI_MAXIMUM_ALLOWED];
37 37
 static dyn_SWI* dyn_SWI_EXEC[SWI_MAXIMUM_ALLOWED];
38
-#if defined(__arm__)
39
-#if defined(__USE_CMSIS_VECTORS__)
38
+#ifdef __arm__
39
+#ifdef __USE_CMSIS_VECTORS__
40 40
 extern "C" {
41 41
         void (*_VectorsRam[VECTORTABLE_SIZE])(void)__attribute__((aligned(VECTORTABLE_ALIGNMENT)));
42 42
 }
@@ -55,20 +55,20 @@ __attribute__((always_inline)) static inline void __DSB(void) {
55 55
 /**
56 56
  * Execute queued class ISR routines.
57 57
  */
58
-#if defined(ARDUINO_ARCH_PIC32)
58
+#ifdef ARDUINO_ARCH_PIC32
59 59
 static p32_regset *ifs = ((p32_regset *) & IFS0) + (SWI_IRQ_NUM / 32); //interrupt flag register set
60 60
 static p32_regset *iec = ((p32_regset *) & IEC0) + (SWI_IRQ_NUM / 32); //interrupt enable control reg set
61 61
 static uint32_t swibit = 1 << (SWI_IRQ_NUM % 32);
62 62
 
63 63
 void
64
-#if defined(__PIC32MZXX__)
64
+#ifdef __PIC32MZXX__
65 65
         __attribute__((nomips16,at_vector(SWI_VECTOR),interrupt(SWI_IPL)))
66 66
 #else
67 67
         __attribute__((interrupt(),nomips16))
68 68
 #endif
69 69
         softISR(void) {
70 70
 #else
71
-#if defined(ARDUINO_spresense_ast)
71
+#ifdef ARDUINO_spresense_ast
72 72
 unsigned int softISR(void) {
73 73
 #else
74 74
 void softISR(void) {
@@ -82,7 +82,7 @@ void softISR(void) {
82 82
 
83 83
         // Make a working copy, while clearing the queue.
84 84
         noInterrupts();
85
-#if defined(ARDUINO_ARCH_PIC32)
85
+#ifdef ARDUINO_ARCH_PIC32
86 86
         //ifs->clr = swibit;
87 87
 #endif
88 88
         for(int i = 0; i < SWI_MAXIMUM_ALLOWED; i++) {
@@ -95,21 +95,21 @@ void softISR(void) {
95 95
         // Execute each class SWI
96 96
         for(int i = 0; i < SWI_MAXIMUM_ALLOWED; i++) {
97 97
                 if(dyn_SWI_EXEC[i]) {
98
-#if defined(__DYN_SWI_DEBUG_LED__)
98
+#ifdef __DYN_SWI_DEBUG_LED__
99 99
                         digitalWrite(__DYN_SWI_DEBUG_LED__, HIGH);
100 100
 #endif
101 101
                         dyn_SWI_EXEC[i]->dyn_SWISR();
102
-#if defined(__DYN_SWI_DEBUG_LED__)
102
+#ifdef __DYN_SWI_DEBUG_LED__
103 103
                         digitalWrite(__DYN_SWI_DEBUG_LED__, LOW);
104 104
 #endif
105 105
                 }
106 106
         }
107
-#if defined(ARDUINO_ARCH_PIC32)
107
+#ifdef ARDUINO_ARCH_PIC32
108 108
         noInterrupts();
109 109
         if(!dyn_SWI_EXEC[0]) ifs->clr = swibit;
110 110
         interrupts();
111 111
 #endif
112
-#if defined(ARDUINO_spresense_ast)
112
+#ifdef ARDUINO_spresense_ast
113 113
         return 0;
114 114
 #endif
115 115
 }
@@ -118,7 +118,7 @@ void softISR(void) {
118 118
 #endif
119 119
 
120 120
 
121
-#if defined(__arm__)
121
+#ifdef __arm__
122 122
 #ifndef interruptsStatus
123 123
 #define interruptsStatus() __interruptsStatus()
124 124
 static inline unsigned char __interruptsStatus(void) __attribute__((always_inline, unused));
@@ -136,7 +136,7 @@ static inline unsigned char __interruptsStatus(void) {
136 136
  */
137 137
 static void Init_dyn_SWI(void) {
138 138
         if(!dyn_SWI_initied) {
139
-#if defined(__USE_CMSIS_VECTORS__)
139
+#ifdef __USE_CMSIS_VECTORS__
140 140
                 uint32_t *X_Vectors = (uint32_t*)SCB->VTOR;
141 141
                 for(int i = 0; i < VECTORTABLE_SIZE; i++) {
142 142
                         _VectorsRam[i] = reinterpret_cast<void (*)()>(X_Vectors[i]); /* copy vector table to RAM */
@@ -147,7 +147,7 @@ static void Init_dyn_SWI(void) {
147 147
                 DDSB();
148 148
                 interrupts();
149 149
 #endif
150
-#if !defined(ARDUINO_spresense_ast)
150
+#ifndef ARDUINO_spresense_ast
151 151
                 for(int i = 0; i < SWI_MAXIMUM_ALLOWED; i++) dyn_SWI_LIST[i] = NULL;
152 152
                 noInterrupts();
153 153
                 _VectorsRam[SWI_IRQ_NUM + 16] = reinterpret_cast<void (*)()>(softISR);
@@ -156,7 +156,7 @@ static void Init_dyn_SWI(void) {
156 156
                 NVIC_SET_PRIORITY(SWI_IRQ_NUM, 255);
157 157
                 NVIC_ENABLE_IRQ(SWI_IRQ_NUM);
158 158
 #endif
159
-#if defined(__DYN_SWI_DEBUG_LED__)
159
+#ifdef __DYN_SWI_DEBUG_LED__
160 160
                 pinMode(__DYN_SWI_DEBUG_LED__, OUTPUT);
161 161
                 digitalWrite(__DYN_SWI_DEBUG_LED__, LOW);
162 162
 #endif
@@ -180,7 +180,7 @@ int exec_SWI(const dyn_SWI* klass) {
180 180
                 if(!dyn_SWI_LIST[i]) {
181 181
                         rc = 1 + i; // Success!
182 182
                         dyn_SWI_LIST[i] = (dyn_SWI*)klass;
183
-#if !defined(ARDUINO_spresense_ast)
183
+#ifndef ARDUINO_spresense_ast
184 184
                         if(!NVIC_GET_PENDING(SWI_IRQ_NUM)) NVIC_SET_PENDING(SWI_IRQ_NUM);
185 185
 #else
186 186
                         // Launch 1-shot timer as an emulated SWI
@@ -211,7 +211,7 @@ static void Init_dyn_SWI(void) {
211 211
                 iec->clr = swibit;
212 212
                 iec->set = swibit;
213 213
                 restoreInterrupts(sreg);
214
-#if defined(__DYN_SWI_DEBUG_LED__)
214
+#ifdef __DYN_SWI_DEBUG_LED__
215 215
                 pinMode(__DYN_SWI_DEBUG_LED__, OUTPUT);
216 216
                 UHS_PIN_WRITE(__DYN_SWI_DEBUG_LED__, LOW);
217 217
 #endif

+ 9
- 9
Marlin/src/sd/usb_flashdrive/lib-uhs3/dyn_SWI/dyn_SWI.h ファイルの表示

@@ -24,26 +24,26 @@
24 24
 
25 25
 
26 26
 #if defined(__arm__) || defined(ARDUINO_ARCH_PIC32)
27
-#if defined(ARDUINO_ARCH_PIC32)
27
+#ifdef ARDUINO_ARCH_PIC32
28 28
 #include <p32xxxx.h>
29 29
 #endif
30 30
 #ifdef __cplusplus
31 31
 
32
-#if defined(true)
32
+#ifdef true
33 33
 #undef true
34 34
 #endif
35 35
 
36
-#if defined(false)
36
+#ifdef false
37 37
 #undef false
38 38
 #endif
39 39
 
40 40
 #endif
41 41
 
42
-#if defined(ARDUINO_spresense_ast)
42
+#ifdef ARDUINO_spresense_ast
43 43
 #define SWI_IRQ_NUM 666 // because this board is totally evil.
44 44
 #elif defined(ARDUINO_ARCH_PIC32)
45 45
 #ifndef SWI_IRQ_NUM
46
-#if defined(_DSPI0_IPL_ISR)
46
+#ifdef _DSPI0_IPL_ISR
47 47
 #define SWI_IPL _DSPI0_IPL_ISR
48 48
 #define SWI_VECTOR _DSPI0_ERR_IRQ
49 49
 #define SWI_IRQ_NUM _DSPI0_ERR_IRQ
@@ -57,7 +57,7 @@
57 57
 extern "C"
58 58
 {
59 59
         void
60
-#if defined(__PIC32MZXX__)
60
+#ifdef __PIC32MZXX__
61 61
                 __attribute__((nomips16,at_vector(SWI_VECTOR),interrupt(SWI_IPL)))
62 62
 #else
63 63
                 __attribute__((interrupt(),nomips16))
@@ -69,7 +69,7 @@ extern "C"
69 69
 #elif !defined(NVIC_NUM_INTERRUPTS)
70 70
 // Assume CMSIS
71 71
 #define __USE_CMSIS_VECTORS__
72
-#if defined(NUMBER_OF_INT_VECTORS)
72
+#ifdef NUMBER_OF_INT_VECTORS
73 73
 #define NVIC_NUM_INTERRUPTS (NUMBER_OF_INT_VECTORS-16)
74 74
 #else
75 75
 #define NVIC_NUM_INTERRUPTS ((int)PERIPH_COUNT_IRQn)
@@ -114,7 +114,7 @@ extern "C"
114 114
 #ifndef NVIC_GET_PENDING
115 115
 #define NVIC_GET_PENDING(n)	(*((volatile uint32_t *)0xE000E200 + ((n) >> 5)) & (1 << ((n) & 31)))
116 116
 #ifndef SWI_IRQ_NUM
117
-#if defined(__MK20DX256__)
117
+#ifdef __MK20DX256__
118 118
 #define SWI_IRQ_NUM 17
119 119
 #elif defined(__MK20DX128__)
120 120
 #define SWI_IRQ_NUM 5
@@ -165,7 +165,7 @@ extern int exec_SWI(const dyn_SWI* klass);
165 165
 // if no SWI for CPU (e.g. AVR) make a void stub.
166 166
 #ifndef SWI_NO_STUB
167 167
 #define Init_dyn_SWI() (void(0))
168
-#if !defined(DDSB)
168
+#ifndef DDSB
169 169
 #define DDSB() (void(0))
170 170
 #endif
171 171
 #endif

+ 8
- 8
buildroot/share/PlatformIO/variants/BIGTREE_GENERIC_STM32F407_5X/stm32f4xx_hal_conf.h ファイルの表示

@@ -87,11 +87,11 @@ extern "C" {
87 87
   *        This value is used by the RCC HAL module to compute the system frequency
88 88
   *        (when HSE is used as system clock source, directly or through the PLL).
89 89
   */
90
-#if !defined  (HSE_VALUE)
90
+#ifndef HSE_VALUE
91 91
 #define HSE_VALUE    ((uint32_t)8000000U) /*!< Value of the External oscillator in Hz */
92 92
 #endif /* HSE_VALUE */
93 93
 
94
-#if !defined  (HSE_STARTUP_TIMEOUT)
94
+#ifndef HSE_STARTUP_TIMEOUT
95 95
 #define HSE_STARTUP_TIMEOUT    ((uint32_t)100U)   /*!< Time out for HSE start up, in ms */
96 96
 #endif /* HSE_STARTUP_TIMEOUT */
97 97
 
@@ -100,14 +100,14 @@ extern "C" {
100 100
   *        This value is used by the RCC HAL module to compute the system frequency
101 101
   *        (when HSI is used as system clock source, directly or through the PLL).
102 102
   */
103
-#if !defined  (HSI_VALUE)
103
+#ifndef HSI_VALUE
104 104
 #define HSI_VALUE    ((uint32_t)16000000U) /*!< Value of the Internal oscillator in Hz*/
105 105
 #endif /* HSI_VALUE */
106 106
 
107 107
  /**
108 108
   * @brief Internal Low Speed oscillator (LSI) value.
109 109
   */
110
-#if !defined  (LSI_VALUE)
110
+#ifndef LSI_VALUE
111 111
 #define LSI_VALUE  ((uint32_t)32000U)       /*!< LSI Typical Value in Hz*/
112 112
 #endif /* LSI_VALUE */                      /*!< Value of the Internal Low Speed oscillator in Hz
113 113
 The real value may vary depending on the variations
@@ -115,11 +115,11 @@ in voltage and temperature.*/
115 115
  /**
116 116
   * @brief External Low Speed oscillator (LSE) value.
117 117
   */
118
-#if !defined  (LSE_VALUE)
118
+#ifndef LSE_VALUE
119 119
 #define LSE_VALUE  ((uint32_t)32768U)    /*!< Value of the External Low Speed oscillator in Hz */
120 120
 #endif /* LSE_VALUE */
121 121
 
122
-#if !defined  (LSE_STARTUP_TIMEOUT)
122
+#ifndef LSE_STARTUP_TIMEOUT
123 123
 #define LSE_STARTUP_TIMEOUT    ((uint32_t)5000U)   /*!< Time out for LSE start up, in ms */
124 124
 #endif /* LSE_STARTUP_TIMEOUT */
125 125
 
@@ -128,7 +128,7 @@ in voltage and temperature.*/
128 128
   *        This value is used by the I2S HAL module to compute the I2S clock source
129 129
   *        frequency, this source is inserted directly through I2S_CKIN pad.
130 130
   */
131
-#if !defined  (EXTERNAL_CLOCK_VALUE)
131
+#ifndef EXTERNAL_CLOCK_VALUE
132 132
 #define EXTERNAL_CLOCK_VALUE    ((uint32_t)12288000U) /*!< Value of the External audio frequency in Hz*/
133 133
 #endif /* EXTERNAL_CLOCK_VALUE */
134 134
 
@@ -455,7 +455,7 @@ in voltage and temperature.*/
455 455
 #endif /* HAL_MMC_MODULE_ENABLED */
456 456
 
457 457
 /* Exported macro ------------------------------------------------------------*/
458
-#ifdef  USE_FULL_ASSERT
458
+#ifdef USE_FULL_ASSERT
459 459
  /**
460 460
   * @brief  The assert_param macro is used for function's parameters check.
461 461
   * @param  expr: If expr is false, it calls assert_failed function

+ 8
- 8
buildroot/share/PlatformIO/variants/MARLIN_F407VE/stm32f4xx_hal_conf.h ファイルの表示

@@ -87,11 +87,11 @@ extern "C" {
87 87
   *        This value is used by the RCC HAL module to compute the system frequency
88 88
   *        (when HSE is used as system clock source, directly or through the PLL).
89 89
   */
90
-#if !defined  (HSE_VALUE)
90
+#ifndef HSE_VALUE
91 91
 #define HSE_VALUE    ((uint32_t)8000000U) /*!< Value of the External oscillator in Hz */
92 92
 #endif /* HSE_VALUE */
93 93
 
94
-#if !defined  (HSE_STARTUP_TIMEOUT)
94
+#ifndef HSE_STARTUP_TIMEOUT
95 95
 #define HSE_STARTUP_TIMEOUT    ((uint32_t)100U)   /*!< Time out for HSE start up, in ms */
96 96
 #endif /* HSE_STARTUP_TIMEOUT */
97 97
 
@@ -100,14 +100,14 @@ extern "C" {
100 100
   *        This value is used by the RCC HAL module to compute the system frequency
101 101
   *        (when HSI is used as system clock source, directly or through the PLL).
102 102
   */
103
-#if !defined  (HSI_VALUE)
103
+#ifndef HSI_VALUE
104 104
 #define HSI_VALUE    ((uint32_t)16000000U) /*!< Value of the Internal oscillator in Hz*/
105 105
 #endif /* HSI_VALUE */
106 106
 
107 107
  /**
108 108
   * @brief Internal Low Speed oscillator (LSI) value.
109 109
   */
110
-#if !defined  (LSI_VALUE)
110
+#ifndef LSI_VALUE
111 111
 #define LSI_VALUE  ((uint32_t)32000U)       /*!< LSI Typical Value in Hz*/
112 112
 #endif /* LSI_VALUE */                      /*!< Value of the Internal Low Speed oscillator in Hz
113 113
 The real value may vary depending on the variations
@@ -115,11 +115,11 @@ in voltage and temperature.*/
115 115
  /**
116 116
   * @brief External Low Speed oscillator (LSE) value.
117 117
   */
118
-#if !defined  (LSE_VALUE)
118
+#ifndef LSE_VALUE
119 119
 #define LSE_VALUE  ((uint32_t)32768U)    /*!< Value of the External Low Speed oscillator in Hz */
120 120
 #endif /* LSE_VALUE */
121 121
 
122
-#if !defined  (LSE_STARTUP_TIMEOUT)
122
+#ifndef LSE_STARTUP_TIMEOUT
123 123
 #define LSE_STARTUP_TIMEOUT    ((uint32_t)5000U)   /*!< Time out for LSE start up, in ms */
124 124
 #endif /* LSE_STARTUP_TIMEOUT */
125 125
 
@@ -128,7 +128,7 @@ in voltage and temperature.*/
128 128
   *        This value is used by the I2S HAL module to compute the I2S clock source
129 129
   *        frequency, this source is inserted directly through I2S_CKIN pad.
130 130
   */
131
-#if !defined  (EXTERNAL_CLOCK_VALUE)
131
+#ifndef EXTERNAL_CLOCK_VALUE
132 132
 #define EXTERNAL_CLOCK_VALUE    ((uint32_t)12288000U) /*!< Value of the External audio frequency in Hz*/
133 133
 #endif /* EXTERNAL_CLOCK_VALUE */
134 134
 
@@ -455,7 +455,7 @@ in voltage and temperature.*/
455 455
 #endif /* HAL_MMC_MODULE_ENABLED */
456 456
 
457 457
 /* Exported macro ------------------------------------------------------------*/
458
-#ifdef  USE_FULL_ASSERT
458
+#ifdef USE_FULL_ASSERT
459 459
  /**
460 460
   * @brief  The assert_param macro is used for function's parameters check.
461 461
   * @param  expr: If expr is false, it calls assert_failed function

+ 2
- 2
config/examples/Alfawise/U20-bltouch/Configuration.h ファイルの表示

@@ -592,7 +592,7 @@
592 592
   #define DEFAULT_bedKd 1164.25
593 593
 #endif
594 594
 
595
-#if defined(U20_PLUS)
595
+#ifdef U20_PLUS
596 596
   // These PID setting MUST be updated.
597 597
   // FIND YOUR OWN: "M303 E-1 C8 S90" to run autotune on the bed at 90 degreesC for 8 cycles.
598 598
   #define DEFAULT_bedKp 841.68
@@ -1114,7 +1114,7 @@
1114 1114
 #define Z_MACHINE_MAX 400
1115 1115
 #endif
1116 1116
 
1117
-#if defined(U20_PLUS)
1117
+#ifdef U20_PLUS
1118 1118
 #define X_BED_SIZE 400
1119 1119
 #define Y_BED_SIZE 400
1120 1120
 #define Z_MACHINE_MAX 500

+ 2
- 2
config/examples/Alfawise/U20/Configuration.h ファイルの表示

@@ -592,7 +592,7 @@
592 592
   #define DEFAULT_bedKd 1164.25
593 593
 #endif
594 594
 
595
-#if defined(U20_PLUS)
595
+#ifdef U20_PLUS
596 596
   // These PID setting MUST be updated.
597 597
   // FIND YOUR OWN: "M303 E-1 C8 S90" to run autotune on the bed at 90 degreesC for 8 cycles.
598 598
   #define DEFAULT_bedKp 841.68
@@ -1114,7 +1114,7 @@
1114 1114
 #define Z_MACHINE_MAX 400
1115 1115
 #endif
1116 1116
 
1117
-#if defined(U20_PLUS)
1117
+#ifdef U20_PLUS
1118 1118
 #define X_BED_SIZE 400
1119 1119
 #define Y_BED_SIZE 400
1120 1120
 #define Z_MACHINE_MAX 500

読み込み中…
キャンセル
保存