diff --git a/Marlin/src/HAL/HAL_AVR/HAL.h b/Marlin/src/HAL/HAL_AVR/HAL.h index b5b63dc5d146e07c78a2f9a77f00c8825fe49902..9dc5e95c5550254ac4a098c342d87c5b857e6e5f 100644 --- a/Marlin/src/HAL/HAL_AVR/HAL.h +++ b/Marlin/src/HAL/HAL_AVR/HAL.h @@ -24,14 +24,7 @@ #include <stdint.h> -#include <Arduino.h> - -#include <util/delay.h> -#include <avr/eeprom.h> -#include <avr/pgmspace.h> -#include <avr/interrupt.h> -#include <avr/io.h> - +#include "../shared/Marduino.h" #include "../shared/HAL_SPI.h" #include "fastio_AVR.h" #include "watchdog_AVR.h" @@ -43,6 +36,12 @@ #include "MarlinSerial.h" #endif +#include <util/delay.h> +#include <avr/eeprom.h> +#include <avr/pgmspace.h> +#include <avr/interrupt.h> +#include <avr/io.h> + // -------------------------------------------------------------------------- // Defines // -------------------------------------------------------------------------- diff --git a/Marlin/src/HAL/HAL_AVR/fastio_AVR.cpp b/Marlin/src/HAL/HAL_AVR/fastio_AVR.cpp index 63fbe4d9699009241df734a87d982d00f3bbce1a..c58f9da41df065b60c6e791f47190e1e3742cc8d 100644 --- a/Marlin/src/HAL/HAL_AVR/fastio_AVR.cpp +++ b/Marlin/src/HAL/HAL_AVR/fastio_AVR.cpp @@ -30,7 +30,7 @@ #ifdef FASTIO_EXT_START -#include <Arduino.h> +#include "../shared/Marduino.h" #define _IS_EXT(P) WITHIN(P, FASTIO_EXT_START, FASTIO_EXT_END) diff --git a/Marlin/src/HAL/HAL_AVR/servo_AVR.cpp b/Marlin/src/HAL/HAL_AVR/servo_AVR.cpp index e3d2194bf7f5c7a3e8d81045ea32d928348e0b91..7e8357ed57ab3ad1dc8a57e7274308590e26e3ea 100644 --- a/Marlin/src/HAL/HAL_AVR/servo_AVR.cpp +++ b/Marlin/src/HAL/HAL_AVR/servo_AVR.cpp @@ -58,8 +58,8 @@ #if HAS_SERVOS #include <avr/interrupt.h> -#include <Arduino.h> +#include "../shared/Marduino.h" #include "../shared/servo.h" #include "../shared/servo_private.h" diff --git a/Marlin/src/HAL/HAL_DUE/EepromEmulation_Due.cpp b/Marlin/src/HAL/HAL_DUE/EepromEmulation_Due.cpp index 21f1a8c9d40dd67a1536b0bacf95818f6346ad91..07f746a17d96a2752ad2f3e59f407d8a7b252864 100644 --- a/Marlin/src/HAL/HAL_DUE/EepromEmulation_Due.cpp +++ b/Marlin/src/HAL/HAL_DUE/EepromEmulation_Due.cpp @@ -36,7 +36,7 @@ #if ENABLED(EEPROM_SETTINGS) && DISABLED(I2C_EEPROM, SPI_EEPROM) -#include <Arduino.h> +#include "../shared/Marduino.h" #define EEPROMSize 4096 #define PagesPerGroup 128 diff --git a/Marlin/src/HAL/HAL_DUE/HAL.h b/Marlin/src/HAL/HAL_DUE/HAL.h index d430e6b649fb18c753845e7260e483189a6a7b70..2fd9a0b0dd219329bc021c2b5950c33f6145d73e 100644 --- a/Marlin/src/HAL/HAL_DUE/HAL.h +++ b/Marlin/src/HAL/HAL_DUE/HAL.h @@ -29,16 +29,15 @@ #define CPU_32_BIT -#include <stdint.h> - -#include <Arduino.h> - +#include "../shared/Marduino.h" #include "../shared/math_32bit.h" #include "../shared/HAL_SPI.h" #include "fastio_Due.h" #include "watchdog_Due.h" #include "HAL_timers_Due.h" +#include <stdint.h> + // Serial ports #if !WITHIN(SERIAL_PORT, -1, 3) #error "SERIAL_PORT must be from -1 to 3" diff --git a/Marlin/src/HAL/HAL_DUE/Servo_Due.cpp b/Marlin/src/HAL/HAL_DUE/Servo_Due.cpp index 848d263b708127924234bbf534f37fa467e479e5..d9e41f9541056a37274b09b23d1939ea3695c144 100644 --- a/Marlin/src/HAL/HAL_DUE/Servo_Due.cpp +++ b/Marlin/src/HAL/HAL_DUE/Servo_Due.cpp @@ -44,7 +44,7 @@ #if HAS_SERVOS -#include <Arduino.h> +#include "../shared/Marduino.h" #include "../shared/servo.h" #include "../shared/servo_private.h" diff --git a/Marlin/src/HAL/HAL_DUE/pinsDebug.h b/Marlin/src/HAL/HAL_DUE/pinsDebug.h index 9d865770524049ad09dbf9678333cc81a82f9daa..9b6cbe1cc4b4f146bc349023c3c3079e752e295c 100644 --- a/Marlin/src/HAL/HAL_DUE/pinsDebug.h +++ b/Marlin/src/HAL/HAL_DUE/pinsDebug.h @@ -28,7 +28,7 @@ * Translation of routines & variables used by pinsDebug.h */ -#include <Arduino.h> +#include "../shared/Marduino.h" /** * Due/Marlin quirks diff --git a/Marlin/src/HAL/HAL_DUE/u8g_com_HAL_DUE_shared_hw_spi.cpp b/Marlin/src/HAL/HAL_DUE/u8g_com_HAL_DUE_shared_hw_spi.cpp index ba7700150f5c9096d4b8dd7bf3501ab3eb259040..9e92519ef6a487eb3ff8693860ceb75e217499ee 100644 --- a/Marlin/src/HAL/HAL_DUE/u8g_com_HAL_DUE_shared_hw_spi.cpp +++ b/Marlin/src/HAL/HAL_DUE/u8g_com_HAL_DUE_shared_hw_spi.cpp @@ -66,20 +66,20 @@ #include "../../Marlin.h" -#define SPI_FULL_SPEED 0 -#define SPI_HALF_SPEED 1 -#define SPI_QUARTER_SPEED 2 -#define SPI_EIGHTH_SPEED 3 +#define SPI_FULL_SPEED 0 +#define SPI_HALF_SPEED 1 +#define SPI_QUARTER_SPEED 2 +#define SPI_EIGHTH_SPEED 3 #define SPI_SIXTEENTH_SPEED 4 -#define SPI_SPEED_5 5 -#define SPI_SPEED_6 6 +#define SPI_SPEED_5 5 +#define SPI_SPEED_6 6 void spiBegin(); void spiInit(uint8_t spiRate); void spiSend(uint8_t b); void spiSend(const uint8_t* buf, size_t n); -#include <Arduino.h> +#include "../shared/Marduino.h" #include "fastio_Due.h" void u8g_SetPIOutput_DUE_hw_spi(u8g_t *u8g, uint8_t pin_index) { diff --git a/Marlin/src/HAL/HAL_DUE/u8g_com_HAL_DUE_st7920_sw_spi.cpp b/Marlin/src/HAL/HAL_DUE/u8g_com_HAL_DUE_st7920_sw_spi.cpp index 3cef880bcaba0b6a52dae632d2b1282b8dbedb9e..34428573bb3c54d40e193a10a1002f5b4080d9e7 100644 --- a/Marlin/src/HAL/HAL_DUE/u8g_com_HAL_DUE_st7920_sw_spi.cpp +++ b/Marlin/src/HAL/HAL_DUE/u8g_com_HAL_DUE_st7920_sw_spi.cpp @@ -59,10 +59,11 @@ #if HAS_GRAPHICAL_LCD -#include <U8glib.h> -#include <Arduino.h> +#include "../shared/Marduino.h" #include "../shared/Delay.h" +#include <U8glib.h> + void u8g_SetPIOutput_DUE(u8g_t *u8g, uint8_t pin_index) { PIO_Configure(g_APinDescription[u8g->pin_list[pin_index]].pPort, PIO_OUTPUT_1, g_APinDescription[u8g->pin_list[pin_index]].ulPin, g_APinDescription[u8g->pin_list[pin_index]].ulPinConfiguration); // OUTPUT diff --git a/Marlin/src/HAL/HAL_ESP32/HAL.h b/Marlin/src/HAL/HAL_ESP32/HAL.h index 16859263b2e066ae9c493ed9534bd0d3cd2ed84a..556a484677b6695b41b1e14bb391d740e5d093c8 100644 --- a/Marlin/src/HAL/HAL_ESP32/HAL.h +++ b/Marlin/src/HAL/HAL_ESP32/HAL.h @@ -30,19 +30,7 @@ #include <stdint.h> -// these are going to be re-defined in Arduino.h -#undef DISABLED -#undef M_PI -#undef _BV - -#include <Arduino.h> - -// revert back to the correct (old) definition -#undef DISABLED -#define DISABLED(V...) DO(DIS,&&,V) -// re-define in case Arduino.h has been skipped due to earlier inclusion (i.e. in Marlin\src\HAL\HAL_ESP32\i2s.cpp) -#define _BV(b) (1UL << (b)) - +#include "../shared/Marduino.h" #include "../shared/math_32bit.h" #include "../shared/HAL_SPI.h" diff --git a/Marlin/src/HAL/HAL_ESP32/i2s.cpp b/Marlin/src/HAL/HAL_ESP32/i2s.cpp index 0345889e076778baedbadf65a33f31320de2c212..3dbabb535e464364b73e099fb078f942a68ce7ad 100644 --- a/Marlin/src/HAL/HAL_ESP32/i2s.cpp +++ b/Marlin/src/HAL/HAL_ESP32/i2s.cpp @@ -21,13 +21,9 @@ */ #ifdef ARDUINO_ARCH_ESP32 -// replace that with the proper imports, then cleanup workarounds in Marlin\src\HAL\HAL_ESP32\HAL.h -#include <Arduino.h> -// revert back to the correct definition -#undef DISABLED -#define DISABLED(V...) DO(DIS,&&,V) - #include "i2s.h" + +#include "../shared/Marduino.h" #include "../../core/macros.h" #include "driver/periph_ctrl.h" #include "rom/lldesc.h" diff --git a/Marlin/src/HAL/HAL_ESP32/i2s.h b/Marlin/src/HAL/HAL_ESP32/i2s.h index fbe7b2419ac3d4f4e4079a442b325db61d5d5425..42c35aa12d2e0cb1b0e8f39228b3f4bbcf2e7d6f 100644 --- a/Marlin/src/HAL/HAL_ESP32/i2s.h +++ b/Marlin/src/HAL/HAL_ESP32/i2s.h @@ -21,6 +21,8 @@ */ #pragma once +#include <stdint.h> + // current value of the outputs provided over i2s extern uint32_t i2s_port_data; diff --git a/Marlin/src/HAL/HAL_LINUX/HAL.h b/Marlin/src/HAL/HAL_LINUX/HAL.h index 1057fae995217f5616d88ef6abfd16c07d884387..b3cabdfe6f049fd2cd5c8ebfae3280fdd085f1f0 100644 --- a/Marlin/src/HAL/HAL_LINUX/HAL.h +++ b/Marlin/src/HAL/HAL_LINUX/HAL.h @@ -47,16 +47,15 @@ uint8_t _getc(); //arduino: Print.h #define DEC 10 #define HEX 16 -#define OCT 8 -#define BIN 2 +#define OCT 8 +#define BIN 2 //arduino: binary.h (weird defines) #define B01 1 #define B10 2 #include "hardware/Clock.h" -#include <Arduino.h> - +#include "../shared/Marduino.h" #include "../shared/math_32bit.h" #include "../shared/HAL_SPI.h" #include "fastio.h" diff --git a/Marlin/src/HAL/HAL_LINUX/fastio.h b/Marlin/src/HAL/HAL_LINUX/fastio.h index 8eae771a4fd6d0b47a4a14cd770fd62d99f6c0d6..d304c4b2a2a8030d3db850013578f2d9932b4714 100644 --- a/Marlin/src/HAL/HAL_LINUX/fastio.h +++ b/Marlin/src/HAL/HAL_LINUX/fastio.h @@ -25,7 +25,7 @@ * Fast I/O Routines for X86_64 */ -#include <Arduino.h> +#include "../shared/Marduino.h" #include <pinmapping.h> #define SET_DIR_INPUT(IO) Gpio::setDir(IO, 1) diff --git a/Marlin/src/HAL/HAL_LPC1768/HAL.h b/Marlin/src/HAL/HAL_LPC1768/HAL.h index 36357d6aea26dece7ffe68e3610579832bd1382f..24dea75304f01fe19e3df7eabd6ae0237e935281 100644 --- a/Marlin/src/HAL/HAL_LPC1768/HAL.h +++ b/Marlin/src/HAL/HAL_LPC1768/HAL.h @@ -37,18 +37,18 @@ void HAL_init(); extern "C" volatile millis_t _millis; -#include <Arduino.h> -#include <pinmapping.h> -#include <CDCSerial.h> - +#include "../shared/Marduino.h" #include "../shared/math_32bit.h" #include "../shared/HAL_SPI.h" #include "fastio.h" -#include <adc.h> #include "watchdog.h" #include "HAL_timers.h" #include "MarlinSerial.h" +#include <adc.h> +#include <pinmapping.h> +#include <CDCSerial.h> + // // Default graphical display delays // diff --git a/Marlin/src/HAL/HAL_LPC1768/fastio.h b/Marlin/src/HAL/HAL_LPC1768/fastio.h index 49f8ec13c35cd433b7f29d24be49c60eb3b6f0a7..22bda795d015a63d2bab99f744abf0892ffeff57 100644 --- a/Marlin/src/HAL/HAL_LPC1768/fastio.h +++ b/Marlin/src/HAL/HAL_LPC1768/fastio.h @@ -33,7 +33,7 @@ * For TARGET LPC1768 */ -#include <Arduino.h> +#include "../shared/Marduino.h" #define PWM_PIN(P) true // all pins are PWM capable #define USEABLE_HARDWARE_PWM(P) PWM_PIN(P) diff --git a/Marlin/src/HAL/HAL_LPC1768/u8g/u8g_com_HAL_LPC1768_sw_spi.cpp b/Marlin/src/HAL/HAL_LPC1768/u8g/u8g_com_HAL_LPC1768_sw_spi.cpp index e851284ad55ff8a0b31e57f53ce8d43e9b57e359..860321aa73b2a6f9bb92601a3a762f057b5724cf 100644 --- a/Marlin/src/HAL/HAL_LPC1768/u8g/u8g_com_HAL_LPC1768_sw_spi.cpp +++ b/Marlin/src/HAL/HAL_LPC1768/u8g/u8g_com_HAL_LPC1768_sw_spi.cpp @@ -59,17 +59,17 @@ #if HAS_GRAPHICAL_LCD -#include <U8glib.h> #include "SoftwareSPI.h" #undef SPI_SPEED #define SPI_SPEED 2 // About 2 MHz +#include <Arduino.h> #include <algorithm> #include <LPC17xx.h> #include <gpio.h> -#include <Arduino.h> +#include <U8glib.h> 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 ) { diff --git a/Marlin/src/HAL/HAL_STM32/HAL.h b/Marlin/src/HAL/HAL_STM32/HAL.h index d08a49587f3ce5c7cbc0ddd085c1461e28e11c8a..44cc96957bf818c770bc9c86eb53e46da00a5005 100644 --- a/Marlin/src/HAL/HAL_STM32/HAL.h +++ b/Marlin/src/HAL/HAL_STM32/HAL.h @@ -28,20 +28,20 @@ // Includes // -------------------------------------------------------------------------- -#include <stdint.h> +#include "../shared/Marduino.h" +#include "../shared/math_32bit.h" +#include "../shared/HAL_SPI.h" +#include "fastio_STM32.h" +#include "watchdog_STM32.h" + +#include "../../inc/MarlinConfigPre.h" -#include "Arduino.h" +#include <stdint.h> #ifdef USBCON #include <USBSerial.h> #endif -#include "../../inc/MarlinConfigPre.h" -#include "../shared/math_32bit.h" -#include "../shared/HAL_SPI.h" -#include "fastio_STM32.h" -#include "watchdog_STM32.h" - // -------------------------------------------------------------------------- // Defines // -------------------------------------------------------------------------- diff --git a/Marlin/src/HAL/HAL_STM32F1/HAL.h b/Marlin/src/HAL/HAL_STM32F1/HAL.h index 66c4cba59e779ba12af9f045a8402aafdd78f2c5..66c7ee883abbfaccec9f3f6cfdf7651add4bb87c 100644 --- a/Marlin/src/HAL/HAL_STM32F1/HAL.h +++ b/Marlin/src/HAL/HAL_STM32F1/HAL.h @@ -36,14 +36,7 @@ // Includes // -------------------------------------------------------------------------- -#include <stdint.h> -#include <util/atomic.h> -#include <Arduino.h> - -// -------------------------------------------------------------------------- -// Includes -// -------------------------------------------------------------------------- - +#include "../shared/Marduino.h" #include "../shared/math_32bit.h" #include "../shared/HAL_SPI.h" @@ -51,6 +44,10 @@ #include "watchdog_STM32F1.h" #include "HAL_timers_STM32F1.h" + +#include <stdint.h> +#include <util/atomic.h> + #include "../../inc/MarlinConfigPre.h" // -------------------------------------------------------------------------- diff --git a/Marlin/src/HAL/HAL_STM32F1/HAL_sdio_STM32F1.h b/Marlin/src/HAL/HAL_STM32F1/HAL_sdio_STM32F1.h index 86c1355456c9098bedb3742c7bb02cc1b55b5a06..bb48b3beda0f5e8eb2411e6fb63e89eb914f1739 100644 --- a/Marlin/src/HAL/HAL_STM32F1/HAL_sdio_STM32F1.h +++ b/Marlin/src/HAL/HAL_STM32F1/HAL_sdio_STM32F1.h @@ -25,7 +25,8 @@ // Includes // -------------------------------------------------------------------------- -#include "Arduino.h" +#include "../shared/Marduino.h" + #include "libmaple/sdio.h" #include "libmaple/dma.h" diff --git a/Marlin/src/HAL/HAL_STM32F4/HAL.h b/Marlin/src/HAL/HAL_STM32F4/HAL.h index c41fe05f60a758aef29802d1429837bb87173929..6f2d22b8dd596f7d95c805951270fc718d86c21f 100644 --- a/Marlin/src/HAL/HAL_STM32F4/HAL.h +++ b/Marlin/src/HAL/HAL_STM32F4/HAL.h @@ -32,21 +32,21 @@ // Includes // -------------------------------------------------------------------------- -#include <stdint.h> - -#include "Arduino.h" - -#ifdef USBCON - #include <USBSerial.h> -#endif - +#include "../shared/Marduino.h" #include "../shared/math_32bit.h" #include "../shared/HAL_SPI.h" #include "fastio_STM32F4.h" #include "watchdog_STM32F4.h" - #include "HAL_timers_STM32F4.h" +#include "../../inc/MarlinConfigPre.h" + +#include <stdint.h> + +#ifdef USBCON + #include <USBSerial.h> +#endif + // -------------------------------------------------------------------------- // Defines // -------------------------------------------------------------------------- diff --git a/Marlin/src/HAL/HAL_STM32F7/HAL.h b/Marlin/src/HAL/HAL_STM32F7/HAL.h index db7aa0391a007a6bba07bfe0adb608def3ffa95e..878d933653518774471772d072a2d6c9fbe1552e 100644 --- a/Marlin/src/HAL/HAL_STM32F7/HAL.h +++ b/Marlin/src/HAL/HAL_STM32F7/HAL.h @@ -34,8 +34,7 @@ #include <stdint.h> -#include "Arduino.h" - +#include "../shared/Marduino.h" #include "../shared/math_32bit.h" #include "../shared/HAL_SPI.h" @@ -44,6 +43,7 @@ #include "HAL_timers_STM32F7.h" +#include "../../inc/MarlinConfigPre.h" // -------------------------------------------------------------------------- // Defines diff --git a/Marlin/src/HAL/HAL_TEENSY31_32/HAL.h b/Marlin/src/HAL/HAL_TEENSY31_32/HAL.h index 81b011b186d974d80acf289a4035e06848b57dc9..0fb1b551fc8fba5a4ccd93f72279f8209d3b9b83 100644 --- a/Marlin/src/HAL/HAL_TEENSY31_32/HAL.h +++ b/Marlin/src/HAL/HAL_TEENSY31_32/HAL.h @@ -28,14 +28,7 @@ #define CPU_32_BIT -// _BV is re-defined in Arduino.h -#undef _BV - -#include <Arduino.h> - -// Redefine sq macro defined by teensy3/wiring.h -#undef sq -#define sq(x) ((x)*(x)) +#include "../shared/Marduino.h" #include "../math_32bit.h" #include "../HAL_SPI.h" diff --git a/Marlin/src/HAL/HAL_TEENSY35_36/HAL.h b/Marlin/src/HAL/HAL_TEENSY35_36/HAL.h index 99fc31aff5375492c235ba9b306a81a4a999baf3..0cd3ed8de5f39022abf5704f4d26abcd4718592f 100644 --- a/Marlin/src/HAL/HAL_TEENSY35_36/HAL.h +++ b/Marlin/src/HAL/HAL_TEENSY35_36/HAL.h @@ -31,15 +31,7 @@ // Includes // -------------------------------------------------------------------------- -// _BV is re-defined in Arduino.h -#undef _BV - -#include <Arduino.h> - -// Redefine sq macro defined by teensy3/wiring.h -#undef sq -#define sq(x) ((x)*(x)) - +#include "../shared/Marduino.h" #include "../shared/math_32bit.h" #include "../shared/HAL_SPI.h" diff --git a/Marlin/src/HAL/shared/HAL_ST7920.h b/Marlin/src/HAL/shared/HAL_ST7920.h index 9af1286c7a5d7f4e563bdce066b6f204aa79f2a0..bdc2b8cbb20d479868bcb0d856d29861d60d89bd 100644 --- a/Marlin/src/HAL/shared/HAL_ST7920.h +++ b/Marlin/src/HAL/shared/HAL_ST7920.h @@ -33,4 +33,4 @@ void ST7920_set_cmd(); void ST7920_set_dat(); void ST7920_write_byte(const uint8_t data); -#endif \ No newline at end of file +#endif diff --git a/Marlin/src/HAL/shared/Marduino.h b/Marlin/src/HAL/shared/Marduino.h new file mode 100644 index 0000000000000000000000000000000000000000..bb93451efc00f340b802c599e3b3dc90109550c2 --- /dev/null +++ b/Marlin/src/HAL/shared/Marduino.h @@ -0,0 +1,50 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (C) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ +#pragma once + +/** + * HAL/shared/Marduino.h + */ + +#undef DISABLED // Redefined by ESP32 +#undef M_PI // Redefined by all +#undef _BV // Redefined by some +#undef sq // Redefined by teensy3/wiring.h + +#include <Arduino.h> // NOTE: If included earlier then this line is a NOOP + +#undef DISABLED +#define DISABLED(V...) DO(DIS,&&,V) + +#undef _BV +#define _BV(b) (1UL << (b)) + +#undef sq +#define sq(x) ((x)*(x)) + +#ifndef SBI + #define SBI(A,B) (A |= (1 << (B))) +#endif + +#ifndef CBI + #define CBI(A,B) (A &= ~(1 << (B))) +#endif diff --git a/Marlin/src/HAL/shared/servo.cpp b/Marlin/src/HAL/shared/servo.cpp index 0d276c4aa6fab4f2511d25c762d99573f89e62ea..ec25569f9dafddf5d034d6b75d7ae80a99870d45 100644 --- a/Marlin/src/HAL/shared/servo.cpp +++ b/Marlin/src/HAL/shared/servo.cpp @@ -55,7 +55,6 @@ #if HAS_SERVOS && !(IS_32BIT_TEENSY || defined(TARGET_LPC1768) || defined(STM32F1) || defined(STM32F1xx) || defined(STM32F4) || defined(STM32F4xx) || defined(STM32F7xx)) -//#include <Arduino.h> #include "servo.h" #include "servo_private.h" diff --git a/Marlin/src/lcd/fontutils.h b/Marlin/src/lcd/fontutils.h index 2f4dca7dcab8c27163d18041e64bcec5bba85770..28921aef2513d56a4670c2ccaf24aa4fc155591f 100644 --- a/Marlin/src/lcd/fontutils.h +++ b/Marlin/src/lcd/fontutils.h @@ -8,9 +8,10 @@ */ #pragma once -#include <stdlib.h> -#include <Arduino.h> +#include "../HAL/shared/Marduino.h" #include "../core/macros.h" + +#include <stdlib.h> #include <stddef.h> // wchar_t #include <stdint.h> // uint32_t diff --git a/Marlin/src/lcd/ultralcd.cpp b/Marlin/src/lcd/ultralcd.cpp index f7381c1d14dfb0bfe1cee11b4959b09d26e3b392..3fd483a79f5ca0ff2437e4a37ff32d954c0384cd 100644 --- a/Marlin/src/lcd/ultralcd.cpp +++ b/Marlin/src/lcd/ultralcd.cpp @@ -746,6 +746,7 @@ void MarlinUI::update() { refresh(); init_lcd(); // May revive the LCD if static electricity killed it + ms = millis(); next_lcd_update_ms = ms + LCD_UPDATE_INTERVAL; // delay LCD update until after SD activity completes } diff --git a/Marlin/src/libs/duration_t.h b/Marlin/src/libs/duration_t.h index b446f4b496b0662ce7ffe92a693851c82b104e9d..1eb0b0398425690618d98eaf4a616263a93b78f3 100644 --- a/Marlin/src/libs/duration_t.h +++ b/Marlin/src/libs/duration_t.h @@ -21,7 +21,7 @@ */ #pragma once -#include <Arduino.h> +#include "../HAL/shared/Marduino.h" struct duration_t { /** diff --git a/Marlin/src/libs/softspi.h b/Marlin/src/libs/softspi.h index 819567df8157dc7ec43c53c0da173473716d6d3b..e986922c83b03eb71c83cda79e1977191b89d294 100644 --- a/Marlin/src/libs/softspi.h +++ b/Marlin/src/libs/softspi.h @@ -1,17 +1,36 @@ -// https://github.com/niteris/ArduinoSoftSpi +/** + * Marlin 3D Printer Firmware + * Copyright (C) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ +#pragma once + +// +// Based on https://github.com/niteris/ArduinoSoftSpi +// -#include <Arduino.h> +#include "../HAL/shared/Marduino.h" #ifndef FORCE_INLINE #define FORCE_INLINE inline __attribute__((always_inline)) #endif -#ifndef _BV - #define _BV(B) (1 << (B)) - #define SBI(A,B) (A |= (1 << (B))) - #define CBI(A,B) (A &= ~(1 << (B))) -#endif - #define nop __asm__ volatile ("nop") // NOP for timing #ifdef __arm__ diff --git a/Marlin/src/pins/pins_MIGHTYBOARD_REVE.h b/Marlin/src/pins/pins_MIGHTYBOARD_REVE.h index d9def846c2cec12ff6cf7c87369a346cc30bc1eb..5a4fa42354dfa07d603afe4c3d8e21d0cbab9c70 100644 --- a/Marlin/src/pins/pins_MIGHTYBOARD_REVE.h +++ b/Marlin/src/pins/pins_MIGHTYBOARD_REVE.h @@ -271,7 +271,7 @@ // Check if all pins are defined in mega/pins_arduino.h -#include <Arduino.h> +//#include <Arduino.h> 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" "to digital_pin_to_port_PGM, digital_pin_to_bit_mask_PGM, digital_pin_to_timer_PGM, NUM_DIGITAL_PINS, see below");