From d1d80bb22c28ec0d1e2c2fa64a319bc702b07ab2 Mon Sep 17 00:00:00 2001 From: Frederic Pillon Date: Thu, 25 Jan 2018 15:48:31 +0100 Subject: [PATCH 1/2] Avoid use internal core header file use Arduino.h instead Up to the used core to define properly what the library need. Mainly the cortex M core to use: Ex: for STM32F103 based board: #define __CORTEX_M (0x03U) /*!< Cortex-M Core */ https://github.com/stm32duino/Arduino_Core_STM32 uses the CMSIS which defined it. https://github.com/ARM-software/CMSIS/blob/6891719834ac6ca2a79e8ded00620faffae10ae8/CMSIS/Include/core_cm3.h#L79 Fix #3 Signed-off-by: Frederic Pillon --- src/port.c | 2 +- src/portmacro.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/port.c b/src/port.c index 610ca7a..abe0add 100644 --- a/src/port.c +++ b/src/port.c @@ -3,7 +3,7 @@ * @author Frederic Pillon for STMicroelectronics. * @brief Include source of FreeRTOS portable layer file to match Arduino library format */ -#include "stm32_def.h" +#include #ifndef __CORTEX_M #pragma GCC error "no \"__CORTEX_M\" definition" diff --git a/src/portmacro.h b/src/portmacro.h index f3ff239..b2a221a 100644 --- a/src/portmacro.h +++ b/src/portmacro.h @@ -6,7 +6,7 @@ #ifndef _PORTMACRO_H_ #define _PORTMACRO_H_ -#include "stm32_def.h" +#include #ifndef __CORTEX_M #pragma GCC error "no \"__CORTEX_M\" definition" From 2f333a4ae9a648e65039cba0c59b93b78903f3a9 Mon Sep 17 00:00:00 2001 From: Frederic Pillon Date: Thu, 25 Jan 2018 16:27:11 +0100 Subject: [PATCH 2/2] Avoid use of non standard Arduino variable F_CPU is equal to SystemCoreClock Signed-off-by: Frederic Pillon --- src/STM32FreeRTOS.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/STM32FreeRTOS.c b/src/STM32FreeRTOS.c index 660fe32..dbd85e8 100644 --- a/src/STM32FreeRTOS.c +++ b/src/STM32FreeRTOS.c @@ -11,7 +11,7 @@ * \param[in] millis milliseconds to delay */ static void delayMS(uint32_t millis) { - uint32_t iterations = millis * (SystemCoreClock/7000); + uint32_t iterations = millis * (F_CPU/7000); uint32_t i; for(i = 0; i < iterations; ++i) { __asm__("nop\n\t");