Browse Source

Merge pull request #7723 from fiveangle/bf20-improve_avr_arch_detection

[bf20ng] Improve AVR arch detection
pull/1/head
Scott Lahteine 7 years ago
committed by GitHub
parent
commit
1ab679b1d2
  1. 4
      Marlin/src/HAL/HAL.h
  2. 4
      Marlin/src/HAL/HAL_AVR/HAL_AVR.cpp
  3. 2
      Marlin/src/HAL/HAL_AVR/HAL_AVR.h
  4. 6
      Marlin/src/HAL/HAL_AVR/HAL_spi_AVR.cpp
  5. 2
      Marlin/src/HAL/HAL_AVR/MarlinSerial.cpp
  6. 4
      Marlin/src/HAL/HAL_AVR/persistent_store_impl.cpp
  7. 4
      Marlin/src/HAL/HAL_AVR/servo_AVR.cpp
  8. 4
      Marlin/src/HAL/HAL_AVR/watchdog_AVR.cpp
  9. 2
      Marlin/src/HAL/HAL_DUE/persistent_store_impl.cpp
  10. 2
      Marlin/src/HAL/HAL_SanityCheck.h
  11. 2
      Marlin/src/HAL/HAL_endstop_interrupts.h
  12. 2
      Marlin/src/HAL/HAL_pinsDebug.h
  13. 2
      Marlin/src/HAL/HAL_spi_pins.h
  14. 2
      Marlin/src/HAL/servo.h
  15. 2
      Marlin/src/HAL/servo_private.h
  16. 2
      Marlin/src/core/serial.h
  17. 2
      Marlin/src/inc/MarlinConfig.h
  18. 2
      Marlin/src/module/delta.cpp
  19. 2
      Marlin/src/module/delta.h
  20. 4
      Marlin/src/module/stepper.cpp
  21. 2
      Marlin/src/module/stepper.h
  22. 2
      Marlin/src/module/temperature.cpp

4
Marlin/src/HAL/HAL.h

@ -23,7 +23,7 @@
*
* Supports platforms :
* ARDUINO_ARCH_SAM : For Arduino Due and other boards based on Atmel SAM3X8E
* ARDUINO_ARCH_AVR : For all Atmel AVR boards
* __AVR__ : For all Atmel AVR boards
*/
#ifndef _HAL_H
@ -77,7 +77,7 @@ void spiRead(uint8_t* buf, uint16_t nbyte);
/** Write token and then write from 512 byte buffer to SPI (for SD card) */
void spiSendBlock(uint8_t token, const uint8_t* buf);
#ifdef ARDUINO_ARCH_AVR
#ifdef __AVR__
#include "HAL_AVR/HAL_AVR.h"
#elif defined(ARDUINO_ARCH_SAM)
#define CPU_32_BIT

4
Marlin/src/HAL/HAL_AVR/HAL_AVR.cpp

@ -23,11 +23,11 @@
/**
* Description: HAL for AVR
*
* For ARDUINO_ARCH_AVR
* For __AVR__
*/
#ifdef ARDUINO_ARCH_AVR
#ifdef __AVR__
// --------------------------------------------------------------------------
// Includes

2
Marlin/src/HAL/HAL_AVR/HAL_AVR.h

@ -22,7 +22,7 @@
/**
* Description: HAL for AVR
*
* For ARDUINO_ARCH_AVR
* For __AVR__
*/

6
Marlin/src/HAL/HAL_AVR/HAL_spi_AVR.cpp

