Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions cores/arduino/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ extern "C"{
#include "clock.h"
#include "core_callback.h"
#include "digital_io.h"
#include "hal_uart_emul.h"
#include "hw_config.h"
#include "low_power.h"
#include "rtc.h"
Expand All @@ -21,7 +20,6 @@ extern "C"{
#include "timer.h"
#include "twi.h"
#include "uart.h"
#include "uart_emul.h"
#ifdef USBCON
#include "usb_interface.h"
#endif //USBCON
Expand Down
34 changes: 0 additions & 34 deletions cores/arduino/stm32/clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,40 +87,6 @@ void SysTick_Handler(void)
osSystickHandler();
}

/**
* @brief Function provides us delay (required by some arduino libraries).
* Can be called inside an interrupt.
* @param None
* @retval None
*/
void delayInsideIT(uint32_t delay_us)
{
uint32_t nb_loop;
#if defined (STM32F0xx) || defined (STM32L0xx)
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 */
__asm__ volatile(
"1: " "\n\t"
" nop " "\n\t"
" sub %0, %0, #1 " "\n\t"
" bne 1b " "\n\t"
: "=r" (nb_loop)
: "0"(nb_loop)
: "r3"
);
#else
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 */
__asm__ volatile(
"1: " "\n\t"
" nop " "\n\t"
" subs.w %0, %0, #1 " "\n\t"
" bne 1b " "\n\t"
: "=r" (nb_loop)
: "0"(nb_loop)
: "r3"
);
#endif
}

/**
* @brief Enable the specified clock if not already set
* @param source: clock source: LSE_CLOCK, LSI_CLOCK, HSI_CLOCK or HSE_CLOCK
Expand Down
1 change: 0 additions & 1 deletion cores/arduino/stm32/clock.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ typedef enum {
/* Exported functions ------------------------------------------------------- */
uint32_t GetCurrentMilli(void);
uint32_t GetCurrentMicro(void);
void delayInsideIT(uint32_t delay_us);

void enableClock(sourceClock_t source);
#ifdef __cplusplus
Expand Down
Loading