浏览代码

Merge pull request #9733 from thinkyhead/bf2_random_fixup_branch

[2.0.x] Drop HAL_timer_set_count
Scott Lahteine 7 年前
父节点
当前提交
eb182c08af
没有帐户链接到提交者的电子邮件

+ 0
- 1
Marlin/src/HAL/HAL_AVR/HAL_AVR.h 查看文件

149
 #define _CAT(a, ...) a ## __VA_ARGS__
149
 #define _CAT(a, ...) a ## __VA_ARGS__
150
 #define HAL_timer_set_compare(timer, compare) (_CAT(TIMER_OCR_, timer) = compare)
150
 #define HAL_timer_set_compare(timer, compare) (_CAT(TIMER_OCR_, timer) = compare)
151
 #define HAL_timer_get_compare(timer) _CAT(TIMER_OCR_, timer)
151
 #define HAL_timer_get_compare(timer) _CAT(TIMER_OCR_, timer)
152
-#define HAL_timer_set_count(timer, count) (_CAT(TIMER_COUNTER_, timer) = count)
153
 #define HAL_timer_get_count(timer) _CAT(TIMER_COUNTER_, timer)
152
 #define HAL_timer_get_count(timer) _CAT(TIMER_COUNTER_, timer)
154
 
153
 
155
 #define HAL_timer_isr_prologue(timer_num)
154
 #define HAL_timer_isr_prologue(timer_num)

+ 0
- 5
Marlin/src/HAL/HAL_DUE/HAL_timers_Due.h 查看文件

101
   return pConfig->pTimerRegs->TC_CHANNEL[pConfig->channel].TC_RC;
101
   return pConfig->pTimerRegs->TC_CHANNEL[pConfig->channel].TC_RC;
102
 }
102
 }
103
 
103
 
104
-FORCE_INLINE static void HAL_timer_set_count(const uint8_t timer_num, const hal_timer_t count) {
105
-  const tTimerConfig * const pConfig = &TimerConfig[timer_num];
106
-  pConfig->pTimerRegs->TC_CHANNEL[pConfig->channel].TC_CV = count;
107
-}
108
-
109
 FORCE_INLINE static hal_timer_t HAL_timer_get_count(const uint8_t timer_num) {
104
 FORCE_INLINE static hal_timer_t HAL_timer_get_count(const uint8_t timer_num) {
110
   const tTimerConfig * const pConfig = &TimerConfig[timer_num];
105
   const tTimerConfig * const pConfig = &TimerConfig[timer_num];
111
   return pConfig->pTimerRegs->TC_CHANNEL[pConfig->channel].TC_CV;
106
   return pConfig->pTimerRegs->TC_CHANNEL[pConfig->channel].TC_CV;

+ 0
- 7
Marlin/src/HAL/HAL_LPC1768/HAL_timers.h 查看文件

110
   return 0;
110
   return 0;
111
 }
111
 }
112
 
112
 
113
-FORCE_INLINE static void HAL_timer_set_count(const uint8_t timer_num, const hal_timer_t count) {
114
-  switch (timer_num) {
115
-    case 0: LPC_TIM0->TC = count; break;
116
-    case 1: LPC_TIM1->TC = count; break;
117
-  }
118
-}
119
-
120
 FORCE_INLINE static hal_timer_t HAL_timer_get_count(const uint8_t timer_num) {
113
 FORCE_INLINE static hal_timer_t HAL_timer_get_count(const uint8_t timer_num) {
121
   switch (timer_num) {
114
   switch (timer_num) {
122
     case 0: return LPC_TIM0->TC;
115
     case 0: return LPC_TIM0->TC;

+ 0
- 1
Marlin/src/HAL/HAL_STM32F1/HAL_timers_Stm32f1.h 查看文件

83
 #define DISABLE_TEMPERATURE_INTERRUPT() timer_disable_irq(TEMP_TIMER_DEV, TEMP_TIMER_CHAN)
83
 #define DISABLE_TEMPERATURE_INTERRUPT() timer_disable_irq(TEMP_TIMER_DEV, TEMP_TIMER_CHAN)
84
 
84
 
85
 #define HAL_timer_get_count(timer_num) timer_get_count(TIMER_DEV(timer_num))
85
 #define HAL_timer_get_count(timer_num) timer_get_count(TIMER_DEV(timer_num))
86
-#define HAL_timer_set_count(timer_num, count) timer_set_count(TIMER_DEV(timer_num), (uint16)count)
87
 
86
 
88
 
87
 
89
 #define HAL_ENABLE_ISRs() do { if (thermalManager.in_temp_isr)DISABLE_TEMPERATURE_INTERRUPT(); else ENABLE_TEMPERATURE_INTERRUPT(); ENABLE_STEPPER_DRIVER_INTERRUPT(); } while(0)
88
 #define HAL_ENABLE_ISRs() do { if (thermalManager.in_temp_isr)DISABLE_TEMPERATURE_INTERRUPT(); else ENABLE_TEMPERATURE_INTERRUPT(); ENABLE_STEPPER_DRIVER_INTERRUPT(); } while(0)

+ 0
- 4
Marlin/src/HAL/HAL_STM32F7/HAL_timers_STM32F7.cpp 查看文件

121
   __HAL_TIM_SetAutoreload(&timerConfig[timer_num].timerdef, compare);
121
   __HAL_TIM_SetAutoreload(&timerConfig[timer_num].timerdef, compare);
122
 }
122
 }
123
 
123
 
124
-void HAL_timer_set_count(const uint8_t timer_num, const uint32_t count) {
125
-  __HAL_TIM_SetAutoreload(&timerConfig[timer_num].timerdef, count);
126
-}
127
-
128
 void HAL_timer_enable_interrupt(const uint8_t timer_num) {
124
 void HAL_timer_enable_interrupt(const uint8_t timer_num) {
129
   HAL_NVIC_EnableIRQ(timerConfig[timer_num].IRQ_Id);
125
   HAL_NVIC_EnableIRQ(timerConfig[timer_num].IRQ_Id);
130
 }
126
 }

+ 0
- 5
Marlin/src/HAL/HAL_STM32F7/HAL_timers_STM32F7.h 查看文件

95
 hal_timer_t HAL_timer_get_compare(const uint8_t timer_num);
95
 hal_timer_t HAL_timer_get_compare(const uint8_t timer_num);
96
 uint32_t HAL_timer_get_count(const uint8_t timer_num);
96
 uint32_t HAL_timer_get_count(const uint8_t timer_num);
97
 
97
 
98
-void HAL_timer_set_count(const uint8_t timer_num, const uint32_t count); // New
99
-/*FORCE_INLINE static void HAL_timer_set_count(const uint8_t timer_num, const hal_timer_t count) {
100
-  // To do ??
101
-}*/
102
-
103
 void HAL_timer_isr_prologue(const uint8_t timer_num);
98
 void HAL_timer_isr_prologue(const uint8_t timer_num);
104
 
99
 
105
 #endif // _HAL_TIMERS_STM32F7_H
100
 #endif // _HAL_TIMERS_STM32F7_H

+ 0
- 7
Marlin/src/HAL/HAL_TEENSY35_36/HAL_timers_Teensy.h 查看文件

95
   return 0;
95
   return 0;
96
 }
96
 }
97
 
97
 
98
-FORCE_INLINE static void HAL_timer_set_count(const uint8_t timer_num, const hal_timer_t count) {
99
-  switch (timer_num) {
100
-    case 0: FTM0_CNT = count;
101
-    case 1: FTM1_CNT = count;
102
-  }
103
-}
104
-
105
 FORCE_INLINE static hal_timer_t HAL_timer_get_count(const uint8_t timer_num) {
98
 FORCE_INLINE static hal_timer_t HAL_timer_get_count(const uint8_t timer_num) {
106
   switch (timer_num) {
99
   switch (timer_num) {
107
     case 0: return FTM0_CNT;
100
     case 0: return FTM0_CNT;

+ 1
- 1
Marlin/src/core/macros.h 查看文件

46
 #define _O3          __attribute__((optimize("O3")))
46
 #define _O3          __attribute__((optimize("O3")))
47
 
47
 
48
 // Clock speed factors
48
 // Clock speed factors
49
-#ifndef CYCLES_PER_MICROSECOND
49
+#if !defined(CYCLES_PER_MICROSECOND) && !defined(__STM32F1__)
50
   #define CYCLES_PER_MICROSECOND (F_CPU / 1000000L) // 16 or 20 on AVR
50
   #define CYCLES_PER_MICROSECOND (F_CPU / 1000000L) // 16 or 20 on AVR
51
 #endif
51
 #endif
52
 
52
 

+ 1
- 1
Marlin/src/pins/pins_STM32F1R.h 查看文件

20
  *
20
  *
21
  */
21
  */
22
 
22
 
23
-#if !defined(__STM32F1__)
23
+#ifndef __STM32F1__
24
     #error "Oops!  Make sure you have an STM32F1 board selected from the 'Tools -> Boards' menu."
24
     #error "Oops!  Make sure you have an STM32F1 board selected from the 'Tools -> Boards' menu."
25
 #endif
25
 #endif
26
 
26
 

正在加载...
取消
保存