Browse Source

Revert at90usb1286 conditional (#19733)

Jason Smith 4 years ago
parent
commit
90d364fc37
No account linked to committer's email address

+ 2
- 2
Marlin/src/HAL/AVR/HAL.h View File

@@ -25,7 +25,7 @@
25 25
 #include "watchdog.h"
26 26
 #include "math.h"
27 27
 
28
-#ifdef IS_AT90USB
28
+#ifdef USBCON
29 29
   #include <HardwareSerial.h>
30 30
 #else
31 31
   #define HardwareSerial_h // Hack to prevent HardwareSerial.h header inclusion
@@ -81,7 +81,7 @@ typedef int8_t pin_t;
81 81
 //extern uint8_t MCUSR;
82 82
 
83 83
 // Serial ports
84
-#ifdef IS_AT90USB
84
+#ifdef USBCON
85 85
   #define MYSERIAL0 TERN(BLUETOOTH, bluetoothSerial, Serial)
86 86
 #else
87 87
   #if !WITHIN(SERIAL_PORT, -1, 3)

+ 3
- 3
Marlin/src/HAL/AVR/MarlinSerial.cpp View File

@@ -38,7 +38,7 @@
38 38
 
39 39
 #include "../../inc/MarlinConfig.h"
40 40
 
41
-#if !IS_AT90USB && (defined(UBRRH) || defined(UBRR0H) || defined(UBRR1H) || defined(UBRR2H) || defined(UBRR3H))
41
+#if !defined(USBCON) && (defined(UBRRH) || defined(UBRR0H) || defined(UBRR1H) || defined(UBRR2H) || defined(UBRR3H))
42 42
 
43 43
 #include "MarlinSerial.h"
44 44
 #include "../../MarlinCore.h"
@@ -792,10 +792,10 @@ MarlinSerial<MarlinSerialCfg<SERIAL_PORT>> customizedSerial1;
792 792
 
793 793
 #endif
794 794
 
795
-#endif // !IS_AT90USB && (UBRRH || UBRR0H || UBRR1H || UBRR2H || UBRR3H)
795
+#endif // !USBCON && (UBRRH || UBRR0H || UBRR1H || UBRR2H || UBRR3H)
796 796
 
797 797
 // For AT90USB targets use the UART for BT interfacing
798
-#if BOTH(IS_AT90USB, BLUETOOTH)
798
+#if defined(USBCON) && ENABLED(BLUETOOTH)
799 799
   HardwareSerial bluetoothSerial;
800 800
 #endif
801 801
 

+ 1
- 1
Marlin/src/HAL/AVR/MarlinSerial.h View File

@@ -327,6 +327,6 @@
327 327
 #endif
328 328
 
329 329
 // Use the UART for Bluetooth in AT90USB configurations
330
-#if BOTH(IS_AT90USB, BLUETOOTH)
330
+#if defined(USBCON) && ENABLED(BLUETOOTH)
331 331
   extern HardwareSerial bluetoothSerial;
332 332
 #endif

+ 2
- 2
Marlin/src/gcode/control/M111.cpp View File

@@ -55,7 +55,7 @@ void GcodeSuite::M111() {
55 55
   }
56 56
   else {
57 57
     SERIAL_ECHOPGM(STR_DEBUG_OFF);
58
-    #if !IS_AT90USB
58
+    #if !defined(__AVR__) || !defined(USBCON)
59 59
       #if ENABLED(SERIAL_STATS_RX_BUFFER_OVERRUNS)
60 60
         SERIAL_ECHOPAIR("\nBuffer Overruns: ", MYSERIAL0.buffer_overruns());
61 61
       #endif
@@ -71,7 +71,7 @@ void GcodeSuite::M111() {
71 71
       #if ENABLED(SERIAL_STATS_MAX_RX_QUEUED)
72 72
         SERIAL_ECHOPAIR("\nMax RX Queue Size: ", MYSERIAL0.rxMaxEnqueued());
73 73
       #endif
74
-    #endif // !IS_AT90USB
74
+    #endif // !__AVR__ || !USBCON
75 75
   }
76 76
   SERIAL_EOL();
77 77
 }

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

@@ -624,7 +624,7 @@ void GCodeQueue::advance() {
624 624
         card.closefile();
625 625
         SERIAL_ECHOLNPGM(STR_FILE_SAVED);
626 626
 
627
-        #if !IS_AT90USB
627
+        #if !defined(__AVR__) || !defined(USBCON)
628 628
           #if ENABLED(SERIAL_STATS_DROPPED_RX)
629 629
             SERIAL_ECHOLNPAIR("Dropped bytes: ", MYSERIAL0.dropped());
630 630
           #endif

+ 4
- 4
Marlin/src/inc/Conditionals_adv.h View File

@@ -208,10 +208,7 @@
208 208
   #define NEEDS_HARDWARE_PWM 1
209 209
 #endif
210 210
 
211
-#if defined(__AVR__) && defined(USBCON)
212
-  #define IS_AT90USB 1
213
-  #undef SERIAL_XON_XOFF // Not supported on USB-native devices
214
-#else
211
+#if !defined(__AVR__) || !defined(USBCON)
215 212
   // Define constants and variables for buffering serial data.
216 213
   // Use only 0 or powers of 2 greater than 1
217 214
   // : [0, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, ...]
@@ -223,6 +220,9 @@
223 220
   #ifndef TX_BUFFER_SIZE
224 221
     #define TX_BUFFER_SIZE 32
225 222
   #endif
223
+#else
224
+  // SERIAL_XON_XOFF not supported on USB-native devices
225
+  #undef SERIAL_XON_XOFF
226 226
 #endif
227 227
 
228 228
 #if ENABLED(HOST_ACTION_COMMANDS)

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

@@ -582,7 +582,7 @@
582 582
 /**
583 583
  * Serial
584 584
  */
585
-#if !IS_AT90USB
585
+#if !(defined(__AVR__) && defined(USBCON))
586 586
   #if ENABLED(SERIAL_XON_XOFF) && RX_BUFFER_SIZE < 1024
587 587
     #error "SERIAL_XON_XOFF requires RX_BUFFER_SIZE >= 1024 for reliable transfers without drops."
588 588
   #elif RX_BUFFER_SIZE && (RX_BUFFER_SIZE < 2 || !IS_POWER_OF_2(RX_BUFFER_SIZE))
@@ -2108,9 +2108,9 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal
2108 2108
 #endif
2109 2109
 
2110 2110
 /**
2111
- * Emergency Command Parser
2111
+ * emergency-command parser
2112 2112
  */
2113
-#if BOTH(IS_AT90USB, EMERGENCY_PARSER)
2113
+#if ENABLED(EMERGENCY_PARSER) && defined(__AVR__) && defined(USBCON)
2114 2114
   #error "EMERGENCY_PARSER does not work on boards with AT90USB processors (USBCON)."
2115 2115
 #endif
2116 2116
 

Loading…
Cancel
Save