Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 89e7ef5

Browse files
authoredMay 15, 2019
Merge pull request #518 from fpistm/default_HAL_conf
2 parents fd6c14a + 751aee4 commit 89e7ef5

File tree

183 files changed

+3074
-17997
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

183 files changed

+3074
-17997
lines changed
 

‎cores/arduino/Tone.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
#include "Arduino.h"
2323

2424
PinName g_lastPin = NC;
25+
26+
#ifdef HAL_TIM_MODULE_ENABLED
2527
static stimer_t _timer;
2628

2729
// frequency (in hertz) and duration (in milliseconds).
@@ -47,3 +49,16 @@ void noTone(uint8_t _pin)
4749
g_lastPin = NC;
4850
}
4951
}
52+
#else
53+
void tone(uint8_t _pin, unsigned int frequency, unsigned long duration)
54+
{
55+
UNUSED(_pin);
56+
UNUSED(frequency);
57+
UNUSED(duration);
58+
}
59+
60+
void noTone(uint8_t _pin)
61+
{
62+
UNUSED(_pin);
63+
}
64+
#endif /* HAL_TIM_MODULE_ENABLED */

‎cores/arduino/WInterrupts.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424

2525
void attachInterrupt(uint32_t pin, callback_function_t callback, uint32_t mode)
2626
{
27+
#if !defined(HAL_EXTI_MODULE_DISABLED)
2728
uint32_t it_mode;
2829
PinName p = digitalPinToPinName(pin);
2930
GPIO_TypeDef *port = set_GPIO_Port_Clock(STM_PORT(p));
@@ -53,20 +54,36 @@ void attachInterrupt(uint32_t pin, callback_function_t callback, uint32_t mode)
5354
#endif /* STM32F1xx */
5455

5556
stm32_interrupt_enable(port, STM_GPIO_PIN(p), callback, it_mode);
57+
#else
58+
UNUSED(pin);
59+
UNUSED(callback);
60+
UNUSED(mode);
61+
#endif
5662
}
5763

5864
void attachInterrupt(uint32_t pin, void (*callback)(void), uint32_t mode)
5965
{
66+
#if !defined(HAL_EXTI_MODULE_DISABLED)
6067
callback_function_t _c = callback;
6168
attachInterrupt(pin, _c, mode);
69+
#else
70+
UNUSED(pin);
71+
UNUSED(callback);
72+
UNUSED(mode);
73+
#endif
74+
6275
}
6376

6477
void detachInterrupt(uint32_t pin)
6578
{
79+
#if !defined(HAL_EXTI_MODULE_DISABLED)
6680
PinName p = digitalPinToPinName(pin);
6781
GPIO_TypeDef *port = get_GPIO_Port(STM_PORT(p));
6882
if (!port) {
6983
return;
7084
}
7185
stm32_interrupt_disable(port, STM_GPIO_PIN(p));
86+
#else
87+
UNUSED(pin);
88+
#endif
7289
}

0 commit comments

Comments
 (0)
Please sign in to comment.