Browse Source

STM32F1 HAL Fixes (#10999)

- Enable / disable interrupts with `__iSeiRetVal` / `__iCliRetVal`
- Add STM32F1 to Travis CI tests
Alexey Shvetsov 6 years ago
parent
commit
2ddba201c0
2 changed files with 16 additions and 6 deletions
  1. 10
    0
      .travis.yml
  2. 6
    6
      Marlin/src/HAL/HAL_STM32F1/HAL.h

+ 10
- 0
.travis.yml View File

@@ -472,3 +472,13 @@ script:
472 472
   - update_defaults
473 473
   - opt_enable VIKI2 SDSUPPORT
474 474
   - build_marlin_pio ${TRAVIS_BUILD_DIR} ${TEST_PLATFORM}
475
+
476
+  #############################
477
+  # STM32F1 default config test
478
+  #############################
479
+
480
+  - export TEST_PLATFORM="-e STM32F1"
481
+  - restore_configs
482
+  - opt_set MOTHERBOARD BOARD_STM32F1R
483
+  - update_defaults
484
+  - build_marlin_pio ${TRAVIS_BUILD_DIR} ${TEST_PLATFORM}

+ 6
- 6
Marlin/src/HAL/HAL_STM32F1/HAL.h View File

@@ -40,7 +40,7 @@
40 40
 // --------------------------------------------------------------------------
41 41
 
42 42
 #include <stdint.h>
43
-
43
+#include <libmaple/atomic.h>
44 44
 #include <Arduino.h>
45 45
 
46 46
 // --------------------------------------------------------------------------
@@ -119,11 +119,11 @@ void HAL_init();
119 119
   #define analogInputToDigitalPin(p) (p)
120 120
 #endif
121 121
 
122
-#define CRITICAL_SECTION_START  uint32_t primask = __get_PRIMASK(); __disable_irq()
123
-#define CRITICAL_SECTION_END    if (!primask) __enable_irq()
124
-#define ISRS_ENABLED() (!__get_PRIMASK())
125
-#define ENABLE_ISRS()  __enable_irq()
126
-#define DISABLE_ISRS() __disable_irq()
122
+#define CRITICAL_SECTION_START  uint32_t primask = __get_primask(); (void)__iCliRetVal()
123
+#define CRITICAL_SECTION_END    if (!primask) (void)__iSeiRetVal()
124
+#define ISRS_ENABLED() (!__get_primask)
125
+#define ENABLE_ISRS()  ((void)__iSeiRetVal())
126
+#define DISABLE_ISRS() ((void)__iCliRetVal())
127 127
 
128 128
 // On AVR this is in math.h?
129 129
 #define square(x) ((x)*(x))

Loading…
Cancel
Save