Apply #pragma once, misc cleanup (#12322)

* Apply #pragma once in headers
* Adjust some thermistors formatting
* Misc cleanup and formatting
This commit is contained in:
Scott Lahteine
2018-11-04 02:25:55 -06:00
committed by GitHub
parent 8696f882a9
commit f5eab912ed
179 changed files with 710 additions and 1343 deletions

View File

@ -16,9 +16,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _HAL_AVR_H_
#define _HAL_AVR_H_
#pragma once
// --------------------------------------------------------------------------
// Includes
@ -374,5 +372,3 @@ inline void HAL_adc_init(void) {
// AVR compatibility
#define strtof strtod
#endif // _HAL_AVR_H_

View File

@ -19,6 +19,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#pragma once
/**
* MarlinSerial.h - Hardware serial library for Wiring
@ -30,9 +31,6 @@
* Templatized 01 October 2018 by Eduardo José Tagle to allow multiple instances
*/
#ifndef _MARLINSERIAL_H_
#define _MARLINSERIAL_H_
#include "../shared/MarlinSerial.h"
#include <WString.h>
@ -281,5 +279,3 @@
#if defined(USBCON) && ENABLED(BLUETOOTH)
extern HardwareSerial bluetoothSerial;
#endif
#endif // _MARLINSERIAL_H_

View File

@ -19,9 +19,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef _SANITYCHECK_AVR_8_BIT_H_
#define _SANITYCHECK_AVR_8_BIT_H_
#pragma once
/**
* Test AVR specific configuration values for errors at compile-time.
@ -116,5 +114,3 @@
|| defined(E4_HARDWARE_SERIAL) )
#error "Select hardware UART for TMC2208 to use both TMC2208 and ENDSTOP_INTERRUPTS_FEATURE."
#endif
#endif // _SANITYCHECK_AVR_8_BIT_H_

View File

@ -19,6 +19,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#pragma once
/**
* ServoTimers.h - Interrupt driven Servo library for Arduino using 16 bit timers- Version 2
@ -39,9 +40,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef _SERVOTIMERS_H_
#define _SERVOTIMERS_H_
/**
* Defines for 16 bit timers used with Servo library
*
@ -91,5 +89,3 @@ typedef enum {
#endif
_Nbr_16timers
} timer16_Sequence_t;
#endif // _SERVOTIMERS_H_

View File

@ -19,6 +19,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#pragma once
/**
* Endstop Interrupts
@ -35,9 +36,6 @@
* (Located in Marlin/buildroot/share/pin_interrupt_test/pin_interrupt_test.ino)
*/
#ifndef _ENDSTOP_INTERRUPTS_H_
#define _ENDSTOP_INTERRUPTS_H_
#include "../../core/macros.h"
#include <stdint.h>
#include "../../module/endstops.h"
@ -256,5 +254,3 @@ void setup_endstop_interrupts( void ) {
// If we arrive here without raising an assertion, each pin has either an EXT-interrupt or a PCI.
}
#endif // _ENDSTOP_INTERRUPTS_H_

View File

@ -19,6 +19,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#pragma once
/**
* Pin mapping for the 1280 and 2560
@ -28,9 +29,6 @@
* Logical Pin : 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx
*/
#ifndef _FASTIO_1280_H_
#define _FASTIO_1280_H_
#include "fastio_AVR.h"
// change for your board
@ -1111,5 +1109,3 @@
#define PL7_WPORT PORTL
#define PL7_DDR DDRL
#define PL7_PWM NULL
#endif // _FASTIO_1280_H_

View File

@ -19,6 +19,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#pragma once
/**
* Pin mapping for the 1281 and 2561
@ -27,9 +28,6 @@
* Port: A0 A1 A2 A3 A4 A5 A6 A7 B0 B1 B2 B3 B4 B5 B6 B7 C0 C1 C2 C3 C4 C5 C6 C7 D0 D1 D2 D3 D4 D5 D6 D7 E0 E1 E2 E3 E4 E5 E6 E7 F0 F1 F2 F3 F4 F5 F6 F7 G0 G1 G2 G3 G4 G5
*/
#ifndef _FASTIO_1281_H_
#define _FASTIO_1281_H_
#include "fastio_AVR.h"
// change for your board
@ -715,5 +713,3 @@
#define PG5_WPORT PORTG
#define PG5_DDR DDRG
#define PG5_PWM &OCR0B
#endif // _FASTIO_1281_H_

View File

@ -19,6 +19,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#pragma once
/**
* Pin mapping for the 168, 328, and 328P
@ -27,9 +28,6 @@
* Port: B0 B1 B2 B3 B4 B5 C0 C1 C2 C3 C4 C5 C6 C7 D0 D1 D2 D3 D4 D5 D6 D7
*/
#ifndef _FASTIO_168_H_
#define _FASTIO_168_H_
#include "fastio_AVR.h"
#define DEBUG_LED AIO5
@ -357,5 +355,3 @@
#define PD7_WPORT PORTD
#define PD7_DDR DDRD
#define PD7_PWM NULL
#endif // _FASTIO_168_H_

View File

@ -19,6 +19,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#pragma once
/**
* Pin mapping for the 644, 644p, 644pa, and 1284p
@ -53,9 +54,6 @@
* +--------+
*/
#ifndef _FASTIO_644_H_
#define _FASTIO_644_H_
#include "fastio_AVR.h"
#define DEBUG_LED DIO0
@ -552,5 +550,3 @@
#define PD7_WPORT PORTD
#define PD7_DDR DDRD
#define PD7_PWM OCR2A
#endif // _FASTIO_644_H_

View File

@ -19,6 +19,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#pragma once
/**
* Pin mapping (Teensy) for AT90USB646, 647, 1286, and 1287
@ -28,9 +29,6 @@
* The logical pins 46 and 47 are not supported by Teensyduino, but are supported below as E2 and E3
*/
#ifndef _FASTIO_AT90USB_H_
#define _FASTIO_AT90USB_H_
#include "fastio_AVR.h"
// change for your board
@ -697,5 +695,3 @@
#define TIMER3A 5
#define TIMER3B 4
#define TIMER3C 3
#endif // _FASTIO_AT90USB_H_

View File

@ -19,6 +19,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#pragma once
/**
* Fast I/O Routines for AVR
@ -26,9 +27,6 @@
* Contributed by Triffid_Hunter and modified by Kliment, thinkyhead, Bob-the-Kuhn, et.al.
*/
#ifndef _FASTIO_ARDUINO_H_
#define _FASTIO_ARDUINO_H_
#include <avr/io.h>
#include "../../core/macros.h"
@ -312,5 +310,3 @@ enum ClockSource2 : char {
// finally - the macro that tells us if a pin is an available hardware PWM
#define USEABLE_HARDWARE_PWM(p) (PWM_PINS(p) && !PWM_CHK(p))
#endif // _FASTIO_ARDUINO_H_

View File

@ -19,9 +19,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef _MATH_AVR_H_
#define _MATH_AVR_H_
#pragma once
/**
* Optimized math functions for AVR
@ -113,5 +111,3 @@ static FORCE_INLINE uint16_t MultiU16X8toH16(uint8_t charIn1, uint16_t intIn2) {
);
return intRes;
}
#endif // _MATH_AVR_H_

View File

@ -19,14 +19,12 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#pragma once
/**
* PWM print routines for Atmel 8 bit AVR CPUs
*/
#ifndef _PINSDEBUG_AVR_8_BIT_
#define _PINSDEBUG_AVR_8_BIT_
#include "../../inc/MarlinConfig.h"
#define NUMBER_PINS_TOTAL NUM_DIGITAL_PINS
@ -406,5 +404,3 @@ static void pwm_details(uint8_t pin) {
#endif
#define PRINT_PIN(p) do {sprintf_P(buffer, PSTR("%3d "), p); SERIAL_ECHO(buffer);} while (0)
#endif // _PINSDEBUG_AVR_8_BIT_

View File

@ -19,9 +19,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef _PINSDEBUG_TEENSYSUINO_H_
#define _PINSDEBUG_TEENSYSUINO_H_
#pragma once
//
// some of the pin mapping functions of the Teensduino extension to the Arduino IDE
@ -111,5 +109,3 @@ const uint8_t PROGMEM digital_pin_to_port_PGM[] = {
// disable the PWMs so we can use it as is
// portModeRegister(pin) is OK
#endif // _PINSDEBUG_TEENSYSUINO_H_

View File

@ -20,14 +20,12 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#pragma once
/**
* Structures for 2560 family boards that use more than 70 pins
*/
#ifndef _PINSDEBUG_PLUS_70_H_
#define _PINSDEBUG_PLUS_70_H_
#undef NUM_DIGITAL_PINS
#if MB(BQ_ZUM_MEGA_3D)
#define NUM_DIGITAL_PINS 85
@ -336,6 +334,3 @@ const uint8_t PROGMEM digital_pin_to_timer_PGM_plus_70[] = {
* PCINT14 J5 76
* PCINT15 J6 77
*/
#endif // _PINSDEBUG_PLUS_70_H_

View File

@ -19,9 +19,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef _SPI_PINS_H_
#define _SPI_PINS_H_
#pragma once
/**
* Define SPI Pins: SCK, MISO, MOSI, SS
@ -65,6 +63,3 @@
#ifndef SS_PIN
#define SS_PIN AVR_SS_PIN
#endif
#endif // _SPI_PINS_H_

View File

@ -19,9 +19,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef _WATCHDOG_AVR_H_
#define _WATCHDOG_AVR_H_
#pragma once
#include <avr/wdt.h>
@ -31,5 +29,3 @@ void watchdog_init();
// Reset watchdog. MUST be called at least every 4 seconds after the
// first watchdog_init or AVR will go into emergency procedures.
inline void watchdog_reset() { wdt_reset(); }
#endif // _WATCHDOG_AVR_H_