Browse Source

Use Arduino.h include wrapper (#13877)

Scott Lahteine 6 years ago
parent
commit
e7682eea42
No account linked to committer's email address

+ 7
- 8
Marlin/src/HAL/HAL_AVR/HAL.h View File

24
 
24
 
25
 #include <stdint.h>
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
 #include "../shared/HAL_SPI.h"
28
 #include "../shared/HAL_SPI.h"
36
 #include "fastio_AVR.h"
29
 #include "fastio_AVR.h"
37
 #include "watchdog_AVR.h"
30
 #include "watchdog_AVR.h"
43
   #include "MarlinSerial.h"
36
   #include "MarlinSerial.h"
44
 #endif
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
 // Defines
46
 // Defines
48
 // --------------------------------------------------------------------------
47
 // --------------------------------------------------------------------------

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

30
 
30
 
31
 #ifdef FASTIO_EXT_START
31
 #ifdef FASTIO_EXT_START
32
 
32
 
33
-#include <Arduino.h>
33
+#include "../shared/Marduino.h"
34
 
34
 
35
 #define _IS_EXT(P) WITHIN(P, FASTIO_EXT_START, FASTIO_EXT_END)
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 View File

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

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

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

+ 3
- 4
Marlin/src/HAL/HAL_DUE/HAL.h View File

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

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

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

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

28
  * Translation of routines & variables used by pinsDebug.h
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
  * Due/Marlin quirks
34
  * Due/Marlin quirks

+ 7
- 7
Marlin/src/HAL/HAL_DUE/u8g_com_HAL_DUE_shared_hw_spi.cpp View File

66
 
66
 
67
 #include "../../Marlin.h"
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
 #define SPI_SIXTEENTH_SPEED 4
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
 void spiBegin();
77
 void spiBegin();
78
 void spiInit(uint8_t spiRate);
78
 void spiInit(uint8_t spiRate);
79
 void spiSend(uint8_t b);
79
 void spiSend(uint8_t b);
80
 void spiSend(const uint8_t* buf, size_t n);
80
 void spiSend(const uint8_t* buf, size_t n);
81
 
81
 
82
-#include <Arduino.h>
82
+#include "../shared/Marduino.h"
83
 #include "fastio_Due.h"
83
 #include "fastio_Due.h"
84
 
84
 
85
 void u8g_SetPIOutput_DUE_hw_spi(u8g_t *u8g, uint8_t pin_index) {
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 View File

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

30
 
30
 
31
 #include <stdint.h>
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
 #include "../shared/math_32bit.h"
34
 #include "../shared/math_32bit.h"
47
 #include "../shared/HAL_SPI.h"
35
 #include "../shared/HAL_SPI.h"
48
 
36
 

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

21
  */
21
  */
22
 #ifdef ARDUINO_ARCH_ESP32
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
 #include "i2s.h"
24
 #include "i2s.h"
25
+
26
+#include "../shared/Marduino.h"
31
 #include "../../core/macros.h"
27
 #include "../../core/macros.h"
32
 #include "driver/periph_ctrl.h"
28
 #include "driver/periph_ctrl.h"
33
 #include "rom/lldesc.h"
29
 #include "rom/lldesc.h"

+ 2
- 0
Marlin/src/HAL/HAL_ESP32/i2s.h View File

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

+ 3
- 4
Marlin/src/HAL/HAL_LINUX/HAL.h View File

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

+ 1
- 1
Marlin/src/HAL/HAL_LINUX/fastio.h View File

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

+ 5
- 5
Marlin/src/HAL/HAL_LPC1768/HAL.h View File

37
 
37
 
38
 extern "C" volatile millis_t _millis;
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
 #include "../shared/math_32bit.h"
41
 #include "../shared/math_32bit.h"
45
 #include "../shared/HAL_SPI.h"
42
 #include "../shared/HAL_SPI.h"
46
 #include "fastio.h"
43
 #include "fastio.h"
47
-#include <adc.h>
48
 #include "watchdog.h"
44
 #include "watchdog.h"
49
 #include "HAL_timers.h"
45
 #include "HAL_timers.h"
50
 #include "MarlinSerial.h"
46
 #include "MarlinSerial.h"
51
 
47
 
48
+#include <adc.h>
49
+#include <pinmapping.h>
50
+#include <CDCSerial.h>
51
+
52
 //
52
 //
53
 // Default graphical display delays
53
 // Default graphical display delays
54
 //
54
 //

+ 1
- 1
Marlin/src/HAL/HAL_LPC1768/fastio.h View File

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

+ 2
- 2
Marlin/src/HAL/HAL_LPC1768/u8g/u8g_com_HAL_LPC1768_sw_spi.cpp View File

59
 
59
 
60
 #if HAS_GRAPHICAL_LCD
60
 #if HAS_GRAPHICAL_LCD
61
 
61
 
62
-#include <U8glib.h>
63
 #include "SoftwareSPI.h"
62
 #include "SoftwareSPI.h"
64
 
63
 
65
 #undef SPI_SPEED
64
 #undef SPI_SPEED
66
 #define SPI_SPEED 2  // About 2 MHz
65
 #define SPI_SPEED 2  // About 2 MHz
67
 
66
 
67
+#include <Arduino.h>
68
 #include <algorithm>
68
 #include <algorithm>
69
 #include <LPC17xx.h>
69
 #include <LPC17xx.h>
70
 #include <gpio.h>
70
 #include <gpio.h>
71
 
71
 
72
-#include <Arduino.h>
72
+#include <U8glib.h>
73
 
73
 
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 ) {
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 View File

28
 // Includes
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
 #ifdef USBCON
41
 #ifdef USBCON
36
   #include <USBSerial.h>
42
   #include <USBSerial.h>
37
 #endif
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
 // Defines
46
 // Defines
47
 // --------------------------------------------------------------------------
47
 // --------------------------------------------------------------------------

+ 5
- 8
Marlin/src/HAL/HAL_STM32F1/HAL.h View File

36
 // Includes
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
 #include "../shared/math_32bit.h"
40
 #include "../shared/math_32bit.h"
48
 #include "../shared/HAL_SPI.h"
41
 #include "../shared/HAL_SPI.h"
49
 
42
 
51
 #include "watchdog_STM32F1.h"
44
 #include "watchdog_STM32F1.h"
52
 
45
 
53
 #include "HAL_timers_STM32F1.h"
46
 #include "HAL_timers_STM32F1.h"
47
+
48
+#include <stdint.h>
49
+#include <util/atomic.h>
50
+
54
 #include "../../inc/MarlinConfigPre.h"
51
 #include "../../inc/MarlinConfigPre.h"
55
 
52
 
56
 // --------------------------------------------------------------------------
53
 // --------------------------------------------------------------------------

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

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

+ 9
- 9
Marlin/src/HAL/HAL_STM32F4/HAL.h View File

32
 // Includes
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
 #include "../shared/math_32bit.h"
36
 #include "../shared/math_32bit.h"
44
 #include "../shared/HAL_SPI.h"
37
 #include "../shared/HAL_SPI.h"
45
 #include "fastio_STM32F4.h"
38
 #include "fastio_STM32F4.h"
46
 #include "watchdog_STM32F4.h"
39
 #include "watchdog_STM32F4.h"
47
-
48
 #include "HAL_timers_STM32F4.h"
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
 // Defines
51
 // Defines
52
 // --------------------------------------------------------------------------
52
 // --------------------------------------------------------------------------

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

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

+ 1
- 8
Marlin/src/HAL/HAL_TEENSY31_32/HAL.h View File

28
 
28
 
29
 #define CPU_32_BIT
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
 #include "../math_32bit.h"
33
 #include "../math_32bit.h"
41
 #include "../HAL_SPI.h"
34
 #include "../HAL_SPI.h"

+ 1
- 9
Marlin/src/HAL/HAL_TEENSY35_36/HAL.h View File

31
 // Includes
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
 #include "../shared/math_32bit.h"
35
 #include "../shared/math_32bit.h"
44
 #include "../shared/HAL_SPI.h"
36
 #include "../shared/HAL_SPI.h"
45
 
37
 

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

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

+ 50
- 0
Marlin/src/HAL/shared/Marduino.h View File

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 View File

55
 
55
 
56
 #if HAS_SERVOS && !(IS_32BIT_TEENSY || defined(TARGET_LPC1768) || defined(STM32F1) || defined(STM32F1xx) || defined(STM32F4) || defined(STM32F4xx) || defined(STM32F7xx))
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
 #include "servo.h"
58
 #include "servo.h"
60
 #include "servo_private.h"
59
 #include "servo_private.h"
61
 
60
 

+ 3
- 2
Marlin/src/lcd/fontutils.h View File

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

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

746
 
746
 
747
       refresh();
747
       refresh();
748
       init_lcd(); // May revive the LCD if static electricity killed it
748
       init_lcd(); // May revive the LCD if static electricity killed it
749
+
749
       ms = millis();
750
       ms = millis();
750
       next_lcd_update_ms = ms + LCD_UPDATE_INTERVAL;  // delay LCD update until after SD activity completes
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 View File

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

+ 27
- 8
Marlin/src/libs/softspi.h View File

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
 #ifndef FORCE_INLINE
30
 #ifndef FORCE_INLINE
6
   #define FORCE_INLINE inline __attribute__((always_inline))
31
   #define FORCE_INLINE inline __attribute__((always_inline))
7
 #endif
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
 #define nop __asm__ volatile ("nop") // NOP for timing
34
 #define nop __asm__ volatile ("nop") // NOP for timing
16
 
35
 
17
 #ifdef __arm__
36
 #ifdef __arm__

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

271
 
271
 
272
 
272
 
273
 // Check if all pins are defined in mega/pins_arduino.h
273
 // Check if all pins are defined in mega/pins_arduino.h
274
-#include <Arduino.h>
274
+//#include <Arduino.h>
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"
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
                                           "to digital_pin_to_port_PGM, digital_pin_to_bit_mask_PGM, digital_pin_to_timer_PGM, NUM_DIGITAL_PINS, see below");
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…
Cancel
Save