@@ -184,51 +184,22 @@ inline long map(long x, long in_min, long in_max, long out_min, long out_max) {
184184 return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
185185}
186186
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-
221187} // namespace audio_tools
222188
223189#if defined(ESP32)
224190#include " driver/gpio.h"
191+
225192// / e.g. for AudioActions
226- static int digitalRead (int pin) {
193+ extern " C " int digitalRead (int pin) {
227194 printf (" digitalRead:%d\n " , pin);
228195 return gpio_get_level ((gpio_num_t )pin);
229196}
230197
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) {
232203 gpio_num_t gpio_pin = (gpio_num_t )pin;
233204 printf (" pinMode(%d,%d)\n " , pin, mode);
234205
@@ -251,5 +222,3 @@ static void pinMode(int pin, int mode) {
251222}
252223
253224#endif
254-
255- // using namespace audio_tools;
0 commit comments