Skip to content

Commit

Permalink
Updated delay() function pointer definition. It is now ESP32 proof. E…
Browse files Browse the repository at this point in the history
…SP32 uses `uint32_t` for time argument. All other supported models (ESP8266, Arduino AVR) uses `unsigned long`.

This matches the platform definitions for esp32:esp32 v3.0.4, esp8266:esp8266 v3.1.2 and arduino:avr v1.8.6.
  • Loading branch information
end2endzone committed Aug 7, 2024
1 parent 6a417ca commit 6a8db49
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/anyrtttl.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,23 @@ namespace anyrtttl
* Description:
* Defines a function pointer to a tone() function
****************************************************************************/
typedef void (*ToneFuncPtr)(uint8_t _pin, unsigned int, unsigned long);
typedef void (*ToneFuncPtr)(uint8_t pin, unsigned int frequency, unsigned long duration);

/****************************************************************************
* Description:
* Defines a function pointer to a noTone() function
****************************************************************************/
typedef void (*NoToneFuncPtr)(uint8_t);
typedef void (*NoToneFuncPtr)(uint8_t pin);

/****************************************************************************
* Description:
* Defines a function pointer to a delay() function
****************************************************************************/
#if defined(ESP32)
typedef void (*DelayFuncPtr)(uint32_t);
#else
typedef void (*DelayFuncPtr)(unsigned long);
#endif

/****************************************************************************
* Description:
Expand Down

0 comments on commit 6a8db49

Please sign in to comment.