Skip to content

Commit 2eb6b4c

Browse files
committed
chore(tone): add HAL v2 support
Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
1 parent 335a499 commit 2eb6b4c

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎cores/arduino/Tone.cpp‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@
2222
#include "Arduino.h"
2323
#include "HardwareTimer.h"
2424

25-
#if defined(HAL_TIM_MODULE_ENABLED) && defined(TIMER_TONE) && !defined(HAL_TIM_MODULE_ONLY)
25+
#if defined(TIMER_TONE) && !defined(HAL_TIM_MODULE_ONLY) && \
26+
(defined(HAL_TIM_MODULE_ENABLED) || (defined(USE_HAL_TIM_MODULE) && (USE_HAL_TIM_MODULE == 1)))
2627

2728
#define MAX_FREQ 65535
2829

@@ -138,7 +139,7 @@ void noTone(uint8_t _pin, bool destruct)
138139
}
139140
}
140141
#else
141-
#warning "TIMER_TONE or HAL_TIM_MODULE_ENABLED not defined"
142+
#warning "Tone library disabled"
142143
void tone(uint8_t _pin, unsigned int frequency, unsigned long duration)
143144
{
144145
(void)_pin;

0 commit comments

Comments
 (0)