Skip to content

Commit c5017df

Browse files
committed
Remove non standard API
delayInsideIT() code should have been in the method: void GSM3SoftSerial::tunedDelay(uint16_t delay) It was introduced as an API to support built-in GSM library on Nucleo-L476RG and is not relevant for other. Fix #250 Signed-off-by: Frederic.Pillon <frederic.pillon@st.com>
1 parent 0a38d46 commit c5017df

File tree

2 files changed

+0
-35
lines changed

2 files changed

+0
-35
lines changed

cores/arduino/stm32/clock.c

-34
Original file line numberDiff line numberDiff line change
@@ -87,40 +87,6 @@ void SysTick_Handler(void)
8787
osSystickHandler();
8888
}
8989

90-
/**
91-
* @brief Function provides us delay (required by some arduino libraries).
92-
* Can be called inside an interrupt.
93-
* @param None
94-
* @retval None
95-
*/
96-
void delayInsideIT(uint32_t delay_us)
97-
{
98-
uint32_t nb_loop;
99-
#if defined (STM32F0xx) || defined (STM32L0xx)
100-
nb_loop = (((HAL_RCC_GetHCLKFreq() / 1000000)/5)*delay_us)+1; /* uS (divide by 4 because each loop take about 4 cycles including nop +1 is here to avoid delay of 0 */
101-
__asm__ volatile(
102-
"1: " "\n\t"
103-
" nop " "\n\t"
104-
" sub %0, %0, #1 " "\n\t"
105-
" bne 1b " "\n\t"
106-
: "=r" (nb_loop)
107-
: "0"(nb_loop)
108-
: "r3"
109-
);
110-
#else
111-
nb_loop = (((HAL_RCC_GetHCLKFreq() / 1000000)/4)*delay_us)+1; /* uS (divide by 4 because each loop take about 4 cycles including nop +1 is here to avoid delay of 0 */
112-
__asm__ volatile(
113-
"1: " "\n\t"
114-
" nop " "\n\t"
115-
" subs.w %0, %0, #1 " "\n\t"
116-
" bne 1b " "\n\t"
117-
: "=r" (nb_loop)
118-
: "0"(nb_loop)
119-
: "r3"
120-
);
121-
#endif
122-
}
123-
12490
/**
12591
* @brief Enable the specified clock if not already set
12692
* @param source: clock source: LSE_CLOCK, LSI_CLOCK, HSI_CLOCK or HSE_CLOCK

cores/arduino/stm32/clock.h

-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ typedef enum {
6060
/* Exported functions ------------------------------------------------------- */
6161
uint32_t GetCurrentMilli(void);
6262
uint32_t GetCurrentMicro(void);
63-
void delayInsideIT(uint32_t delay_us);
6463

6564
void enableClock(sourceClock_t source);
6665
#ifdef __cplusplus

0 commit comments

Comments
 (0)