From 2ddba201c0df622afa56549e551a206c73d3f185 Mon Sep 17 00:00:00 2001 From: Alexey Shvetsov Date: Tue, 12 Jun 2018 04:00:56 +0300 Subject: [PATCH] STM32F1 HAL Fixes (#10999) - Enable / disable interrupts with `__iSeiRetVal` / `__iCliRetVal` - Add STM32F1 to Travis CI tests --- .travis.yml | 10 ++++++++++ Marlin/src/HAL/HAL_STM32F1/HAL.h | 12 ++++++------ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 889af4c58a..f30515c63a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -472,3 +472,13 @@ script: - update_defaults - opt_enable VIKI2 SDSUPPORT - build_marlin_pio ${TRAVIS_BUILD_DIR} ${TEST_PLATFORM} + + ############################# + # STM32F1 default config test + ############################# + + - export TEST_PLATFORM="-e STM32F1" + - restore_configs + - opt_set MOTHERBOARD BOARD_STM32F1R + - update_defaults + - build_marlin_pio ${TRAVIS_BUILD_DIR} ${TEST_PLATFORM} diff --git a/Marlin/src/HAL/HAL_STM32F1/HAL.h b/Marlin/src/HAL/HAL_STM32F1/HAL.h index 6da2964f9e..a0a9a26de5 100644 --- a/Marlin/src/HAL/HAL_STM32F1/HAL.h +++ b/Marlin/src/HAL/HAL_STM32F1/HAL.h @@ -40,7 +40,7 @@ // -------------------------------------------------------------------------- #include - +#include #include // -------------------------------------------------------------------------- @@ -119,11 +119,11 @@ void HAL_init(); #define analogInputToDigitalPin(p) (p) #endif -#define CRITICAL_SECTION_START uint32_t primask = __get_PRIMASK(); __disable_irq() -#define CRITICAL_SECTION_END if (!primask) __enable_irq() -#define ISRS_ENABLED() (!__get_PRIMASK()) -#define ENABLE_ISRS() __enable_irq() -#define DISABLE_ISRS() __disable_irq() +#define CRITICAL_SECTION_START uint32_t primask = __get_primask(); (void)__iCliRetVal() +#define CRITICAL_SECTION_END if (!primask) (void)__iSeiRetVal() +#define ISRS_ENABLED() (!__get_primask) +#define ENABLE_ISRS() ((void)__iSeiRetVal()) +#define DISABLE_ISRS() ((void)__iCliRetVal()) // On AVR this is in math.h? #define square(x) ((x)*(x))