Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit89e7ef5

Browse files
authored
Merge pull request#518 from fpistm/default_HAL_conf
2 parentsfd6c14a +751aee4 commit89e7ef5

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
staticstimer_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+
voidtone(uint8_t _pin,unsignedint frequency,unsignedlong duration)
54+
{
55+
UNUSED(_pin);
56+
UNUSED(frequency);
57+
UNUSED(duration);
58+
}
59+
60+
voidnoTone(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
voidattachInterrupt(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
voidattachInterrupt(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
voiddetachInterrupt(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
}

‎cores/arduino/pins_arduino.h‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,11 @@
1717
*/
1818
#ifndef_PINS_ARDUINO_H_
1919
#define_PINS_ARDUINO_H_
20+
#include<stdlib.h>/* Required for static_assert */
2021
// Include board variant
2122
#include"variant.h"
23+
#include"PinNames.h"
24+
2225

2326
// Avoid PortName issue
2427
_Static_assert(LastPort <=0x0F,"PortName must be less than 16");
@@ -201,6 +204,7 @@ static const uint8_t SCL = PIN_WIRE_SCL;
201204
#ifdef__cplusplus
202205
extern"C" {
203206
#endif
207+
externconstPinNamedigitalPin[];
204208

205209
#defineNOT_AN_INTERRUPT NC // -1
206210

‎cores/arduino/stm32/analog.c‎

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,16 @@
4444
extern"C" {
4545
#endif
4646

47+
48+
/* Private_Variables */
49+
#if defined(HAL_ADC_MODULE_ENABLED)|| defined(HAL_DAC_MODULE_ENABLED)||\
50+
defined(HAL_TIM_MODULE_ENABLED)
51+
staticPinNameg_current_pin=NC;
52+
#endif
53+
4754
/* Private_Defines */
55+
#ifdefHAL_ADC_MODULE_ENABLED
56+
4857
#if defined(ADC_SAMPLETIME_8CYCLES_5)
4958
#defineSAMPLINGTIME ADC_SAMPLETIME_8CYCLES_5;
5059
#elif defined(ADC_SAMPLETIME_12CYCLES_5)
@@ -79,9 +88,6 @@ extern "C" {
7988
#defineADC_REGULAR_RANK_1 1
8089
#endif
8190

82-
/* Private_Variables */
83-
staticPinNameg_current_pin=NC;
84-
8591
/* Private Functions */
8692
staticuint32_tget_adc_channel(PinNamepin)
8793
{
@@ -155,7 +161,9 @@ static uint32_t get_adc_channel(PinName pin)
155161
}
156162
returnchannel;
157163
}
164+
#endif/* HAL_ADC_MODULE_ENABLED */
158165

166+
#ifdefHAL_TIM_MODULE_ENABLED
159167
staticuint32_tget_pwm_channel(PinNamepin)
160168
{
161169
uint32_tfunction=pinmap_function(pin,PinMap_PWM);
@@ -179,6 +187,7 @@ static uint32_t get_pwm_channel(PinName pin)
179187
}
180188
returnchannel;
181189
}
190+
#endif/* HAL_TIM_MODULE_ENABLED */
182191

183192
#ifdefHAL_DAC_MODULE_ENABLED
184193
staticuint32_tget_dac_channel(PinNamepin)
@@ -337,7 +346,7 @@ void dac_stop(PinName pin)
337346
}
338347
#endif//HAL_DAC_MODULE_ENABLED
339348

340-
349+
#ifdefHAL_ADC_MODULE_ENABLED
341350
////////////////////////// ADC INTERFACE FUNCTIONS /////////////////////////////
342351

343352
/**
@@ -641,7 +650,9 @@ uint16_t adc_read_value(PinName pin)
641650

642651
returnuhADCxConvertedValue;
643652
}
653+
#endif/* HAL_ADC_MODULE_ENABLED */
644654

655+
#ifdefHAL_TIM_MODULE_ENABLED
645656
////////////////////////// PWM INTERFACE FUNCTIONS /////////////////////////////
646657

647658

@@ -775,6 +786,7 @@ void pwm_stop(PinName pin)
775786

776787
HAL_TIM_PWM_DeInit(&timHandle);
777788
}
789+
#endif/* HAL_TIM_MODULE_ENABLED */
778790

779791
#ifdef__cplusplus
780792
}

‎cores/arduino/stm32/interrupt.cpp‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@
3737
*/
3838
#include"interrupt.h"
3939

40+
#if !defined(HAL_EXTI_MODULE_DISABLED)
41+
4042
/* Private Types*/
4143

4244
/*As we can have only one interrupt/pin id, don't need to get the port info*/
@@ -370,5 +372,6 @@ void EXTI15_10_IRQHandler(void)
370372
#ifdef __cplusplus
371373
}
372374
#endif
375+
#endif/* !HAL_EXTI_MODULE_DISABLED*/
373376
#endif
374377
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

