Browse Source

fix missing GET_TIMER (used by PWM for Ex_AUTO_FAN)

Unknown 7 years ago
parent
commit
d1f11e9c10
1 changed files with 14 additions and 5 deletions
  1. 14
    5
      Marlin/src/HAL/HAL_LPC1768/fastio.h

+ 14
- 5
Marlin/src/HAL/HAL_LPC1768/fastio.h View File

85
 /// set pin as input with pullup mode
85
 /// set pin as input with pullup mode
86
 #define _PULLUP(IO, v) (pinMode(IO, (v!=LOW ? INPUT_PULLUP : INPUT)))
86
 #define _PULLUP(IO, v) (pinMode(IO, (v!=LOW ? INPUT_PULLUP : INPUT)))
87
 
87
 
88
+// hg42: all pins can be input or output (I hope)
89
+// hg42: undefined pins create compile error (IO, is no pin)
90
+// hg42: currently not used, but was used by pinsDebug
91
+
88
 /// check if pin is an input
92
 /// check if pin is an input
89
-#define _GET_INPUT(IO)
93
+#define _GET_INPUT(IO)        (LPC1768_PIN_PIN(IO)>=0)
94
+
90
 /// check if pin is an output
95
 /// check if pin is an output
91
-#define _GET_OUTPUT(IO)
96
+#define _GET_OUTPUT(IO)       (LPC1768_PIN_PIN(IO)>=0)
97
+
98
+// hg42: GET_TIMER is used only to check if it's a PWM pin
99
+// hg42: we cannot use USEABLE_HARDWARE_PWM because it uses a function that cannot be used statically
100
+// hg42: instead use PWM bit from the #define
92
 
101
 
93
 /// check if pin is an timer
102
 /// check if pin is an timer
94
-#define _GET_TIMER(IO)
103
+#define _GET_TIMER(IO)        LPC1768_PIN_PWM(IO)
95
 
104
 
96
 /// Read a pin wrapper
105
 /// Read a pin wrapper
97
 #define READ(IO)  _READ(IO)
106
 #define READ(IO)  _READ(IO)
111
 #define SET_OUTPUT(IO)  do{ _SET_OUTPUT(IO); _WRITE(IO, LOW); }while(0)
120
 #define SET_OUTPUT(IO)  do{ _SET_OUTPUT(IO); _WRITE(IO, LOW); }while(0)
112
 
121
 
113
 /// check if pin is an input wrapper
122
 /// check if pin is an input wrapper
114
-#define GET_INPUT(IO)  _GET_INPUT(IO) // todo: Never used?
123
+#define GET_INPUT(IO)  _GET_INPUT(IO)
115
 /// check if pin is an output wrapper
124
 /// check if pin is an output wrapper
116
-#define GET_OUTPUT(IO)  _GET_OUTPUT(IO) //todo: Never Used?
125
+#define GET_OUTPUT(IO)  _GET_OUTPUT(IO)
117
 
126
 
118
 /// check if pin is an timer wrapper
127
 /// check if pin is an timer wrapper
119
 #define GET_TIMER(IO)  _GET_TIMER(IO)
128
 #define GET_TIMER(IO)  _GET_TIMER(IO)

Loading…
Cancel
Save