@@ -184,51 +184,22 @@ inline long map(long x, long in_min, long in_max, long out_min, long out_max) {
184
184
return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
185
185
}
186
186
187
- // #ifndef DESKTOP_MILLIS_DEFINED
188
-
189
- // /// Waits for the indicated milliseconds
190
- // extern void delay(uint32_t ms);
191
-
192
- // /// Returns the milliseconds since the start
193
- // extern uint32_t millis();
194
-
195
- // /// Waits for the indicated milliseconds
196
- // extern void delayMicroseconds(uint32_t ms);
197
-
198
- // /// Returns the milliseconds since the start
199
- // extern uint32_t micros();
200
-
201
- // #else
202
-
203
- // extern "C" {
204
-
205
- // /// Waits for the indicated milliseconds
206
- // extern void delay(uint32_t ms);
207
-
208
- // /// Returns the milliseconds since the start
209
- // extern uint32_t millis();
210
-
211
- // /// Waits for the indicated milliseconds
212
- // extern void delayMicroseconds(uint32_t ms);
213
-
214
- // /// Returns the milliseconds since the start
215
- // extern uint32_t micros();
216
-
217
- // }
218
-
219
- // #endif
220
-
221
187
} // namespace audio_tools
222
188
223
189
#if defined(ESP32)
224
190
#include " driver/gpio.h"
191
+
225
192
// / e.g. for AudioActions
226
- static int digitalRead (int pin) {
193
+ extern " C " int digitalRead (int pin) {
227
194
printf (" digitalRead:%d\n " , pin);
228
195
return gpio_get_level ((gpio_num_t )pin);
229
196
}
230
197
231
- static void pinMode (int pin, int mode) {
198
+ extern " C" void digitalWrite (int pin, int value) {
199
+ gpio_set_level ((gpio_num_t )pin, value);
200
+ }
201
+
202
+ extern " C" void pinMode (int pin, int mode) {
232
203
gpio_num_t gpio_pin = (gpio_num_t )pin;
233
204
printf (" pinMode(%d,%d)\n " , pin, mode);
234
205
@@ -251,5 +222,3 @@ static void pinMode(int pin, int mode) {
251
222
}
252
223
253
224
#endif
254
-
255
- // using namespace audio_tools;
0 commit comments