Browse Source

Clean up HALs / FastIO (#14082)

pull/1/head
Giuliano Zaro 6 years ago
committed by Scott Lahteine
parent
commit
a74aad3b4a
  1. 6
      Marlin/src/HAL/HAL_AVR/fastio_AVR.h
  2. 15
      Marlin/src/HAL/HAL_DUE/HAL.h
  3. 3
      Marlin/src/HAL/HAL_DUE/fastio_Due.h
  4. 1
      Marlin/src/HAL/HAL_ESP32/fastio_ESP32.h
  5. 15
      Marlin/src/HAL/HAL_LINUX/fastio.h
  6. 5
      Marlin/src/HAL/HAL_LINUX/watchdog.h
  7. 10
      Marlin/src/HAL/HAL_LPC1768/fastio.h
  8. 5
      Marlin/src/HAL/HAL_LPC1768/watchdog.h
  9. 8
      Marlin/src/HAL/HAL_STM32/HAL.h
  10. 4
      Marlin/src/HAL/HAL_STM32/fastio_STM32.h
  11. 15
      Marlin/src/HAL/HAL_STM32F1/HAL.h
  12. 4
      Marlin/src/HAL/HAL_STM32F1/fastio_STM32F1.h
  13. 23
      Marlin/src/HAL/HAL_STM32F4/HAL.h
  14. 4
      Marlin/src/HAL/HAL_STM32F4/fastio_STM32F4.h
  15. 23
      Marlin/src/HAL/HAL_STM32F7/HAL.h
  16. 4
      Marlin/src/HAL/HAL_STM32F7/fastio_STM32F7.h
  17. 24
      Marlin/src/HAL/HAL_TEENSY31_32/HAL.h
  18. 1
      Marlin/src/HAL/HAL_TEENSY31_32/fastio_Teensy.h
  19. 24
      Marlin/src/HAL/HAL_TEENSY35_36/HAL.h
  20. 1
      Marlin/src/HAL/HAL_TEENSY35_36/fastio_Teensy.h
  21. 9
      Marlin/src/HAL/shared/Marduino.h

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

@ -81,9 +81,8 @@
#define _SET_INPUT(IO) CBI(DIO ## IO ## _DDR, DIO ## IO ## _PIN) #define _SET_INPUT(IO) CBI(DIO ## IO ## _DDR, DIO ## IO ## _PIN)
#define _SET_OUTPUT(IO) SBI(DIO ## IO ## _DDR, DIO ## IO ## _PIN) #define _SET_OUTPUT(IO) SBI(DIO ## IO ## _DDR, DIO ## IO ## _PIN)
#define _IS_INPUT(IO) !TEST(DIO ## IO ## _DDR, DIO ## IO ## _PIN) #define _IS_INPUT(IO) !TEST(DIO ## IO ## _DDR, DIO ## IO ## _PIN)
#define _IS_OUTPUT(IO) TEST(DIO ## IO ## _DDR, DIO ## IO ## _PIN) #define _IS_OUTPUT(IO) TEST(DIO ## IO ## _DDR, DIO ## IO ## _PIN)
#define _HAS_TIMER(IO) bool(DIO ## IO ## _PWM)
// digitalRead/Write wrappers // digitalRead/Write wrappers
#ifdef FASTIO_EXT_START #ifdef FASTIO_EXT_START
@ -106,7 +105,6 @@
#define IS_INPUT(IO) _IS_INPUT(IO) #define IS_INPUT(IO) _IS_INPUT(IO)
#define IS_OUTPUT(IO) _IS_OUTPUT(IO) #define IS_OUTPUT(IO) _IS_OUTPUT(IO)
#define HAS_TIMER(IO) _HAS_TIMER(IO)
#define OUT_WRITE(IO,V) do{ SET_OUTPUT(IO); WRITE(IO,V); }while(0) #define OUT_WRITE(IO,V) do{ SET_OUTPUT(IO); WRITE(IO,V); }while(0)
@ -353,5 +351,3 @@ enum ClockSource2 : char {
#else #else
#error "unknown CPU" #error "unknown CPU"
#endif #endif
#define USEABLE_HARDWARE_PWM(P) (PWM_PIN(P) && !PWM_CHK(P))

15
Marlin/src/HAL/HAL_DUE/HAL.h

@ -78,14 +78,6 @@
#undef pgm_read_word #undef pgm_read_word
#define pgm_read_word(addr) (*((uint16_t*)(addr))) #define pgm_read_word(addr) (*((uint16_t*)(addr)))
#define RST_POWER_ON 1
#define RST_EXTERNAL 2
#define RST_BROWN_OUT 4
#define RST_WATCHDOG 8
#define RST_JTAG 16
#define RST_SOFTWARE 32
#define RST_BACKUP 64
typedef int8_t pin_t; typedef int8_t pin_t;
#define HAL_SERVO_LIB Servo #define HAL_SERVO_LIB Servo
@ -143,13 +135,6 @@ inline void HAL_adc_init(void) {}//todo
void HAL_adc_start_conversion(const uint8_t adc_pin); void HAL_adc_start_conversion(const uint8_t adc_pin);
uint16_t HAL_adc_get_result(void); uint16_t HAL_adc_get_result(void);
uint16_t HAL_getAdcReading(uint8_t chan);
void HAL_startAdcConversion(uint8_t chan);
uint8_t HAL_pinToAdcChannel(int pin);
uint16_t HAL_getAdcFreerun(uint8_t chan, bool wait_for_conversion = false);
//uint16_t HAL_getAdcSuperSample(uint8_t chan);
void HAL_enable_AdcFreerun(void);
//void HAL_disable_AdcFreerun(uint8_t chan);
// //
// Pin Map // Pin Map

3
Marlin/src/HAL/HAL_DUE/fastio_Due.h

@ -46,7 +46,6 @@
// Due has 12 PWMs assigned to logical pins 2-13. // Due has 12 PWMs assigned to logical pins 2-13.
// 6, 7, 8 & 9 come from the PWM controller. The others come from the timers. // 6, 7, 8 & 9 come from the PWM controller. The others come from the timers.
#define PWM_PIN(P) WITHIN(P, 2, 13) #define PWM_PIN(P) WITHIN(P, 2, 13)
#define USEABLE_HARDWARE_PWM(P) PWM_PIN(P)
#ifndef MASK #ifndef MASK
#define MASK(PIN) (1 << PIN) #define MASK(PIN) (1 << PIN)
@ -180,8 +179,6 @@
#define IS_INPUT(IO) ((digitalPinToPort(IO)->PIO_OSR & digitalPinToBitMask(IO)) == 0) #define IS_INPUT(IO) ((digitalPinToPort(IO)->PIO_OSR & digitalPinToBitMask(IO)) == 0)
// Check if pin is an output // Check if pin is an output
#define IS_OUTPUT(IO) ((digitalPinToPort(IO)->PIO_OSR & digitalPinToBitMask(IO)) != 0) #define IS_OUTPUT(IO) ((digitalPinToPort(IO)->PIO_OSR & digitalPinToBitMask(IO)) != 0)
// Check if pin is a timer - Must be a constexpr
#define HAS_TIMER(IO) ((IO) >= 2 && (IO) <= 13)
// Shorthand // Shorthand
#define OUT_WRITE(IO,V) { SET_OUTPUT(IO); WRITE(IO,V); } #define OUT_WRITE(IO,V) { SET_OUTPUT(IO); WRITE(IO,V); }

1
Marlin/src/HAL/HAL_ESP32/fastio_ESP32.h

@ -67,7 +67,6 @@
// PWM outputs // PWM outputs
#define PWM_PIN(P) (P < 34) // NOTE Pins >= 34 are input only on ESP32, so they can't be used for output. #define PWM_PIN(P) (P < 34) // NOTE Pins >= 34 are input only on ESP32, so they can't be used for output.
#define USEABLE_HARDWARE_PWM(P) (!IS_I2S_EXPANDER_PIN(P) && PWM_PIN(P))
// Toggle pin value // Toggle pin value
#define TOGGLE(IO) WRITE(IO, !READ(IO)) #define TOGGLE(IO) WRITE(IO, !READ(IO))

15
Marlin/src/HAL/HAL_LINUX/fastio.h

@ -80,16 +80,6 @@
/// check if pin is an output /// check if pin is an output
#define _IS_OUTPUT(IO) (LPC1768_PIN_PIN(IO) >= 0) #define _IS_OUTPUT(IO) (LPC1768_PIN_PIN(IO) >= 0)
// hg42: HAS_TIMER is used only to check if it's a PWM pin
// hg42: we cannot use USEABLE_HARDWARE_PWM because it uses a function that cannot be used statically
// hg42: instead use PWM bit from the #define
/// check if pin is a timer
#define _HAS_TIMER(IO) true // could be LPC1768_PIN_PWM(IO), but there
// hg42: could be this:
// #define _HAS_TIMER(IO) LPC1768_PIN_PWM(IO)
// but this is an incomplete check (12 pins are PWMable, but only 6 can be used at the same time)
/// Read a pin wrapper /// Read a pin wrapper
#define READ(IO) _READ(IO) #define READ(IO) _READ(IO)
@ -116,14 +106,9 @@
/// check if pin is an output wrapper /// check if pin is an output wrapper
#define IS_OUTPUT(IO) _IS_OUTPUT(IO) #define IS_OUTPUT(IO) _IS_OUTPUT(IO)
/// check if pin is a timer (wrapper)
#define HAS_TIMER(IO) _HAS_TIMER(IO)
// Shorthand // Shorthand
#define OUT_WRITE(IO,V) do{ SET_OUTPUT(IO); WRITE(IO,V); }while(0) #define OUT_WRITE(IO,V) do{ SET_OUTPUT(IO); WRITE(IO,V); }while(0)
// digitalRead/Write wrappers // digitalRead/Write wrappers
#define extDigitalRead(IO) digitalRead(IO) #define extDigitalRead(IO) digitalRead(IO)
#define extDigitalWrite(IO,V) digitalWrite(IO,V) #define extDigitalWrite(IO,V) digitalWrite(IO,V)
#define USEABLE_HARDWARE_PWM(P) PWM_PIN(P)

5
Marlin/src/HAL/HAL_LINUX/watchdog.h

@ -21,11 +21,6 @@
*/ */
#pragma once #pragma once
#define RST_POWER_ON 1
#define RST_EXTERNAL 2
#define RST_BROWN_OUT 4
#define RST_WATCHDOG 8
#define WDT_TIMEOUT 4000000 // 4 second timeout #define WDT_TIMEOUT 4000000 // 4 second timeout
void watchdog_init(void); void watchdog_init(void);

10
Marlin/src/HAL/HAL_LPC1768/fastio.h

@ -35,8 +35,7 @@
#include "../shared/Marduino.h" #include "../shared/Marduino.h"
#define PWM_PIN(P) true // all pins are PWM capable #define PWM_PIN(P) true // all pins are PWM capable
#define USEABLE_HARDWARE_PWM(P) PWM_PIN(P)
#define LPC_PIN(pin) gpio_pin(pin) #define LPC_PIN(pin) gpio_pin(pin)
#define LPC_GPIO(port) gpio_port(port) #define LPC_GPIO(port) gpio_port(port)
@ -89,10 +88,6 @@
/// check if pin is an output /// check if pin is an output
#define _IS_OUTPUT(IO) (gpio_get_dir(IO)) #define _IS_OUTPUT(IO) (gpio_get_dir(IO))
/// check if pin is a timer
/// all gpio pins are pwm capable, either interrupt or hardware pwm controlled
#define _HAS_TIMER(IO) true
/// Read a pin wrapper /// Read a pin wrapper
#define READ(IO) _READ(IO) #define READ(IO) _READ(IO)
@ -119,9 +114,6 @@
/// check if pin is an output wrapper /// check if pin is an output wrapper
#define IS_OUTPUT(IO) _IS_OUTPUT(IO) #define IS_OUTPUT(IO) _IS_OUTPUT(IO)
/// check if pin is a timer (wrapper)
#define HAS_TIMER(IO) _HAS_TIMER(IO)
// Shorthand // Shorthand
#define OUT_WRITE(IO,V) do{ SET_OUTPUT(IO); WRITE(IO,V); }while(0) #define OUT_WRITE(IO,V) do{ SET_OUTPUT(IO); WRITE(IO,V); }while(0)

5
Marlin/src/HAL/HAL_LPC1768/watchdog.h

@ -21,11 +21,6 @@
*/ */
#pragma once #pragma once
#define RST_POWER_ON 1
#define RST_EXTERNAL 2
#define RST_BROWN_OUT 4
#define RST_WATCHDOG 8
#define WDT_TIMEOUT 4000000 // 4 second timeout #define WDT_TIMEOUT 4000000 // 4 second timeout
void watchdog_init(void); void watchdog_init(void);

8
Marlin/src/HAL/HAL_STM32/HAL.h

@ -127,14 +127,6 @@
#undef pgm_read_ptr #undef pgm_read_ptr
#define pgm_read_ptr(addr) (*(addr)) #define pgm_read_ptr(addr) (*(addr))
#define RST_POWER_ON 1
#define RST_EXTERNAL 2
#define RST_BROWN_OUT 4
#define RST_WATCHDOG 8
#define RST_JTAG 16
#define RST_SOFTWARE 32
#define RST_BACKUP 64
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
// Types // Types
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------

4
Marlin/src/HAL/HAL_STM32/fastio_STM32.h

@ -80,10 +80,8 @@ void FastIO_init(); // Must be called before using fast io macros
#define IS_INPUT(IO) #define IS_INPUT(IO)
#define IS_OUTPUT(IO) #define IS_OUTPUT(IO)
#define HAS_TIMER(IO) digitalPinHasPWM(IO)
#define PWM_PIN(P) HAS_TIMER(P) #define PWM_PIN(P) digitalPinHasPWM(P)
#define USEABLE_HARDWARE_PWM(P) PWM_PIN(P)
// digitalRead/Write wrappers // digitalRead/Write wrappers
#define extDigitalRead(IO) digitalRead(IO) #define extDigitalRead(IO) digitalRead(IO)

15
Marlin/src/HAL/HAL_STM32F1/HAL.h

@ -253,23 +253,8 @@ void HAL_adc_init(void);
#define HAL_ADC_READY() true #define HAL_ADC_READY() true
void HAL_adc_start_conversion(const uint8_t adc_pin); void HAL_adc_start_conversion(const uint8_t adc_pin);
uint16_t HAL_adc_get_result(void); uint16_t HAL_adc_get_result(void);
/* Todo: Confirm none of this is needed.
uint16_t HAL_getAdcReading(uint8_t chan);
void HAL_startAdcConversion(uint8_t chan);
uint8_t HAL_pinToAdcChannel(int pin);
uint16_t HAL_getAdcFreerun(uint8_t chan, bool wait_for_conversion = false);
//uint16_t HAL_getAdcSuperSample(uint8_t chan);
void HAL_enable_AdcFreerun(void);
//void HAL_disable_AdcFreerun(uint8_t chan);
*/
#define GET_PIN_MAP_PIN(index) index #define GET_PIN_MAP_PIN(index) index
#define GET_PIN_MAP_INDEX(pin) pin #define GET_PIN_MAP_INDEX(pin) pin
#define PARSED_PIN_INDEX(code, dval) parser.intval(code, dval) #define PARSED_PIN_INDEX(code, dval) parser.intval(code, dval)

4
Marlin/src/HAL/HAL_STM32F1/fastio_STM32F1.h

@ -50,10 +50,8 @@
#define IS_INPUT(IO) (_GET_MODE(IO) == GPIO_INPUT_FLOATING || _GET_MODE(IO) == GPIO_INPUT_ANALOG || _GET_MODE(IO) == GPIO_INPUT_PU || _GET_MODE(IO) == GPIO_INPUT_PD) #define IS_INPUT(IO) (_GET_MODE(IO) == GPIO_INPUT_FLOATING || _GET_MODE(IO) == GPIO_INPUT_ANALOG || _GET_MODE(IO) == GPIO_INPUT_PU || _GET_MODE(IO) == GPIO_INPUT_PD)
#define IS_OUTPUT(IO) (_GET_MODE(IO) == GPIO_OUTPUT_PP) #define IS_OUTPUT(IO) (_GET_MODE(IO) == GPIO_OUTPUT_PP)
#define HAS_TIMER(IO) (PIN_MAP[IO].timer_device != nullptr)
#define PWM_PIN(P) HAS_TIMER(P) #define PWM_PIN(P) (PIN_MAP[IO].timer_device != nullptr)
#define USEABLE_HARDWARE_PWM(P) PWM_PIN(P)
// digitalRead/Write wrappers // digitalRead/Write wrappers
#define extDigitalRead(IO) digitalRead(IO) #define extDigitalRead(IO) digitalRead(IO)

23
Marlin/src/HAL/HAL_STM32F4/HAL.h

@ -136,14 +136,6 @@
#undef pgm_read_ptr #undef pgm_read_ptr
#define pgm_read_ptr(addr) (*(addr)) #define pgm_read_ptr(addr) (*(addr))
#define RST_POWER_ON 1
#define RST_EXTERNAL 2
#define RST_BROWN_OUT 4
#define RST_WATCHDOG 8
#define RST_JTAG 16
#define RST_SOFTWARE 32
#define RST_BACKUP 64
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
// Types // Types
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
@ -232,23 +224,8 @@ inline void HAL_adc_init(void) {}
#define HAL_ADC_READY() true #define HAL_ADC_READY() true
void HAL_adc_start_conversion(const uint8_t adc_pin); void HAL_adc_start_conversion(const uint8_t adc_pin);
uint16_t HAL_adc_get_result(void); uint16_t HAL_adc_get_result(void);
/* Todo: Confirm none of this is needed.
uint16_t HAL_getAdcReading(uint8_t chan);
void HAL_startAdcConversion(uint8_t chan);
uint8_t HAL_pinToAdcChannel(int pin);
uint16_t HAL_getAdcFreerun(uint8_t chan, bool wait_for_conversion = false);
//uint16_t HAL_getAdcSuperSample(uint8_t chan);
void HAL_enable_AdcFreerun(void);
//void HAL_disable_AdcFreerun(uint8_t chan);
*/
#define GET_PIN_MAP_PIN(index) index #define GET_PIN_MAP_PIN(index) index
#define GET_PIN_MAP_INDEX(pin) pin #define GET_PIN_MAP_INDEX(pin) pin
#define PARSED_PIN_INDEX(code, dval) parser.intval(code, dval) #define PARSED_PIN_INDEX(code, dval) parser.intval(code, dval)

4
Marlin/src/HAL/HAL_STM32F4/fastio_STM32F4.h

@ -50,10 +50,8 @@
#define IS_INPUT(IO) #define IS_INPUT(IO)
#define IS_OUTPUT(IO) #define IS_OUTPUT(IO)
#define HAS_TIMER(IO) true
#define PWM_PIN(P) HAS_TIMER(P) #define PWM_PIN(P) true
#define USEABLE_HARDWARE_PWM(P) PWM_PIN(P)
// digitalRead/Write wrappers // digitalRead/Write wrappers
#define extDigitalRead(IO) digitalRead(IO) #define extDigitalRead(IO) digitalRead(IO)

23
Marlin/src/HAL/HAL_STM32F7/HAL.h

@ -125,14 +125,6 @@
#undef pgm_read_ptr #undef pgm_read_ptr
#define pgm_read_ptr(addr) (*(addr)) #define pgm_read_ptr(addr) (*(addr))
#define RST_POWER_ON 1
#define RST_EXTERNAL 2
#define RST_BROWN_OUT 4
#define RST_WATCHDOG 8
#define RST_JTAG 16
#define RST_SOFTWARE 32
#define RST_BACKUP 64
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
// Types // Types
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
@ -211,23 +203,8 @@ inline void HAL_adc_init(void) {}
#define HAL_ADC_READY() true #define HAL_ADC_READY() true
void HAL_adc_start_conversion(const uint8_t adc_pin); void HAL_adc_start_conversion(const uint8_t adc_pin);
uint16_t HAL_adc_get_result(void); uint16_t HAL_adc_get_result(void);
/* Todo: Confirm none of this is needed.
uint16_t HAL_getAdcReading(uint8_t chan);
void HAL_startAdcConversion(uint8_t chan);
uint8_t HAL_pinToAdcChannel(int pin);
uint16_t HAL_getAdcFreerun(uint8_t chan, bool wait_for_conversion = false);
//uint16_t HAL_getAdcSuperSample(uint8_t chan);
void HAL_enable_AdcFreerun(void);
//void HAL_disable_AdcFreerun(uint8_t chan);
*/
#define GET_PIN_MAP_PIN(index) index #define GET_PIN_MAP_PIN(index) index
#define GET_PIN_MAP_INDEX(pin) pin #define GET_PIN_MAP_INDEX(pin) pin
#define PARSED_PIN_INDEX(code, dval) parser.intval(code, dval) #define PARSED_PIN_INDEX(code, dval) parser.intval(code, dval)

4
Marlin/src/HAL/HAL_STM32F7/fastio_STM32F7.h

@ -49,10 +49,8 @@
#define IS_INPUT(IO) #define IS_INPUT(IO)
#define IS_OUTPUT(IO) #define IS_OUTPUT(IO)
#define HAS_TIMER(IO) true
#define PWM_PIN(P) HAS_TIMER(P) #define PWM_PIN(P) true
#define USEABLE_HARDWARE_PWM(P) PWM_PIN(P)
// digitalRead/Write wrappers // digitalRead/Write wrappers
#define extDigitalRead(IO) digitalRead(IO) #define extDigitalRead(IO) digitalRead(IO)

24
Marlin/src/HAL/HAL_TEENSY31_32/HAL.h

@ -89,14 +89,6 @@ typedef int8_t pin_t;
#undef pgm_read_word #undef pgm_read_word
#define pgm_read_word(addr) (*((uint16_t*)(addr))) #define pgm_read_word(addr) (*((uint16_t*)(addr)))
#define RST_POWER_ON 1
#define RST_EXTERNAL 2
#define RST_BROWN_OUT 4
#define RST_WATCHDOG 8
#define RST_JTAG 16
#define RST_SOFTWARE 32
#define RST_BACKUP 64
// Clear the reset reason // Clear the reset reason
void HAL_clear_reset_source(void); void HAL_clear_reset_source(void);
@ -128,25 +120,11 @@ void HAL_adc_init();
#define HAL_READ_ADC() HAL_adc_get_result() #define HAL_READ_ADC() HAL_adc_get_result()
#define HAL_ADC_READY() true #define HAL_ADC_READY() true
#define HAL_ANALOG_SELECT(pin) NOOP; #define HAL_ANALOG_SELECT(pin)
void HAL_adc_start_conversion(const uint8_t adc_pin); void HAL_adc_start_conversion(const uint8_t adc_pin);
uint16_t HAL_adc_get_result(void); uint16_t HAL_adc_get_result(void);
/*
uint16_t HAL_getAdcReading(uint8_t chan);
void HAL_startAdcConversion(uint8_t chan);
uint8_t HAL_pinToAdcChannel(int pin);
uint16_t HAL_getAdcFreerun(uint8_t chan, bool wait_for_conversion = false);
//uint16_t HAL_getAdcSuperSample(uint8_t chan);
void HAL_enable_AdcFreerun(void);
//void HAL_disable_AdcFreerun(uint8_t chan);
*/
#define GET_PIN_MAP_PIN(index) index #define GET_PIN_MAP_PIN(index) index
#define GET_PIN_MAP_INDEX(pin) pin #define GET_PIN_MAP_INDEX(pin) pin
#define PARSED_PIN_INDEX(code, dval) parser.intval(code, dval) #define PARSED_PIN_INDEX(code, dval) parser.intval(code, dval)

1
Marlin/src/HAL/HAL_TEENSY31_32/fastio_Teensy.h

@ -91,7 +91,6 @@
#define extDigitalWrite(IO,V) digitalWrite(IO,V) #define extDigitalWrite(IO,V) digitalWrite(IO,V)
#define PWM_PIN(P) digitalPinHasPWM(P) #define PWM_PIN(P) digitalPinHasPWM(P)
#define USEABLE_HARDWARE_PWM(P) PWM_PIN(P)
/** /**
* Ports, functions, and pins * Ports, functions, and pins

24
Marlin/src/HAL/HAL_TEENSY35_36/HAL.h

@ -97,14 +97,6 @@ typedef int8_t pin_t;
#undef pgm_read_word #undef pgm_read_word
#define pgm_read_word(addr) (*((uint16_t*)(addr))) #define pgm_read_word(addr) (*((uint16_t*)(addr)))
#define RST_POWER_ON 1
#define RST_EXTERNAL 2
#define RST_BROWN_OUT 4
#define RST_WATCHDOG 8
#define RST_JTAG 16
#define RST_SOFTWARE 32
#define RST_BACKUP 64
/** clear reset reason */ /** clear reset reason */
void HAL_clear_reset_source(void); void HAL_clear_reset_source(void);
@ -133,25 +125,11 @@ void HAL_adc_init();
#define HAL_READ_ADC() HAL_adc_get_result() #define HAL_READ_ADC() HAL_adc_get_result()
#define HAL_ADC_READY() true #define HAL_ADC_READY() true
#define HAL_ANALOG_SELECT(pin) NOOP; #define HAL_ANALOG_SELECT(pin)
void HAL_adc_start_conversion(const uint8_t adc_pin); void HAL_adc_start_conversion(const uint8_t adc_pin);
uint16_t HAL_adc_get_result(void); uint16_t HAL_adc_get_result(void);
/*
uint16_t HAL_getAdcReading(uint8_t chan);
void HAL_startAdcConversion(uint8_t chan);
uint8_t HAL_pinToAdcChannel(int pin);
uint16_t HAL_getAdcFreerun(uint8_t chan, bool wait_for_conversion = false);
//uint16_t HAL_getAdcSuperSample(uint8_t chan);
void HAL_enable_AdcFreerun(void);
//void HAL_disable_AdcFreerun(uint8_t chan);
*/
#define GET_PIN_MAP_PIN(index) index #define GET_PIN_MAP_PIN(index) index
#define GET_PIN_MAP_INDEX(pin) pin #define GET_PIN_MAP_INDEX(pin) pin
#define PARSED_PIN_INDEX(code, dval) parser.intval(code, dval) #define PARSED_PIN_INDEX(code, dval) parser.intval(code, dval)

1
Marlin/src/HAL/HAL_TEENSY35_36/fastio_Teensy.h

@ -90,7 +90,6 @@
#define extDigitalWrite(IO,V) digitalWrite(IO,V) #define extDigitalWrite(IO,V) digitalWrite(IO,V)
#define PWM_PIN(P) digitalPinHasPWM(P) #define PWM_PIN(P) digitalPinHasPWM(P)
#define USEABLE_HARDWARE_PWM(P) PWM_PIN(P)
/** /**
* Ports, functions, and pins * Ports, functions, and pins

9
Marlin/src/HAL/shared/Marduino.h

@ -55,3 +55,12 @@
//#define strchr_P(s,c) strchr(s,c) //#define strchr_P(s,c) strchr(s,c)
#endif #endif
#endif #endif
// Restart causes
#define RST_POWER_ON 1
#define RST_EXTERNAL 2
#define RST_BROWN_OUT 4
#define RST_WATCHDOG 8
#define RST_JTAG 16
#define RST_SOFTWARE 32
#define RST_BACKUP 64

Loading…
Cancel
Save