@ -28,10 +28,10 @@
/**
* Description: HAL for AVR - SPI functions
*
* For ARDUINO_ARCH_AVR
* For __AVR__
*/
#ifdef ARDUINO_ARCH_AVR
#ifdef __AVR__
// --------------------------------------------------------------------------
// Includes
@ -210,4 +210,4 @@ void spiBegin (void) {
#endif // SOFTWARE_SPI
#endif // ARDUINO_ARCH_AVR
#endif // __AVR__

2
Marlin/src/HAL/HAL_AVR/MarlinSerial.cpp

@ -28,7 +28,7 @@
* Modified 28 September 2010 by Mark Sproul
* Modified 14 February 2016 by Andreas Hardtung (added tx buffer)
*/
#ifdef ARDUINO_ARCH_AVR
#ifdef __AVR__
#include "MarlinSerial.h"
#include "../../Marlin.h"

4
Marlin/src/HAL/HAL_AVR/persistent_store_impl.cpp

@ -1,4 +1,4 @@
#ifdef ARDUINO_ARCH_AVR
#ifdef __AVR__
#include "../persistent_store_api.h"
@ -52,4 +52,4 @@ void read_data(int &pos, uint8_t* value, uint16_t size, uint16_t *crc) {
}
#endif // EEPROM_SETTINGS
#endif // ARDUINO_ARCH_AVR
#endif // __AVR__

4
Marlin/src/HAL/HAL_AVR/servo_AVR.cpp

@ -51,7 +51,7 @@
*
*/
#ifdef ARDUINO_ARCH_AVR
#ifdef __AVR__
#include "../../inc/MarlinConfig.h"
@ -215,4 +215,4 @@ void finISR(timer16_Sequence_t timer) {
#endif // HAS_SERVOS
#endif // ARDUINO_ARCH_AVR
#endif // __AVR__

4
Marlin/src/HAL/HAL_AVR/watchdog_AVR.cpp

@ -20,7 +20,7 @@
*
*/
#ifdef ARDUINO_ARCH_AVR
#ifdef __AVR__
#include "../../inc/MarlinConfig.h"
@ -58,4 +58,4 @@ void watchdog_init() {
#endif // WATCHDOG_RESET_MANUAL
#endif // USE_WATCHDOG
#endif // ARDUINO_ARCH_AVR
#endif // __AVR__

2
Marlin/src/HAL/HAL_DUE/persistent_store_impl.cpp

@ -52,4 +52,4 @@ void read_data(int &pos, uint8_t* value, uint16_t size, uint16_t *crc) {
}
#endif // EEPROM_SETTINGS
#endif // ARDUINO_ARCH_AVR
#endif // __AVR__

2
Marlin/src/HAL/HAL_SanityCheck.h

@ -22,7 +22,7 @@
#ifndef HAL_SANITYCHECK_H
#ifdef ARDUINO_ARCH_AVR
#ifdef __AVR__
#include "HAL_AVR/SanityCheck_AVR_8_bit.h"
#elif defined(ARDUINO_ARCH_SAM)
#include "HAL_DUE/SanityCheck_Due.h"

2
Marlin/src/HAL/HAL_endstop_interrupts.h

@ -34,7 +34,7 @@ FORCE_INLINE void endstop_ISR_worker( void ) {
// One ISR for all EXT-Interrupts
void endstop_ISR(void) { endstop_ISR_worker(); }
#ifdef ARDUINO_ARCH_AVR
#ifdef __AVR__
#include "HAL_AVR/endstop_interrupts.h"

2
Marlin/src/HAL/HAL_pinsDebug.h

@ -23,7 +23,7 @@
#ifndef HAL_PINSDEBUG_H
#define HAL_PINSDEBUG_H
#ifdef ARDUINO_ARCH_AVR
#ifdef __AVR__
#include "HAL_AVR/pinsDebug_AVR_8_bit.h"
#elif defined(ARDUINO_ARCH_SAM)
#include "HAL_DUE/HAL_pinsDebug_Due.h"

2
Marlin/src/HAL/HAL_spi_pins.h

@ -29,7 +29,7 @@
#elif defined(IS_32BIT_TEENSY)
#include "HAL_TEENSY35_36/spi_pins.h"
#elif defined(ARDUINO_ARCH_AVR)
#elif defined(__AVR__)
#include "HAL_AVR/spi_pins.h"
#elif defined(TARGET_LPC1768)

2
Marlin/src/HAL/servo.h

@ -78,7 +78,7 @@
#else
#include <stdint.h>
#if defined(ARDUINO_ARCH_AVR) || defined(ARDUINO_ARCH_SAM)
#if defined(__AVR__) || defined(ARDUINO_ARCH_SAM)
// we're good to go
#else
#error "This library only supports boards with an AVR or SAM3X processor."

2
Marlin/src/HAL/servo_private.h

@ -45,7 +45,7 @@
#include <stdint.h>
// Architecture specific include
#ifdef ARDUINO_ARCH_AVR
#ifdef __AVR__
#include "HAL_AVR/ServoTimers.h"
#elif defined(ARDUINO_ARCH_SAM)
#include "HAL_DUE/ServoTimers.h"

2
Marlin/src/core/serial.h

@ -27,7 +27,7 @@
//todo: HAL: breaks encapsulation
// For AVR only, define a serial interface based on configuration
#ifdef ARDUINO_ARCH_AVR
#ifdef __AVR__
#ifdef USBCON
#include "HardwareSerial.h"
#if ENABLED(BLUETOOTH)

2
Marlin/src/inc/MarlinConfig.h

@ -31,7 +31,7 @@
#include "../../Configuration_adv.h"
#include "../HAL/HAL.h"
#include "../pins/pins.h"
#if defined(ARDUINO_ARCH_AVR) && !defined(USBCON)
#if defined(__AVR__) && !defined(USBCON)
#define HardwareSerial_h // trick to disable the standard HWserial
#endif
#include "Conditionals_post.h"

2
Marlin/src/module/delta.cpp

@ -88,7 +88,7 @@ void recalc_delta_settings(float radius, float diagonal_rod) {
* (see above)
*/
#if ENABLED(DELTA_FAST_SQRT) && defined(ARDUINO_ARCH_AVR)
#if ENABLED(DELTA_FAST_SQRT) && defined(__AVR__)
/**
* Fast inverse sqrt from Quake III Arena
* See: https://en.wikipedia.org/wiki/Fast_inverse_square_root

2
Marlin/src/module/delta.h

@ -63,7 +63,7 @@ void recalc_delta_settings(float radius, float diagonal_rod);
* (see above)
*/
#if ENABLED(DELTA_FAST_SQRT) && defined(ARDUINO_ARCH_AVR)
#if ENABLED(DELTA_FAST_SQRT) && defined(__AVR__)
/**
* Fast inverse sqrt from Quake III Arena
* See: https://en.wikipedia.org/wiki/Fast_inverse_square_root

4
Marlin/src/module/stepper.cpp

@ -46,7 +46,7 @@
#include "stepper.h"
#ifdef ARDUINO_ARCH_AVR
#ifdef __AVR__
#include "speed_lookuptable.h"
#endif
@ -1139,7 +1139,7 @@ void Stepper::init() {
E_AXIS_INIT(4);
#endif
#ifdef ARDUINO_ARCH_AVR
#ifdef __AVR__
// waveform generation = 0100 = CTC
SET_WGM(1, CTC_OCRnA);

2
Marlin/src/module/stepper.h

@ -45,7 +45,7 @@
#include "stepper_indirection.h"
#ifdef ARDUINO_ARCH_AVR
#ifdef __AVR__
#include "speed_lookuptable.h"
#endif

2
Marlin/src/module/temperature.cpp

@ -1081,7 +1081,7 @@ void Temperature::init() {
#endif
// todo: HAL: fix abstraction
#ifdef ARDUINO_ARCH_AVR
#ifdef __AVR__
// Use timer0 for temperature measurement
// Interleave temperature interrupt with millies interrupt
OCR0B = 128;

Loading…
Cancel
Save