Browse Source

Fix some AVR HAL code style

pull/1/head
Scott Lahteine 7 years ago
parent
commit
fd128b3c93
  1. 11
      Marlin/src/HAL/HAL_AVR/HAL_AVR.h
  2. 5
      Marlin/src/HAL/HAL_AVR/HAL_pinsDebug_AVR.h
  3. 6
      Marlin/src/HAL/HAL_AVR/MarlinSerial.h
  4. 13
      Marlin/src/HAL/HAL_AVR/SanityCheck_AVR_8_bit.h
  5. 9
      Marlin/src/HAL/HAL_AVR/ServoTimers.h
  6. 6
      Marlin/src/HAL/HAL_AVR/fastio_1280.h
  7. 6
      Marlin/src/HAL/HAL_AVR/fastio_1281.h
  8. 6
      Marlin/src/HAL/HAL_AVR/fastio_168.h
  9. 6
      Marlin/src/HAL/HAL_AVR/fastio_644.h
  10. 6
      Marlin/src/HAL/HAL_AVR/fastio_AT90USB.h
  11. 6
      Marlin/src/HAL/HAL_AVR/fastio_AVR.h
  12. 6
      Marlin/src/HAL/HAL_AVR/math_AVR.h
  13. 4
      Marlin/src/HAL/HAL_AVR/pinsDebug_AVR_8_bit.h
  14. 5
      Marlin/src/HAL/HAL_AVR/pinsDebug_Teensyduino.h
  15. 6
      Marlin/src/HAL/HAL_AVR/pinsDebug_plus_70.h
  16. 6
      Marlin/src/HAL/HAL_AVR/spi_pins.h
  17. 6
      Marlin/src/HAL/HAL_AVR/watchdog_AVR.h

11
Marlin/src/HAL/HAL_AVR/HAL_AVR.h

@ -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_

5
Marlin/src/HAL/HAL_AVR/HAL_pinsDebug_AVR.h

@ -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_

6
Marlin/src/HAL/HAL_AVR/MarlinSerial.h

@ -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_

13
Marlin/src/HAL/HAL_AVR/SanityCheck_AVR_8_bit.h

@ -20,15 +20,13 @@
*
*/
/**
* Test AVR specific configuration values for errors at compile-time.
*/
#ifndef _SANITYCHECK_AVR_8_BIT_H_
#define _SANITYCHECK_AVR_8_BIT_H_
/**
* Require gcc 4.7 or newer (first included with Arduino 1.6.8) for C++11 features.
* Test AVR specific configuration values for errors at compile-time.
*/
/**
* 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_

9
Marlin/src/HAL/HAL_AVR/ServoTimers.h

@ -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_

6
Marlin/src/HAL/HAL_AVR/fastio_1280.h

@ -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_

6
Marlin/src/HAL/HAL_AVR/fastio_1281.h

@ -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_

6
Marlin/src/HAL/HAL_AVR/fastio_168.h

@ -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_

6
Marlin/src/HAL/HAL_AVR/fastio_644.h

@ -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_

6
Marlin/src/HAL/HAL_AVR/fastio_AT90USB.h

@ -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_

6
Marlin/src/HAL/HAL_AVR/fastio_AVR.h

@ -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_

6
Marlin/src/HAL/HAL_AVR/math_AVR.h

@ -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_

4
Marlin/src/HAL/HAL_AVR/pinsDebug_AVR_8_bit.h

@ -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_

5
Marlin/src/HAL/HAL_AVR/pinsDebug_Teensyduino.h

@ -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_

6
Marlin/src/HAL/HAL_AVR/pinsDebug_plus_70.h

@ -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_

6
Marlin/src/HAL/HAL_AVR/spi_pins.h

@ -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_

6
Marlin/src/HAL/HAL_AVR/watchdog_AVR.h

@ -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_

Loading…
Cancel
Save