Fix some AVR HAL code style

This commit is contained in:
Scott Lahteine 2017-10-14 19:05:10 -05:00
parent 799360c576
commit fd128b3c93
17 changed files with 60 additions and 53 deletions

View File

@ -26,8 +26,8 @@
*/
#ifndef _HAL_AVR_H
#define _HAL_AVR_H
#ifndef _HAL_AVR_H_
#define _HAL_AVR_H_
// --------------------------------------------------------------------------
// Includes
@ -153,9 +153,4 @@ inline void HAL_adc_init(void) {
#define HAL_READ_ADC ADC
// --------------------------------------------------------------------------
//
// --------------------------------------------------------------------------
#endif // _HAL_AVR_H
#endif // _HAL_AVR_H_

View File

@ -20,7 +20,8 @@
*
*/
#ifndef HAL_PINSDEBUG_AVR_H
#ifndef _HAL_PINSDEBUG_AVR_H_
#define _HAL_PINSDEBUG_AVR_H_
void HAL_print_analog_pin(char buffer[], int8_t pin) {
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
}
}
#endif //HAL_PINSDEBUG_AVR_H
#endif // _HAL_PINSDEBUG_AVR_H_

View File

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

View File

@ -20,15 +20,13 @@
*
*/
#ifndef _SANITYCHECK_AVR_8_BIT_H_
#define _SANITYCHECK_AVR_8_BIT_H_
/**
* Test AVR specific configuration values for errors at compile-time.
*/
/**
* Require gcc 4.7 or newer (first included with Arduino 1.6.8) for C++11 features.
*/
/**
* Digipot requirement
*/
@ -39,12 +37,9 @@
#endif
#endif
/**
* Sanity checks for Spindle / Laser
*/
#if ENABLED(SPINDLE_LASER_ENABLE)
#if !PIN_EXISTS(SPINDLE_LASER_ENABLE)
#error "SPINDLE_LASER_ENABLE requires SPINDLE_LASER_ENABLE_PIN."
@ -100,3 +95,5 @@
#endif
#endif
#endif // SPINDLE_LASER_ENABLE
#endif // _SANITYCHECK_AVR_8_BIT_H_

View File

@ -21,7 +21,7 @@
*/
/*
Servo.h - Interrupt driven Servo library for Arduino using 16 bit timers- Version 2
ServoTimers.h - Interrupt driven Servo library for Arduino using 16 bit timers- Version 2
Copyright (c) 2009 Michael Margolis. All right reserved.
This library is free software; you can redistribute it and/or
@ -39,7 +39,10 @@
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
*
* If _useTimerX is defined then TimerX is a 16 bit timer on the current board
@ -88,3 +91,5 @@ typedef enum {
#endif
_Nbr_16timers
} timer16_Sequence_t;
#endif // _SERVOTIMERS_H_

View File

@ -28,8 +28,8 @@
* 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
*/
#ifndef _FASTIO_1280
#define _FASTIO_1280
#ifndef _FASTIO_1280_H_
#define _FASTIO_1280_H_
#include "fastio_AVR.h"
@ -1112,4 +1112,4 @@
#define PL7_DDR DDRL
#define PL7_PWM NULL
#endif // _FASTIO_1280
#endif // _FASTIO_1280_H_

View File

@ -28,8 +28,8 @@
* 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
*/
#ifndef _FASTIO_1281
#define _FASTIO_1281
#ifndef _FASTIO_1281_H_
#define _FASTIO_1281_H_
#include "fastio_AVR.h"
@ -717,4 +717,4 @@
#define PG5_DDR DDRG
#define PG5_PWM &OCR0B
#endif // _FASTIO_1281
#endif // _FASTIO_1281_H_

View File

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

View File

@ -28,8 +28,8 @@
* 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
*/
#ifndef _FASTIO_644
#define _FASTIO_644
#ifndef _FASTIO_644_H_
#define _FASTIO_644_H_
#include "fastio_AVR.h"
@ -528,4 +528,4 @@
#define PD7_DDR DDRD
#define PD7_PWM OCR2A
#endif // _FASTIO_644
#endif // _FASTIO_644_H_

View File

@ -29,8 +29,8 @@
* The pins 46 and 47 are not supported by Teensyduino, but are supported below as E2 and E3
*/
#ifndef _FASTIO_AT90USB
#define _FASTIO_AT90USB
#ifndef _FASTIO_AT90USB_H_
#define _FASTIO_AT90USB_H_
#include "fastio_AVR.h"
@ -699,4 +699,4 @@
#define TIMER3B 4
#define TIMER3C 3
#endif // _FASTIO_AT90USB
#endif // _FASTIO_AT90USB_H_

View File

@ -26,8 +26,8 @@
* Contributed by Triffid_Hunter. Modified by Kliment and the Marlin team.
*/
#ifndef _FASTIO_ARDUINO_H
#define _FASTIO_ARDUINO_H
#ifndef _FASTIO_ARDUINO_H_
#define _FASTIO_ARDUINO_H_
#include <avr/io.h>
#include "../../core/macros.h"
@ -323,4 +323,4 @@ typedef enum {
// 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
#endif // _FASTIO_ARDUINO_H_

View File

@ -20,8 +20,8 @@
*
*/
#ifndef MATH_AVR_H
#define MATH_AVR_H
#ifndef _MATH_AVR_H_
#define _MATH_AVR_H_
/**
* Optimized math functions for AVR
@ -109,4 +109,4 @@
)
#endif
#endif // _MATH_AVR_H_

View File

@ -24,6 +24,8 @@
* PWM print routines for Atmel 8 bit AVR CPUs
*/
#ifndef _PINSDEBUG_AVR_8_BIT_
#define _PINSDEBUG_AVR_8_BIT_
#define AVR_ATmega2560_FAMILY_PLUS_70 (MOTHERBOARD == BOARD_BQ_ZUM_MEGA_3D \
|| MOTHERBOARD == BOARD_MIGHTYBOARD_REVE \
@ -399,3 +401,5 @@ static void pwm_details(uint8_t pin) {
#endif
#define GET_PIN_INFO(pin) do{}while(0)
#endif // _PINSDEBUG_AVR_8_BIT_

View File

@ -20,6 +20,9 @@
*
*/
#ifndef _PINSDEBUG_TEENSYSUINO_H_
#define _PINSDEBUG_TEENSYSUINO_H_
//
// some of the pin mapping functions of the Teensduino extension to the Arduino IDE
// do not function the same as the other Arduino extensions
@ -108,3 +111,5 @@ 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

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

View File

@ -20,8 +20,8 @@
*
*/
#ifndef SPI_PINS_H_
#define SPI_PINS_H_
#ifndef _SPI_PINS_H_
#define _SPI_PINS_H_
/**
* Define SPI Pins: SCK, MISO, MOSI, SS
@ -67,4 +67,4 @@
#endif
#endif /* SPI_PINS_H_ */
#endif // _SPI_PINS_H_

View File

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