Browse Source

Pulldown for all FastIO headers

Co-Authored-By: borsegbr <borsegbr@users.noreply.github.com>
vanilla_fb_2.0.x
Scott Lahteine 5 years ago
parent
commit
96ab16a9dd
  1. 4
      Marlin/src/HAL/AVR/fastio.h
  2. 2
      Marlin/src/HAL/DUE/fastio.h
  3. 2
      Marlin/src/HAL/ESP32/fastio.h
  4. 2
      Marlin/src/HAL/LPC1768/fastio.h
  5. 4
      Marlin/src/HAL/SAMD51/fastio.h
  6. 3
      Marlin/src/HAL/TEENSY31_32/fastio.h
  7. 3
      Marlin/src/HAL/TEENSY35_36/fastio.h
  8. 7
      Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/compat.h

4
Marlin/src/HAL/AVR/fastio.h

@ -98,9 +98,9 @@
#define SET_INPUT(IO) _SET_INPUT(IO)
#define SET_INPUT_PULLUP(IO) do{ _SET_INPUT(IO); _WRITE(IO, HIGH); }while(0)
#define SET_INPUT_PULLDOWN SET_INPUT
#define SET_OUTPUT(IO) _SET_OUTPUT(IO)
#define SET_PWM(IO) SET_OUTPUT(IO)
#define SET_PWM SET_OUTPUT
#define IS_INPUT(IO) _IS_INPUT(IO)
#define IS_OUTPUT(IO) _IS_OUTPUT(IO)

2
Marlin/src/HAL/DUE/fastio.h

@ -166,7 +166,7 @@
// Set pin as output (wrapper) - reads the pin and sets the output to that value
#define SET_OUTPUT(IO) _SET_OUTPUT(IO)
// Set pin as PWM
#define SET_PWM(IO) SET_OUTPUT(IO)
#define SET_PWM SET_OUTPUT
// Check if pin is an input
#define IS_INPUT(IO) ((digitalPinToPort(IO)->PIO_OSR & digitalPinToBitMask(IO)) == 0)

2
Marlin/src/HAL/ESP32/fastio.h

@ -56,7 +56,7 @@
#define SET_OUTPUT(IO) do{ _SET_OUTPUT(IO); }while(0)
// Set pin as PWM
#define SET_PWM(IO) SET_OUTPUT(IO)
#define SET_PWM SET_OUTPUT
// Set pin as output and init
#define OUT_WRITE(IO,V) do{ _SET_OUTPUT(IO); WRITE(IO,V); }while(0)

2
Marlin/src/HAL/LPC1768/fastio.h

@ -104,7 +104,7 @@
/// set pin as output wrapper - reads the pin and sets the output to that value
#define SET_OUTPUT(IO) do{ _WRITE(IO, _READ(IO)); _SET_OUTPUT(IO); }while(0)
// set pin as PWM
#define SET_PWM(IO) SET_OUTPUT(IO)
#define SET_PWM SET_OUTPUT
/// check if pin is an input wrapper
#define IS_INPUT(IO) _IS_INPUT(IO)

4
Marlin/src/HAL/SAMD51/fastio.h

@ -100,9 +100,9 @@
PORT->Group[port].DIRCLR.reg = MASK(pin); \
}while(0)
// Set pin as PWM (push pull)
#define SET_PWM(IO) SET_OUTPUT(IO)
#define SET_PWM SET_OUTPUT
// Set pin as PWM (open drain)
#define SET_PWM_OD(IO) SET_OUTPUT_OD(IO)
#define SET_PWM_OD SET_OUTPUT_OD
// check if pin is an output
#define IS_OUTPUT(IO) ((PORT->Group[(EPortType)GET_SAMD_PORT(IO)].DIR.reg & MASK(GET_SAMD_PIN(IO))) \

3
Marlin/src/HAL/TEENSY31_32/fastio.h

@ -76,8 +76,9 @@
#define SET_INPUT(IO) _SET_INPUT(IO)
#define SET_INPUT_PULLUP(IO) _SET_INPUT_PULLUP(IO)
#define SET_INPUT_PULLDOWN SET_INPUT
#define SET_OUTPUT(IO) _SET_OUTPUT(IO)
#define SET_PWM(IO) SET_OUTPUT(IO)
#define SET_PWM SET_OUTPUT
#define IS_INPUT(IO) _IS_INPUT(IO)
#define IS_OUTPUT(IO) _IS_OUTPUT(IO)

3
Marlin/src/HAL/TEENSY35_36/fastio.h

@ -76,8 +76,9 @@
#define SET_INPUT(IO) _SET_INPUT(IO)
#define SET_INPUT_PULLUP(IO) _SET_INPUT_PULLUP(IO)
#define SET_INPUT_PULLDOWN SET_INPUT
#define SET_OUTPUT(IO) _SET_OUTPUT(IO)
#define SET_PWM(IO) SET_OUTPUT(IO)
#define SET_PWM SET_OUTPUT
#define IS_INPUT(IO) _IS_INPUT(IO)
#define IS_OUTPUT(IO) _IS_OUTPUT(IO)

7
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/compat.h

@ -177,7 +177,8 @@
} // namespace fast_io
#define SET_INPUT(pin) fast_io::pin::set_input()
#define SET_INPUT_PULLUP(pin) fast_io::pin::set_input(); fast_io::pin::set_high()
#define SET_INPUT_PULLUP(pin) do{ fast_io::pin::set_input(); fast_io::pin::set_high(); }while(0)
#define SET_INPUT_PULLDOWN SET_INPUT
#define SET_OUTPUT(pin) fast_io::pin::set_output()
#define READ(pin) fast_io::pin::read()
#define WRITE(pin, value) fast_io::pin::write(value)
@ -198,8 +199,8 @@
#define SERIAL_ECHOLNPGM(str) Serial.println(F(str))
#define SERIAL_ECHOPGM(str) Serial.print(F(str))
#define SERIAL_ECHO_MSG(str) Serial.println(str)
#define SERIAL_ECHOLNPAIR(str, val) {Serial.print(F(str)); Serial.println(val);}
#define SERIAL_ECHOPAIR(str, val) {Serial.print(F(str)); Serial.print(val);}
#define SERIAL_ECHOLNPAIR(str, val) do{ Serial.print(F(str)); Serial.println(val); }while(0)
#define SERIAL_ECHOPAIR(str, val) do{ Serial.print(F(str)); Serial.print(val); }while(0)
#define safe_delay delay

Loading…
Cancel
Save