Giuliano Zaro 5 лет назад
Родитель
Сommit
c16818b261
Аккаунт пользователя с таким Email не найден
2 измененных файлов: 8 добавлений и 4 удалений
  1. 4
    4
      Marlin/src/HAL/SAMD51/Servo.cpp
  2. 4
    0
      Marlin/src/HAL/SAMD51/inc/SanityCheck.h

+ 4
- 4
Marlin/src/HAL/SAMD51/Servo.cpp Просмотреть файл

@@ -55,7 +55,7 @@
55 55
 static volatile int8_t currentServoIndex[_Nbr_16timers];    // index for the servo being pulsed for each timer (or -1 if refresh interval)
56 56
 
57 57
 FORCE_INLINE static uint16_t getTimerCount() {
58
-  Tc * const tc = TimerConfig[SERVO_TC].pTimer;
58
+  Tc * const tc = TimerConfig[SERVO_TC].pTc;
59 59
 
60 60
   tc->COUNT16.CTRLBSET.reg = TC_CTRLBCLR_CMD_READSYNC;
61 61
   SYNC(tc->COUNT16.SYNCBUSY.bit.CTRLB || tc->COUNT16.SYNCBUSY.bit.COUNT);
@@ -67,7 +67,7 @@ FORCE_INLINE static uint16_t getTimerCount() {
67 67
 // Interrupt handler for the TC
68 68
 // ----------------------------
69 69
 HAL_SERVO_TIMER_ISR() {
70
-  Tc * const tc = TimerConfig[SERVO_TC].pTimer;
70
+  Tc * const tc = TimerConfig[SERVO_TC].pTc;
71 71
   const timer16_Sequence_t timer =
72 72
     #ifndef _useTimer1
73 73
       _timer2
@@ -127,7 +127,7 @@ HAL_SERVO_TIMER_ISR() {
127 127
 }
128 128
 
129 129
 void initISR(timer16_Sequence_t timer) {
130
-  Tc * const tc = TimerConfig[SERVO_TC].pTimer;
130
+  Tc * const tc = TimerConfig[SERVO_TC].pTc;
131 131
   const uint8_t tcChannel = TIMER_TCCHANNEL(timer);
132 132
 
133 133
   static bool initialized = false;  // Servo TC has been initialized
@@ -204,7 +204,7 @@ void initISR(timer16_Sequence_t timer) {
204 204
 }
205 205
 
206 206
 void finISR(timer16_Sequence_t timer) {
207
-  Tc * const tc = TimerConfig[SERVO_TC].pTimer;
207
+  Tc * const tc = TimerConfig[SERVO_TC].pTc;
208 208
   const uint8_t tcChannel = TIMER_TCCHANNEL(timer);
209 209
 
210 210
   // Disable the match channel interrupt request

+ 4
- 0
Marlin/src/HAL/SAMD51/inc/SanityCheck.h Просмотреть файл

@@ -35,6 +35,10 @@
35 35
   #error "OnBoard SPI BUS can't be shared with other devices."
36 36
 #endif
37 37
 
38
+#if SERVO_TC == RTC_TIMER_NUM
39
+  #error "Servos can't use RTC timer"
40
+#endif
41
+
38 42
 #if ENABLED(EMERGENCY_PARSER)
39 43
   #error "EMERGENCY_PARSER is not yet implemented for SAMD51. Disable EMERGENCY_PARSER to continue."
40 44
 #endif

Загрузка…
Отмена
Сохранить