Pārlūkot izejas kodu

Updates to STM32F7 HAL, for completeness (#11770)

Sam Lane 6 gadus atpakaļ
vecāks
revīzija
d783400330

+ 2
- 7
Marlin/src/HAL/HAL_STM32F4/HAL.h Parādīt failu

124
 #define ISRS_ENABLED() (!__get_PRIMASK())
124
 #define ISRS_ENABLED() (!__get_PRIMASK())
125
 #define ENABLE_ISRS()  __enable_irq()
125
 #define ENABLE_ISRS()  __enable_irq()
126
 #define DISABLE_ISRS() __disable_irq()
126
 #define DISABLE_ISRS() __disable_irq()
127
+#define cli() __disable_irq()
128
+#define sei() __enable_irq()
127
 
129
 
128
 // On AVR this is in math.h?
130
 // On AVR this is in math.h?
129
 #define square(x) ((x)*(x))
131
 #define square(x) ((x)*(x))
163
 // Public functions
165
 // Public functions
164
 // --------------------------------------------------------------------------
166
 // --------------------------------------------------------------------------
165
 
167
 
166
-// Disable interrupts
167
-#define cli() do {  DISABLE_TEMPERATURE_INTERRUPT(); DISABLE_STEPPER_DRIVER_INTERRUPT(); } while(0)
168
-
169
-// Enable interrupts
170
-#define sei() do {  ENABLE_TEMPERATURE_INTERRUPT(); ENABLE_STEPPER_DRIVER_INTERRUPT(); } while(0)
171
-
172
 // Memory related
168
 // Memory related
173
 #define __bss_end __bss_end__
169
 #define __bss_end __bss_end__
174
 
170
 
209
 /** Read single byte from specified SPI channel */
205
 /** Read single byte from specified SPI channel */
210
 uint8_t spiRec(uint32_t chan);
206
 uint8_t spiRec(uint32_t chan);
211
 
207
 
212
-
213
 // EEPROM
208
 // EEPROM
214
 
209
 
215
 /**
210
 /**

+ 2
- 4
Marlin/src/HAL/HAL_STM32F7/HAL.h Parādīt failu

114
 #define ISRS_ENABLED() (!__get_PRIMASK())
114
 #define ISRS_ENABLED() (!__get_PRIMASK())
115
 #define ENABLE_ISRS()  __enable_irq()
115
 #define ENABLE_ISRS()  __enable_irq()
116
 #define DISABLE_ISRS() __disable_irq()
116
 #define DISABLE_ISRS() __disable_irq()
117
+#define cli() __disable_irq()
118
+#define sei() __enable_irq()
117
 
119
 
118
 // On AVR this is in math.h?
120
 // On AVR this is in math.h?
119
 #define square(x) ((x)*(x))
121
 #define square(x) ((x)*(x))
151
 // Public functions
153
 // Public functions
152
 // --------------------------------------------------------------------------
154
 // --------------------------------------------------------------------------
153
 
155
 
154
-// Disable interrupts
155
-#define cli() do {  DISABLE_TEMPERATURE_INTERRUPT(); DISABLE_STEPPER_DRIVER_INTERRUPT(); } while(0)
156
 
156
 
157
-// Enable interrupts
158
-#define sei() do {  ENABLE_TEMPERATURE_INTERRUPT(); ENABLE_STEPPER_DRIVER_INTERRUPT(); } while(0)
159
 
157
 
160
 // Memory related
158
 // Memory related
161
 #define __bss_end __bss_end__
159
 #define __bss_end __bss_end__

+ 1
- 1
Marlin/src/HAL/HAL_STM32F7/HAL_spi_STM32F7.cpp Parādīt failu

41
 #include "pins_arduino.h"
41
 #include "pins_arduino.h"
42
 #include "spi_pins.h"
42
 #include "spi_pins.h"
43
 #include "../../core/macros.h"
43
 #include "../../core/macros.h"
44
-
44
+#include <SPI.h>
45
 
45
 
46
 // --------------------------------------------------------------------------
46
 // --------------------------------------------------------------------------
47
 // Public Variables
47
 // Public Variables

+ 5
- 0
Marlin/src/HAL/HAL_STM32F7/HAL_timers_STM32F7.cpp Parādīt failu

148
   }
148
   }
149
 }
149
 }
150
 
150
 
151
+bool HAL_timer_interrupt_enabled(const uint8_t timer_num) {
152
+  const uint32_t IRQ_Id = uint32_t(timerConfig[timer_num].IRQ_Id);
153
+  return NVIC->ISER[IRQ_Id >> 5] & _BV32(IRQ_Id & 0x1F);
154
+}
155
+
151
 #endif // STM32F7
156
 #endif // STM32F7

+ 3
- 0
Marlin/src/HAL/HAL_STM32F7/HAL_timers_STM32F7.h Parādīt failu

61
 #define ENABLE_TEMPERATURE_INTERRUPT() HAL_timer_enable_interrupt(TEMP_TIMER_NUM)
61
 #define ENABLE_TEMPERATURE_INTERRUPT() HAL_timer_enable_interrupt(TEMP_TIMER_NUM)
62
 #define DISABLE_TEMPERATURE_INTERRUPT() HAL_timer_disable_interrupt(TEMP_TIMER_NUM)
62
 #define DISABLE_TEMPERATURE_INTERRUPT() HAL_timer_disable_interrupt(TEMP_TIMER_NUM)
63
 
63
 
64
+#define STEPPER_ISR_ENABLED() HAL_timer_interrupt_enabled(STEP_TIMER_NUM)
65
+#define TEMP_ISR_ENABLED() HAL_timer_interrupt_enabled(TEMP_TIMER_NUM)
64
 // TODO change this
66
 // TODO change this
65
 
67
 
66
 
68
 
92
 void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency);
94
 void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency);
93
 void HAL_timer_enable_interrupt(const uint8_t timer_num);
95
 void HAL_timer_enable_interrupt(const uint8_t timer_num);
94
 void HAL_timer_disable_interrupt(const uint8_t timer_num);
96
 void HAL_timer_disable_interrupt(const uint8_t timer_num);
97
+bool HAL_timer_interrupt_enabled(const uint8_t timer_num);
95
 
98
 
96
 void HAL_timer_set_compare(const uint8_t timer_num, const uint32_t compare);
99
 void HAL_timer_set_compare(const uint8_t timer_num, const uint32_t compare);
97
 hal_timer_t HAL_timer_get_compare(const uint8_t timer_num);
100
 hal_timer_t HAL_timer_get_compare(const uint8_t timer_num);

+ 2
- 2
Marlin/src/HAL/HAL_STM32F7/TMC2660.cpp Parādīt failu

33
 #include <SPI.h>
33
 #include <SPI.h>
34
 #include "TMC2660.h"
34
 #include "TMC2660.h"
35
 
35
 
36
-#include "../../HAL/HAL_STM32F7/HAL_STM32F7.h"
36
+#include "../../HAL/HAL_STM32F7/HAL.h"
37
 #include "../../core/serial.h"
37
 #include "../../core/serial.h"
38
 #include "../../inc/MarlinConfig.h"
38
 #include "../../inc/MarlinConfig.h"
39
 #include "../../Marlin.h"
39
 #include "../../Marlin.h"
448
 /**
448
 /**
449
  * returns the effective number of microsteps at the moment
449
  * returns the effective number of microsteps at the moment
450
  */
450
  */
451
-int TMC26XStepper::getMicrosteps(void) { return microsteps }
451
+int TMC26XStepper::getMicrosteps(void) { return microsteps; }
452
 
452
 
453
 /**
453
 /**
454
  * constant_off_time: The off time setting controls the minimum chopper frequency.
454
  * constant_off_time: The off time setting controls the minimum chopper frequency.

Notiek ielāde…
Atcelt
Saglabāt