Browse Source

Fix some AVR HAL code style

Scott Lahteine 7 years ago
parent
commit
fd128b3c93

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

@@ -26,8 +26,8 @@
26 26
  */
27 27
 
28 28
 
29
-#ifndef _HAL_AVR_H
30
-#define _HAL_AVR_H
29
+#ifndef _HAL_AVR_H_
30
+#define _HAL_AVR_H_
31 31
 
32 32
 // --------------------------------------------------------------------------
33 33
 // Includes
@@ -153,9 +153,4 @@ inline void HAL_adc_init(void) {
153 153
 
154 154
 #define HAL_READ_ADC ADC
155 155
 
156
-
157
-// --------------------------------------------------------------------------
158
-//
159
-// --------------------------------------------------------------------------
160
-
161
-#endif // _HAL_AVR_H
156
+#endif // _HAL_AVR_H_

+ 3
- 2
Marlin/src/HAL/HAL_AVR/HAL_pinsDebug_AVR.h View File

@@ -20,7 +20,8 @@
20 20
  *
21 21
  */
22 22
 
23
-#ifndef HAL_PINSDEBUG_AVR_H
23
+#ifndef _HAL_PINSDEBUG_AVR_H_
24
+#define _HAL_PINSDEBUG_AVR_H_
24 25
 
25 26
 void HAL_print_analog_pin(char buffer[], int8_t pin) {
26 27
   sprintf(buffer, "(A%2d)  ", int(pin - analogInputToDigitalPin(0)));
@@ -590,4 +591,4 @@ inline void report_pin_state_extended(int8_t pin, bool ignore, bool extended = f
590 591
   }
591 592
 }
592 593
 
593
-#endif //HAL_PINSDEBUG_AVR_H
594
+#endif // _HAL_PINSDEBUG_AVR_H_

+ 3
- 3
Marlin/src/HAL/HAL_AVR/MarlinSerial.h View File

@@ -29,8 +29,8 @@
29 29
  * Modified 01 October 2017 by Eduardo José Tagle (added XON/XOFF)
30 30
  */
31 31
 
32
-#ifndef MARLINSERIAL_H
33
-#define MARLINSERIAL_H
32
+#ifndef _MARLINSERIAL_H_
33
+#define _MARLINSERIAL_H_
34 34
 
35 35
 #include "../../inc/MarlinConfig.h"
36 36
 
@@ -181,4 +181,4 @@
181 181
   extern HardwareSerial bluetoothSerial;
182 182
 #endif
183 183
 
184
-#endif // MARLINSERIAL_H
184
+#endif // _MARLINSERIAL_H_

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

@@ -20,15 +20,13 @@
20 20
  *
21 21
  */
22 22
 
23
-/**
24
- * Test AVR specific configuration values for errors at compile-time.
25
- */
23
+#ifndef _SANITYCHECK_AVR_8_BIT_H_
24
+#define _SANITYCHECK_AVR_8_BIT_H_
26 25
 
27 26
 /**
28
- * Require gcc 4.7 or newer (first included with Arduino 1.6.8) for C++11 features.
27
+ * Test AVR specific configuration values for errors at compile-time.
29 28
  */
30 29
 
31
-
32 30
 /**
33 31
  * Digipot requirement
34 32
  */
@@ -39,12 +37,9 @@
39 37
   #endif
40 38
 #endif
41 39
 
42
-
43
-
44 40
 /**
45 41
  * Sanity checks for Spindle / Laser
46 42
  */
47
-
48 43
 #if ENABLED(SPINDLE_LASER_ENABLE)
49 44
   #if !PIN_EXISTS(SPINDLE_LASER_ENABLE)
50 45
     #error "SPINDLE_LASER_ENABLE requires SPINDLE_LASER_ENABLE_PIN."
@@ -100,3 +95,5 @@
100 95
     #endif
101 96
   #endif
102 97
 #endif // SPINDLE_LASER_ENABLE
98
+
99
+#endif // _SANITYCHECK_AVR_8_BIT_H_

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

@@ -21,7 +21,7 @@
21 21
  */
22 22
 
23 23
 /*
24
-  Servo.h - Interrupt driven Servo library for Arduino using 16 bit timers- Version 2
24
+  ServoTimers.h - Interrupt driven Servo library for Arduino using 16 bit timers- Version 2
25 25
   Copyright (c) 2009 Michael Margolis.  All right reserved.
26 26
 
27 27
   This library is free software; you can redistribute it and/or
@@ -39,7 +39,10 @@
39 39
   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
40 40
 */
41 41
 
42
-/*
42
+#ifndef _SERVOTIMERS_H_
43
+#define _SERVOTIMERS_H_
44
+
45
+/**
43 46
  * Defines for 16 bit timers used with  Servo library
44 47
  *
45 48
  * If _useTimerX is defined then TimerX is a 16 bit timer on the current board
@@ -88,3 +91,5 @@ typedef enum {
88 91
   #endif
89 92
   _Nbr_16timers
90 93
 } timer16_Sequence_t;
94
+
95
+#endif // _SERVOTIMERS_H_

+ 3
- 3
Marlin/src/HAL/HAL_AVR/fastio_1280.h View File

@@ -28,8 +28,8 @@
28 28
  *   Marlin   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 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85
29 29
  */
30 30
 
31
-#ifndef _FASTIO_1280
32
-#define _FASTIO_1280
31
+#ifndef _FASTIO_1280_H_
32
+#define _FASTIO_1280_H_
33 33
 
34 34
 #include "fastio_AVR.h"
35 35
 
@@ -1112,4 +1112,4 @@
1112 1112
 #define PL7_DDR     DDRL
1113 1113
 #define PL7_PWM     NULL
1114 1114
 
1115
-#endif // _FASTIO_1280
1115
+#endif // _FASTIO_1280_H_

+ 3
- 3
Marlin/src/HAL/HAL_AVR/fastio_1281.h View File

@@ -28,8 +28,8 @@
28 28
  *   Marlin   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
29 29
  */
30 30
 
31
-#ifndef _FASTIO_1281
32
-#define _FASTIO_1281
31
+#ifndef _FASTIO_1281_H_
32
+#define _FASTIO_1281_H_
33 33
 
34 34
 #include "fastio_AVR.h"
35 35
 
@@ -717,4 +717,4 @@
717 717
 #define PG5_DDR     DDRG
718 718
 #define PG5_PWM     &OCR0B
719 719
 
720
-#endif // _FASTIO_1281
720
+#endif // _FASTIO_1281_H_

+ 3
- 3
Marlin/src/HAL/HAL_AVR/fastio_168.h View File

@@ -28,8 +28,8 @@
28 28
  *   Marlin   08 09 10 11 12 13 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
29 29
  */
30 30
 
31
-#ifndef _FASTIO_168
32
-#define _FASTIO_168
31
+#ifndef _FASTIO_168_H_
32
+#define _FASTIO_168_H_
33 33
 
34 34
 #include "fastio_AVR.h"
35 35
 
@@ -359,4 +359,4 @@
359 359
 #define PD7_DDR     DDRD
360 360
 #define PD7_PWM     NULL
361 361
 
362
-#endif // _FASTIO_168
362
+#endif // _FASTIO_168_H_

+ 3
- 3
Marlin/src/HAL/HAL_AVR/fastio_644.h View File

@@ -28,8 +28,8 @@
28 28
  *   Marlin   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
29 29
  */
30 30
 
31
-#ifndef _FASTIO_644
32
-#define _FASTIO_644
31
+#ifndef _FASTIO_644_H_
32
+#define _FASTIO_644_H_
33 33
 
34 34
 #include "fastio_AVR.h"
35 35
 
@@ -528,4 +528,4 @@
528 528
 #define PD7_DDR     DDRD
529 529
 #define PD7_PWM     OCR2A
530 530
 
531
-#endif // _FASTIO_644
531
+#endif // _FASTIO_644_H_

+ 3
- 3
Marlin/src/HAL/HAL_AVR/fastio_AT90USB.h View File

@@ -29,8 +29,8 @@
29 29
  *            The pins 46 and 47 are not supported by Teensyduino, but are supported below as E2 and E3
30 30
  */
31 31
 
32
-#ifndef _FASTIO_AT90USB
33
-#define _FASTIO_AT90USB
32
+#ifndef _FASTIO_AT90USB_H_
33
+#define _FASTIO_AT90USB_H_
34 34
 
35 35
 #include "fastio_AVR.h"
36 36
 
@@ -699,4 +699,4 @@
699 699
 #define TIMER3B 4
700 700
 #define TIMER3C 3
701 701
 
702
-#endif // _FASTIO_AT90USB
702
+#endif // _FASTIO_AT90USB_H_

+ 3
- 3
Marlin/src/HAL/HAL_AVR/fastio_AVR.h View File

@@ -26,8 +26,8 @@
26 26
  * Contributed by Triffid_Hunter. Modified by Kliment and the Marlin team.
27 27
  */
28 28
 
29
-#ifndef _FASTIO_ARDUINO_H
30
-#define _FASTIO_ARDUINO_H
29
+#ifndef _FASTIO_ARDUINO_H_
30
+#define _FASTIO_ARDUINO_H_
31 31
 
32 32
 #include <avr/io.h>
33 33
 #include "../../core/macros.h"
@@ -323,4 +323,4 @@ typedef enum {
323 323
 // finally - the macro that tells us if a pin is an available hardware PWM
324 324
 #define USEABLE_HARDWARE_PWM(p) (PWM_PINS(p) && !PWM_CHK(p))
325 325
 
326
-#endif // _FASTIO_ARDUINO_H
326
+#endif // _FASTIO_ARDUINO_H_

+ 3
- 3
Marlin/src/HAL/HAL_AVR/math_AVR.h View File

@@ -20,8 +20,8 @@
20 20
  *
21 21
  */
22 22
 
23
-#ifndef MATH_AVR_H
24
-#define MATH_AVR_H
23
+#ifndef _MATH_AVR_H_
24
+#define _MATH_AVR_H_
25 25
 
26 26
 /**
27 27
  * Optimized math functions for AVR
@@ -109,4 +109,4 @@
109 109
                )
110 110
 
111 111
 
112
-#endif
112
+#endif // _MATH_AVR_H_

+ 4
- 0
Marlin/src/HAL/HAL_AVR/pinsDebug_AVR_8_bit.h View File

@@ -24,6 +24,8 @@
24 24
  * PWM print routines for Atmel 8 bit AVR CPUs
25 25
  */
26 26
 
27
+#ifndef _PINSDEBUG_AVR_8_BIT_
28
+#define _PINSDEBUG_AVR_8_BIT_
27 29
 
28 30
 #define AVR_ATmega2560_FAMILY_PLUS_70 (MOTHERBOARD == BOARD_BQ_ZUM_MEGA_3D \
29 31
 || MOTHERBOARD == BOARD_MIGHTYBOARD_REVE \
@@ -399,3 +401,5 @@ static void pwm_details(uint8_t pin) {
399 401
 #endif
400 402
 
401 403
 #define GET_PIN_INFO(pin) do{}while(0)
404
+
405
+#endif // _PINSDEBUG_AVR_8_BIT_

+ 5
- 0
Marlin/src/HAL/HAL_AVR/pinsDebug_Teensyduino.h View File

@@ -20,6 +20,9 @@
20 20
  *
21 21
  */
22 22
 
23
+#ifndef _PINSDEBUG_TEENSYSUINO_H_
24
+#define _PINSDEBUG_TEENSYSUINO_H_
25
+
23 26
 //
24 27
 //  some of the pin mapping functions of the Teensduino extension to the Arduino IDE
25 28
 //  do not function the same as the other Arduino extensions
@@ -108,3 +111,5 @@ const uint8_t PROGMEM digital_pin_to_port_PGM[] = {
108 111
                                              // disable the PWMs so we can use it as is
109 112
 
110 113
 // portModeRegister(pin) is OK
114
+
115
+#endif // _PINSDEBUG_TEENSYSUINO_H_

+ 3
- 3
Marlin/src/HAL/HAL_AVR/pinsDebug_plus_70.h View File

@@ -25,8 +25,8 @@
25 25
  *  structurs for 2560 family boards that use morre than 70 pins
26 26
  */
27 27
 
28
-#ifndef __PINSDEBUG_PLUS_70_H__
29
-#define __PINSDEBUG_PLUS_70_H__
28
+#ifndef _PINSDEBUG_PLUS_70_H_
29
+#define _PINSDEBUG_PLUS_70_H_
30 30
 
31 31
 #undef NUM_DIGITAL_PINS
32 32
 #if MOTHERBOARD == BOARD_BQ_ZUM_MEGA_3D
@@ -338,4 +338,4 @@ const uint8_t PROGMEM digital_pin_to_timer_PGM_plus_70[] = {
338 338
  */
339 339
 
340 340
 
341
-#endif // __PINSDEBUG_PLUS_70_H__
341
+#endif // _PINSDEBUG_PLUS_70_H_

+ 3
- 3
Marlin/src/HAL/HAL_AVR/spi_pins.h View File

@@ -20,8 +20,8 @@
20 20
  *
21 21
  */
22 22
 
23
-#ifndef SPI_PINS_H_
24
-#define SPI_PINS_H_
23
+#ifndef _SPI_PINS_H_
24
+#define _SPI_PINS_H_
25 25
 
26 26
 /**
27 27
  * Define SPI Pins: SCK, MISO, MOSI, SS
@@ -67,4 +67,4 @@
67 67
 #endif
68 68
 
69 69
 
70
-#endif /* SPI_PINS_H_ */
70
+#endif // _SPI_PINS_H_

+ 3
- 3
Marlin/src/HAL/HAL_AVR/watchdog_AVR.h View File

@@ -20,8 +20,8 @@
20 20
  *
21 21
  */
22 22
 
23
-#ifndef WATCHDOG_AVR_H
24
-#define WATCHDOG_AVR_H
23
+#ifndef _WATCHDOG_AVR_H_
24
+#define _WATCHDOG_AVR_H_
25 25
 
26 26
 #include <avr/wdt.h>
27 27
 
@@ -32,4 +32,4 @@ void watchdog_init();
32 32
 // first watchdog_init or AVR will go into emergency procedures.
33 33
 inline void watchdog_reset() { wdt_reset(); }
34 34
 
35
-#endif // WATCHDOG_AVR_H
35
+#endif // _WATCHDOG_AVR_H_

Loading…
Cancel
Save