Browse Source

More explicit LPC timer defines

Scott Lahteine 5 years ago
parent
commit
306578d7be
1 changed files with 10 additions and 10 deletions
  1. 10
    10
      Marlin/src/HAL/LPC1768/timers.h

+ 10
- 10
Marlin/src/HAL/LPC1768/timers.h View File

88
 #define HAL_TEMP_TIMER_ISR() _HAL_TIMER_ISR(TEMP_TIMER_NUM)
88
 #define HAL_TEMP_TIMER_ISR() _HAL_TIMER_ISR(TEMP_TIMER_NUM)
89
 
89
 
90
 // Timer references by index
90
 // Timer references by index
91
-#define STEP_TIMER _HAL_TIMER(STEP_TIMER_NUM)
92
-#define TEMP_TIMER _HAL_TIMER(TEMP_TIMER_NUM)
91
+#define STEP_TIMER_PTR _HAL_TIMER(STEP_TIMER_NUM)
92
+#define TEMP_TIMER_PTR _HAL_TIMER(TEMP_TIMER_NUM)
93
 
93
 
94
 // ------------------------
94
 // ------------------------
95
 // Public functions
95
 // Public functions
99
 
99
 
100
 FORCE_INLINE static void HAL_timer_set_compare(const uint8_t timer_num, const hal_timer_t compare) {
100
 FORCE_INLINE static void HAL_timer_set_compare(const uint8_t timer_num, const hal_timer_t compare) {
101
   switch (timer_num) {
101
   switch (timer_num) {
102
-    case 0: STEP_TIMER->MR0 = compare; break; // Stepper Timer Match Register 0
103
-    case 1: TEMP_TIMER->MR0 = compare; break; //    Temp Timer Match Register 0
102
+    case 0: STEP_TIMER_PTR->MR0 = compare; break; // Stepper Timer Match Register 0
103
+    case 1: TEMP_TIMER_PTR->MR0 = compare; break; //    Temp Timer Match Register 0
104
   }
104
   }
105
 }
105
 }
106
 
106
 
107
 FORCE_INLINE static hal_timer_t HAL_timer_get_compare(const uint8_t timer_num) {
107
 FORCE_INLINE static hal_timer_t HAL_timer_get_compare(const uint8_t timer_num) {
108
   switch (timer_num) {
108
   switch (timer_num) {
109
-    case 0: return STEP_TIMER->MR0; // Stepper Timer Match Register 0
110
-    case 1: return TEMP_TIMER->MR0; //    Temp Timer Match Register 0
109
+    case 0: return STEP_TIMER_PTR->MR0; // Stepper Timer Match Register 0
110
+    case 1: return TEMP_TIMER_PTR->MR0; //    Temp Timer Match Register 0
111
   }
111
   }
112
   return 0;
112
   return 0;
113
 }
113
 }
114
 
114
 
115
 FORCE_INLINE static hal_timer_t HAL_timer_get_count(const uint8_t timer_num) {
115
 FORCE_INLINE static hal_timer_t HAL_timer_get_count(const uint8_t timer_num) {
116
   switch (timer_num) {
116
   switch (timer_num) {
117
-    case 0: return STEP_TIMER->TC; // Stepper Timer Count
118
-    case 1: return TEMP_TIMER->TC; //    Temp Timer Count
117
+    case 0: return STEP_TIMER_PTR->TC; // Stepper Timer Count
118
+    case 1: return TEMP_TIMER_PTR->TC; //    Temp Timer Count
119
   }
119
   }
120
   return 0;
120
   return 0;
121
 }
121
 }
154
 
154
 
155
 FORCE_INLINE static void HAL_timer_isr_prologue(const uint8_t timer_num) {
155
 FORCE_INLINE static void HAL_timer_isr_prologue(const uint8_t timer_num) {
156
   switch (timer_num) {
156
   switch (timer_num) {
157
-    case 0: SBI(STEP_TIMER->IR, SBIT_CNTEN); break;
158
-    case 1: SBI(TEMP_TIMER->IR, SBIT_CNTEN); break;
157
+    case 0: SBI(STEP_TIMER_PTR->IR, SBIT_CNTEN); break;
158
+    case 1: SBI(TEMP_TIMER_PTR->IR, SBIT_CNTEN); break;
159
   }
159
   }
160
 }
160
 }
161
 
161
 

Loading…
Cancel
Save