‎cores/arduino/stm32/interrupt.h‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@
4040
#define__INTERRUPT_H
4141

4242
/* Includes ------------------------------------------------------------------*/
43-
#include"variant.h"
43+
#include"stm32_def.h"
44+
45+
#if !defined(HAL_EXTI_MODULE_DISABLED)
4446

4547
#if defined(STM32F3xx)
4648
#defineEXTI2_IRQn EXTI2_TSC_IRQn
@@ -67,6 +69,7 @@ void stm32_interrupt_enable(GPIO_TypeDef *port, uint16_t pin, callback_function_
6769
/* Exported functions -------------------------------------------------------*/
6870
voidstm32_interrupt_enable(GPIO_TypeDef *port,uint16_t pin,void (*callback)(void), uint32_t mode);
6971
voidstm32_interrupt_disable(GPIO_TypeDef *port,uint16_t pin);
72+
#endif/* !HAL_EXTI_MODULE_DISABLED*/
7073

7174
#endif/* __INTERRUPT_H*/
7275

‎cores/arduino/stm32/rtc.h‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@
4040
#define__RTC_H
4141

4242
/* Includes ------------------------------------------------------------------*/
43-
#include"variant.h"
43+
#include<stdbool.h>
44+
#include"stm32_def.h"
4445
#include"backup.h"
4546
#include"clock.h"
4647

‎cores/arduino/stm32/spi_com.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
#ifdef__cplusplus
4545
extern"C" {
4646
#endif
47+
#if defined(HAL_SPI_MODULE_ENABLED)
4748

4849
/* Private Functions */
4950
/**
@@ -402,6 +403,7 @@ spi_status_e spi_transfer(spi_t *obj, uint8_t *tx_buffer,
402403

403404
returnret;
404405
}
406+
#endif/* HAL_SPI_MODULE_ENABLED */
405407

406408
#ifdef__cplusplus
407409
}

‎cores/arduino/stm32/spi_com.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
#ifdef__cplusplus
4747
extern"C" {
4848
#endif
49+
#if defined(HAL_SPI_MODULE_ENABLED)
4950

5051
/* Exported types ------------------------------------------------------------*/
5152

@@ -101,6 +102,7 @@ spi_status_e spi_send(spi_t *obj, uint8_t *Data, uint16_t len, uint32_t Timeout)
101102
spi_status_espi_transfer(spi_t*obj,uint8_t*tx_buffer,
102103
uint8_t*rx_buffer,uint16_tlen,uint32_tTimeout);
103104
uint32_tspi_getClkFreq(spi_t*obj);
105+
#endif/* HAL_SPI_MODULE_ENABLED */
104106

105107
#ifdef__cplusplus
106108
}

‎cores/arduino/stm32/stm32_eeprom.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
#define__STM32_EEPROM_H
3838

3939
/* Includes ------------------------------------------------------------------*/
40-
#include"variant.h"
40+
#include"stm32_def.h"
4141

4242
#ifdef__cplusplus
4343
extern"C" {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp