Browse Source

Drop HAL_timer_set_count

Scott Lahteine 7 years ago
parent
commit
a810e585db

+ 0
- 1
Marlin/src/HAL/HAL_AVR/HAL_AVR.h View File

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 View File

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 View File

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 View File

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 View File

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 View File

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 View File

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;

Loading…
Cancel
Save