Преглед на файлове

Use Arduino.h include wrapper (#13877)

Scott Lahteine преди 5 години
родител
ревизия
e7682eea42
No account linked to committer's email address
променени са 32 файла, в които са добавени 154 реда и са изтрити 117 реда
  1. 7
    8
      Marlin/src/HAL/HAL_AVR/HAL.h
  2. 1
    1
      Marlin/src/HAL/HAL_AVR/fastio_AVR.cpp
  3. 1
    1
      Marlin/src/HAL/HAL_AVR/servo_AVR.cpp
  4. 1
    1
      Marlin/src/HAL/HAL_DUE/EepromEmulation_Due.cpp
  5. 3
    4
      Marlin/src/HAL/HAL_DUE/HAL.h
  6. 1
    1
      Marlin/src/HAL/HAL_DUE/Servo_Due.cpp
  7. 1
    1
      Marlin/src/HAL/HAL_DUE/pinsDebug.h
  8. 7
    7
      Marlin/src/HAL/HAL_DUE/u8g_com_HAL_DUE_shared_hw_spi.cpp
  9. 3
    2
      Marlin/src/HAL/HAL_DUE/u8g_com_HAL_DUE_st7920_sw_spi.cpp
  10. 1
    13
      Marlin/src/HAL/HAL_ESP32/HAL.h
  11. 2
    6
      Marlin/src/HAL/HAL_ESP32/i2s.cpp
  12. 2
    0
      Marlin/src/HAL/HAL_ESP32/i2s.h
  13. 3
    4
      Marlin/src/HAL/HAL_LINUX/HAL.h
  14. 1
    1
      Marlin/src/HAL/HAL_LINUX/fastio.h
  15. 5
    5
      Marlin/src/HAL/HAL_LPC1768/HAL.h
  16. 1
    1
      Marlin/src/HAL/HAL_LPC1768/fastio.h
  17. 2
    2
      Marlin/src/HAL/HAL_LPC1768/u8g/u8g_com_HAL_LPC1768_sw_spi.cpp
  18. 8
    8
      Marlin/src/HAL/HAL_STM32/HAL.h
  19. 5
    8
      Marlin/src/HAL/HAL_STM32F1/HAL.h
  20. 2
    1
      Marlin/src/HAL/HAL_STM32F1/HAL_sdio_STM32F1.h
  21. 9
    9
      Marlin/src/HAL/HAL_STM32F4/HAL.h
  22. 2
    2
      Marlin/src/HAL/HAL_STM32F7/HAL.h
  23. 1
    8
      Marlin/src/HAL/HAL_TEENSY31_32/HAL.h
  24. 1
    9
      Marlin/src/HAL/HAL_TEENSY35_36/HAL.h
  25. 1
    1
      Marlin/src/HAL/shared/HAL_ST7920.h
  26. 50
    0
      Marlin/src/HAL/shared/Marduino.h
  27. 0
    1
      Marlin/src/HAL/shared/servo.cpp
  28. 3
    2
      Marlin/src/lcd/fontutils.h
  29. 1
    0
      Marlin/src/lcd/ultralcd.cpp
  30. 1
    1
      Marlin/src/libs/duration_t.h
  31. 27
    8
      Marlin/src/libs/softspi.h
  32. 1
    1
      Marlin/src/pins/pins_MIGHTYBOARD_REVE.h

+ 7
- 8
Marlin/src/HAL/HAL_AVR/HAL.h Целия файл

@@ -24,14 +24,7 @@
24 24
 
25 25
 #include <stdint.h>
26 26
 
27
-#include <Arduino.h>
28
-
29
-#include <util/delay.h>
30
-#include <avr/eeprom.h>
31
-#include <avr/pgmspace.h>
32
-#include <avr/interrupt.h>
33
-#include <avr/io.h>
34
-
27
+#include "../shared/Marduino.h"
35 28
 #include "../shared/HAL_SPI.h"
36 29
 #include "fastio_AVR.h"
37 30
 #include "watchdog_AVR.h"
@@ -43,6 +36,12 @@
43 36
   #include "MarlinSerial.h"
44 37
 #endif
45 38
 
39
+#include <util/delay.h>
40
+#include <avr/eeprom.h>
41
+#include <avr/pgmspace.h>
42
+#include <avr/interrupt.h>
43
+#include <avr/io.h>
44
+
46 45
 // --------------------------------------------------------------------------
47 46
 // Defines
48 47
 // --------------------------------------------------------------------------

+ 1
- 1
Marlin/src/HAL/HAL_AVR/fastio_AVR.cpp Целия файл

@@ -30,7 +30,7 @@
30 30
 
31 31
 #ifdef FASTIO_EXT_START
32 32
 
33
-#include <Arduino.h>
33
+#include "../shared/Marduino.h"
34 34
 
35 35
 #define _IS_EXT(P) WITHIN(P, FASTIO_EXT_START, FASTIO_EXT_END)
36 36
 

+ 1
- 1
Marlin/src/HAL/HAL_AVR/servo_AVR.cpp Целия файл

@@ -58,8 +58,8 @@
58 58
 #if HAS_SERVOS
59 59
 
60 60
 #include <avr/interrupt.h>
61
-#include <Arduino.h>
62 61
 
62
+#include "../shared/Marduino.h"
63 63
 #include "../shared/servo.h"
64 64
 #include "../shared/servo_private.h"
65 65
 

+ 1
- 1
Marlin/src/HAL/HAL_DUE/EepromEmulation_Due.cpp Целия файл

@@ -36,7 +36,7 @@
36 36
 
37 37
 #if ENABLED(EEPROM_SETTINGS) && DISABLED(I2C_EEPROM, SPI_EEPROM)
38 38
 
39
-#include <Arduino.h>
39
+#include "../shared/Marduino.h"
40 40
 
41 41
 #define EEPROMSize     4096
42 42
 #define PagesPerGroup   128

+ 3
- 4
Marlin/src/HAL/HAL_DUE/HAL.h Целия файл

@@ -29,16 +29,15 @@
29 29
 
30 30
 #define CPU_32_BIT
31 31
 
32
-#include <stdint.h>
33
-
34
-#include <Arduino.h>
35
-
32
+#include "../shared/Marduino.h"
36 33
 #include "../shared/math_32bit.h"
37 34
 #include "../shared/HAL_SPI.h"
38 35
 #include "fastio_Due.h"
39 36
 #include "watchdog_Due.h"
40 37
 #include "HAL_timers_Due.h"
41 38
 
39
+#include <stdint.h>
40
+
42 41
 // Serial ports
43 42
 #if !WITHIN(SERIAL_PORT, -1, 3)
44 43
   #error "SERIAL_PORT must be from -1 to 3"

+ 1
- 1
Marlin/src/HAL/HAL_DUE/Servo_Due.cpp Целия файл

@@ -44,7 +44,7 @@
44 44
 
45 45
 #if HAS_SERVOS
46 46
 
47
-#include <Arduino.h>
47
+#include "../shared/Marduino.h"
48 48
 #include "../shared/servo.h"
49 49
 #include "../shared/servo_private.h"
50 50
 

+ 1
- 1
Marlin/src/HAL/HAL_DUE/pinsDebug.h Целия файл

@@ -28,7 +28,7 @@
28 28
  * Translation of routines & variables used by pinsDebug.h
29 29
  */
30 30
 
31
-#include <Arduino.h>
31
+#include "../shared/Marduino.h"
32 32
 
33 33
 /**
34 34
  * Due/Marlin quirks

+ 7
- 7
Marlin/src/HAL/HAL_DUE/u8g_com_HAL_DUE_shared_hw_spi.cpp Целия файл

@@ -66,20 +66,20 @@
66 66
 
67 67
 #include "../../Marlin.h"
68 68
 
69
-#define SPI_FULL_SPEED 0
70
-#define SPI_HALF_SPEED 1
71
-#define SPI_QUARTER_SPEED 2
72
-#define SPI_EIGHTH_SPEED 3
69
+#define SPI_FULL_SPEED      0
70
+#define SPI_HALF_SPEED      1
71
+#define SPI_QUARTER_SPEED   2
72
+#define SPI_EIGHTH_SPEED    3
73 73
 #define SPI_SIXTEENTH_SPEED 4
74
-#define SPI_SPEED_5 5
75
-#define SPI_SPEED_6 6
74
+#define SPI_SPEED_5         5
75
+#define SPI_SPEED_6         6
76 76
 
77 77
 void spiBegin();
78 78
 void spiInit(uint8_t spiRate);
79 79
 void spiSend(uint8_t b);
80 80
 void spiSend(const uint8_t* buf, size_t n);
81 81
 
82
-#include <Arduino.h>
82
+#include "../shared/Marduino.h"
83 83
 #include "fastio_Due.h"
84 84
 
85 85
 void u8g_SetPIOutput_DUE_hw_spi(u8g_t *u8g, uint8_t pin_index) {

+ 3
- 2
Marlin/src/HAL/HAL_DUE/u8g_com_HAL_DUE_st7920_sw_spi.cpp Целия файл

@@ -59,10 +59,11 @@
59 59
 
60 60
 #if HAS_GRAPHICAL_LCD
61 61
 
62
-#include <U8glib.h>
63
-#include <Arduino.h>
62
+#include "../shared/Marduino.h"
64 63
 #include "../shared/Delay.h"
65 64
 
65
+#include <U8glib.h>
66
+
66 67
 void u8g_SetPIOutput_DUE(u8g_t *u8g, uint8_t pin_index) {
67 68
   PIO_Configure(g_APinDescription[u8g->pin_list[pin_index]].pPort, PIO_OUTPUT_1,
68 69
     g_APinDescription[u8g->pin_list[pin_index]].ulPin, g_APinDescription[u8g->pin_list[pin_index]].ulPinConfiguration);  // OUTPUT

+ 1
- 13
Marlin/src/HAL/HAL_ESP32/HAL.h Целия файл

@@ -30,19 +30,7 @@
30 30
 
31 31
 #include <stdint.h>
32 32
 
33
-// these are going to be re-defined in Arduino.h
34
-#undef DISABLED
35
-#undef M_PI
36
-#undef _BV
37
-
38
-#include <Arduino.h>
39
-
40
-// revert back to the correct (old) definition
41
-#undef DISABLED
42
-#define DISABLED(V...) DO(DIS,&&,V)
43
-// re-define in case Arduino.h has been skipped due to earlier inclusion (i.e. in Marlin\src\HAL\HAL_ESP32\i2s.cpp)
44
-#define _BV(b) (1UL << (b))
45
-
33
+#include "../shared/Marduino.h"
46 34
 #include "../shared/math_32bit.h"
47 35
 #include "../shared/HAL_SPI.h"
48 36
 

+ 2
- 6
Marlin/src/HAL/HAL_ESP32/i2s.cpp Целия файл

@@ -21,13 +21,9 @@
21 21
  */
22 22
 #ifdef ARDUINO_ARCH_ESP32
23 23
 
24
-// replace that with the proper imports, then cleanup workarounds in Marlin\src\HAL\HAL_ESP32\HAL.h
25
-#include <Arduino.h>
26
-// revert back to the correct definition
27
-#undef DISABLED
28
-#define DISABLED(V...) DO(DIS,&&,V)
29
-
30 24
 #include "i2s.h"
25
+
26
+#include "../shared/Marduino.h"
31 27
 #include "../../core/macros.h"
32 28
 #include "driver/periph_ctrl.h"
33 29
 #include "rom/lldesc.h"

+ 2
- 0
Marlin/src/HAL/HAL_ESP32/i2s.h Целия файл

@@ -21,6 +21,8 @@
21 21
  */
22 22
 #pragma once
23 23
 
24
+#include <stdint.h>
25
+
24 26
 // current value of the outputs provided over i2s
25 27
 extern uint32_t i2s_port_data;
26 28
 

+ 3
- 4
Marlin/src/HAL/HAL_LINUX/HAL.h Целия файл

@@ -47,16 +47,15 @@ uint8_t _getc();
47 47
 //arduino: Print.h
48 48
 #define DEC 10
49 49
 #define HEX 16
50
-#define OCT 8
51
-#define BIN 2
50
+#define OCT  8
51
+#define BIN  2
52 52
 //arduino: binary.h (weird defines)
53 53
 #define B01 1
54 54
 #define B10 2
55 55
 
56 56
 #include "hardware/Clock.h"
57 57
 
58
-#include <Arduino.h>
59
-
58
+#include "../shared/Marduino.h"
60 59
 #include "../shared/math_32bit.h"
61 60
 #include "../shared/HAL_SPI.h"
62 61
 #include "fastio.h"

+ 1
- 1
Marlin/src/HAL/HAL_LINUX/fastio.h Целия файл

@@ -25,7 +25,7 @@
25 25
  * Fast I/O Routines for X86_64
26 26
  */
27 27
 
28
-#include <Arduino.h>
28
+#include "../shared/Marduino.h"
29 29
 #include <pinmapping.h>
30 30
 
31 31
 #define SET_DIR_INPUT(IO)     Gpio::setDir(IO, 1)

+ 5
- 5
Marlin/src/HAL/HAL_LPC1768/HAL.h Целия файл

@@ -37,18 +37,18 @@ void HAL_init();
37 37
 
38 38
 extern "C" volatile millis_t _millis;
39 39
 
40
-#include <Arduino.h>
41
-#include <pinmapping.h>
42
-#include <CDCSerial.h>
43
-
40
+#include "../shared/Marduino.h"
44 41
 #include "../shared/math_32bit.h"
45 42
 #include "../shared/HAL_SPI.h"
46 43
 #include "fastio.h"
47
-#include <adc.h>
48 44
 #include "watchdog.h"
49 45
 #include "HAL_timers.h"
50 46
 #include "MarlinSerial.h"
51 47
 
48
+#include <adc.h>
49
+#include <pinmapping.h>
50
+#include <CDCSerial.h>
51
+
52 52
 //
53 53
 // Default graphical display delays
54 54
 //

+ 1
- 1
Marlin/src/HAL/HAL_LPC1768/fastio.h Целия файл

@@ -33,7 +33,7 @@
33 33
  * For TARGET LPC1768
34 34
  */
35 35
 
36
-#include <Arduino.h>
36
+#include "../shared/Marduino.h"
37 37
 
38 38
 #define PWM_PIN(P)              true // all pins are PWM capable
39 39
 #define USEABLE_HARDWARE_PWM(P) PWM_PIN(P)

+ 2
- 2
Marlin/src/HAL/HAL_LPC1768/u8g/u8g_com_HAL_LPC1768_sw_spi.cpp Целия файл

@@ -59,17 +59,17 @@
59 59
 
60 60
 #if HAS_GRAPHICAL_LCD
61 61
 
62
-#include <U8glib.h>
63 62
 #include "SoftwareSPI.h"
64 63
 
65 64
 #undef SPI_SPEED
66 65
 #define SPI_SPEED 2  // About 2 MHz
67 66
 
67
+#include <Arduino.h>
68 68
 #include <algorithm>
69 69
 #include <LPC17xx.h>
70 70
 #include <gpio.h>
71 71
 
72
-#include <Arduino.h>
72
+#include <U8glib.h>
73 73
 
74 74
 uint8_t swSpiTransfer_mode_0(uint8_t b, const uint8_t spi_speed, const pin_t sck_pin, const pin_t miso_pin, const pin_t mosi_pin ) {
75 75
 

+ 8
- 8
Marlin/src/HAL/HAL_STM32/HAL.h Целия файл

@@ -28,20 +28,20 @@
28 28
 // Includes
29 29
 // --------------------------------------------------------------------------
30 30
 
31
-#include <stdint.h>
31
+#include "../shared/Marduino.h"
32
+#include "../shared/math_32bit.h"
33
+#include "../shared/HAL_SPI.h"
34
+#include "fastio_STM32.h"
35
+#include "watchdog_STM32.h"
36
+
37
+#include "../../inc/MarlinConfigPre.h"
32 38
 
33
-#include "Arduino.h"
39
+#include <stdint.h>
34 40
 
35 41
 #ifdef USBCON
36 42
   #include <USBSerial.h>
37 43
 #endif
38 44
 
39
-#include "../../inc/MarlinConfigPre.h"
40
-#include "../shared/math_32bit.h"
41
-#include "../shared/HAL_SPI.h"
42
-#include "fastio_STM32.h"
43
-#include "watchdog_STM32.h"
44
-
45 45
 // --------------------------------------------------------------------------
46 46
 // Defines
47 47
 // --------------------------------------------------------------------------

+ 5
- 8
Marlin/src/HAL/HAL_STM32F1/HAL.h Целия файл

@@ -36,14 +36,7 @@
36 36
 // Includes
37 37
 // --------------------------------------------------------------------------
38 38
 
39
-#include <stdint.h>
40
-#include <util/atomic.h>
41
-#include <Arduino.h>
42
-
43
-// --------------------------------------------------------------------------
44
-// Includes
45
-// --------------------------------------------------------------------------
46
-
39
+#include "../shared/Marduino.h"
47 40
 #include "../shared/math_32bit.h"
48 41
 #include "../shared/HAL_SPI.h"
49 42
 
@@ -51,6 +44,10 @@
51 44
 #include "watchdog_STM32F1.h"
52 45
 
53 46
 #include "HAL_timers_STM32F1.h"
47
+
48
+#include <stdint.h>
49
+#include <util/atomic.h>
50
+
54 51
 #include "../../inc/MarlinConfigPre.h"
55 52
 
56 53
 // --------------------------------------------------------------------------

+ 2
- 1
Marlin/src/HAL/HAL_STM32F1/HAL_sdio_STM32F1.h Целия файл

@@ -25,7 +25,8 @@
25 25
 // Includes
26 26
 // --------------------------------------------------------------------------
27 27
 
28
-#include "Arduino.h"
28
+#include "../shared/Marduino.h"
29
+
29 30
 #include "libmaple/sdio.h"
30 31
 #include "libmaple/dma.h"
31 32
 

+ 9
- 9
Marlin/src/HAL/HAL_STM32F4/HAL.h Целия файл

@@ -32,21 +32,21 @@
32 32
 // Includes
33 33
 // --------------------------------------------------------------------------
34 34
 
35
-#include <stdint.h>
36
-
37
-#include "Arduino.h"
38
-
39
-#ifdef USBCON
40
-  #include <USBSerial.h>
41
-#endif
42
-
35
+#include "../shared/Marduino.h"
43 36
 #include "../shared/math_32bit.h"
44 37
 #include "../shared/HAL_SPI.h"
45 38
 #include "fastio_STM32F4.h"
46 39
 #include "watchdog_STM32F4.h"
47
-
48 40
 #include "HAL_timers_STM32F4.h"
49 41
 
42
+#include "../../inc/MarlinConfigPre.h"
43
+
44
+#include <stdint.h>
45
+
46
+#ifdef USBCON
47
+  #include <USBSerial.h>
48
+#endif
49
+
50 50
 // --------------------------------------------------------------------------
51 51
 // Defines
52 52
 // --------------------------------------------------------------------------

+ 2
- 2
Marlin/src/HAL/HAL_STM32F7/HAL.h Целия файл

@@ -34,8 +34,7 @@
34 34
 
35 35
 #include <stdint.h>
36 36
 
37
-#include "Arduino.h"
38
-
37
+#include "../shared/Marduino.h"
39 38
 #include "../shared/math_32bit.h"
40 39
 #include "../shared/HAL_SPI.h"
41 40
 
@@ -44,6 +43,7 @@
44 43
 
45 44
 #include "HAL_timers_STM32F7.h"
46 45
 
46
+#include "../../inc/MarlinConfigPre.h"
47 47
 
48 48
 // --------------------------------------------------------------------------
49 49
 // Defines

+ 1
- 8
Marlin/src/HAL/HAL_TEENSY31_32/HAL.h Целия файл

@@ -28,14 +28,7 @@
28 28
 
29 29
 #define CPU_32_BIT
30 30
 
31
-// _BV is re-defined in Arduino.h
32
-#undef _BV
33
-
34
-#include <Arduino.h>
35
-
36
-// Redefine sq macro defined by teensy3/wiring.h
37
-#undef sq
38
-#define sq(x) ((x)*(x))
31
+#include "../shared/Marduino.h"
39 32
 
40 33
 #include "../math_32bit.h"
41 34
 #include "../HAL_SPI.h"

+ 1
- 9
Marlin/src/HAL/HAL_TEENSY35_36/HAL.h Целия файл

@@ -31,15 +31,7 @@
31 31
 // Includes
32 32
 // --------------------------------------------------------------------------
33 33
 
34
-// _BV is re-defined in Arduino.h
35
-#undef _BV
36
-
37
-#include <Arduino.h>
38
-
39
-// Redefine sq macro defined by teensy3/wiring.h
40
-#undef sq
41
-#define sq(x) ((x)*(x))
42
-
34
+#include "../shared/Marduino.h"
43 35
 #include "../shared/math_32bit.h"
44 36
 #include "../shared/HAL_SPI.h"
45 37
 

+ 1
- 1
Marlin/src/HAL/shared/HAL_ST7920.h Целия файл

@@ -33,4 +33,4 @@
33 33
   void ST7920_set_cmd();
34 34
   void ST7920_set_dat();
35 35
   void ST7920_write_byte(const uint8_t data);
36
-#endif
36
+#endif

+ 50
- 0
Marlin/src/HAL/shared/Marduino.h Целия файл

@@ -0,0 +1,50 @@
1
+/**
2
+ * Marlin 3D Printer Firmware
3
+ * Copyright (C) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4
+ *
5
+ * Based on Sprinter and grbl.
6
+ * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
7
+ *
8
+ * This program is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
+ *
21
+ */
22
+#pragma once
23
+
24
+/**
25
+ * HAL/shared/Marduino.h
26
+ */
27
+
28
+#undef DISABLED       // Redefined by ESP32
29
+#undef M_PI           // Redefined by all
30
+#undef _BV            // Redefined by some
31
+#undef sq             // Redefined by teensy3/wiring.h
32
+
33
+#include <Arduino.h>  // NOTE: If included earlier then this line is a NOOP
34
+
35
+#undef DISABLED
36
+#define DISABLED(V...) DO(DIS,&&,V)
37
+
38
+#undef _BV
39
+#define _BV(b) (1UL << (b))
40
+
41
+#undef sq
42
+#define sq(x) ((x)*(x))
43
+
44
+#ifndef SBI
45
+  #define SBI(A,B) (A |= (1 << (B)))
46
+#endif
47
+
48
+#ifndef CBI
49
+  #define CBI(A,B) (A &= ~(1 << (B)))
50
+#endif

+ 0
- 1
Marlin/src/HAL/shared/servo.cpp Целия файл

@@ -55,7 +55,6 @@
55 55
 
56 56
 #if HAS_SERVOS && !(IS_32BIT_TEENSY || defined(TARGET_LPC1768) || defined(STM32F1) || defined(STM32F1xx) || defined(STM32F4) || defined(STM32F4xx) || defined(STM32F7xx))
57 57
 
58
-//#include <Arduino.h>
59 58
 #include "servo.h"
60 59
 #include "servo_private.h"
61 60
 

+ 3
- 2
Marlin/src/lcd/fontutils.h Целия файл

@@ -8,9 +8,10 @@
8 8
  */
9 9
 #pragma once
10 10
 
11
-#include <stdlib.h>
12
-#include <Arduino.h>
11
+#include "../HAL/shared/Marduino.h"
13 12
 #include "../core/macros.h"
13
+
14
+#include <stdlib.h>
14 15
 #include <stddef.h> // wchar_t
15 16
 #include <stdint.h> // uint32_t
16 17
 

+ 1
- 0
Marlin/src/lcd/ultralcd.cpp Целия файл

@@ -746,6 +746,7 @@ void MarlinUI::update() {
746 746
 
747 747
       refresh();
748 748
       init_lcd(); // May revive the LCD if static electricity killed it
749
+
749 750
       ms = millis();
750 751
       next_lcd_update_ms = ms + LCD_UPDATE_INTERVAL;  // delay LCD update until after SD activity completes
751 752
     }

+ 1
- 1
Marlin/src/libs/duration_t.h Целия файл

@@ -21,7 +21,7 @@
21 21
  */
22 22
 #pragma once
23 23
 
24
-#include <Arduino.h>
24
+#include "../HAL/shared/Marduino.h"
25 25
 
26 26
 struct duration_t {
27 27
   /**

+ 27
- 8
Marlin/src/libs/softspi.h Целия файл

@@ -1,17 +1,36 @@
1
-// https://github.com/niteris/ArduinoSoftSpi
1
+/**
2
+ * Marlin 3D Printer Firmware
3
+ * Copyright (C) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4
+ *
5
+ * Based on Sprinter and grbl.
6
+ * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
7
+ *
8
+ * This program is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
+ *
21
+ */
22
+#pragma once
23
+
24
+//
25
+// Based on https://github.com/niteris/ArduinoSoftSpi
26
+//
2 27
 
3
-#include <Arduino.h>
28
+#include "../HAL/shared/Marduino.h"
4 29
 
5 30
 #ifndef FORCE_INLINE
6 31
   #define FORCE_INLINE inline __attribute__((always_inline))
7 32
 #endif
8 33
 
9
-#ifndef _BV
10
-  #define _BV(B) (1 << (B))
11
-  #define SBI(A,B) (A |= (1 << (B)))
12
-  #define CBI(A,B) (A &= ~(1 << (B)))
13
-#endif
14
-
15 34
 #define nop __asm__ volatile ("nop") // NOP for timing
16 35
 
17 36
 #ifdef __arm__

+ 1
- 1
Marlin/src/pins/pins_MIGHTYBOARD_REVE.h Целия файл

@@ -271,7 +271,7 @@
271 271
 
272 272
 
273 273
 // Check if all pins are defined in mega/pins_arduino.h
274
-#include <Arduino.h>
274
+//#include <Arduino.h>
275 275
 static_assert(NUM_DIGITAL_PINS > MAX_PIN, "add missing pins to [arduino dir]/hardware/arduino/avr/variants/mega/pins_arduino.h based on fastio.h"
276 276
                                           "to digital_pin_to_port_PGM, digital_pin_to_bit_mask_PGM, digital_pin_to_timer_PGM, NUM_DIGITAL_PINS, see below");
277 277
 

Loading…
Отказ
Запис