Clean up HALs / FastIO (#14082)

This commit is contained in:
Giuliano Zaro
2019-05-22 01:28:12 +02:00
committed by Scott Lahteine
parent 4ef364a073
commit a74aad3b4a
21 changed files with 17 additions and 187 deletions

View File

@ -80,16 +80,6 @@
/// check if pin is an output
#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
#define READ(IO) _READ(IO)
@ -116,14 +106,9 @@
/// check if pin is an output wrapper
#define IS_OUTPUT(IO) _IS_OUTPUT(IO)
/// check if pin is a timer (wrapper)
#define HAS_TIMER(IO) _HAS_TIMER(IO)
// Shorthand
#define OUT_WRITE(IO,V) do{ SET_OUTPUT(IO); WRITE(IO,V); }while(0)
// digitalRead/Write wrappers
#define extDigitalRead(IO) digitalRead(IO)
#define extDigitalWrite(IO,V) digitalWrite(IO,V)
#define USEABLE_HARDWARE_PWM(P) PWM_PIN(P)