Bob-the-Kuhn 7 gadus atpakaļ
vecāks
revīzija
9dad534f02
1 mainītis faili ar 8 papildinājumiem un 4 dzēšanām
  1. 8
    4
      Marlin/src/HAL/HAL_LPC1768/LPC1768_PWM.cpp

+ 8
- 4
Marlin/src/HAL/HAL_LPC1768/LPC1768_PWM.cpp Parādīt failu

245
 
245
 
246
   pin = GET_PIN_MAP_PIN(GET_PIN_MAP_INDEX(pin & 0xFF));
246
   pin = GET_PIN_MAP_PIN(GET_PIN_MAP_INDEX(pin & 0xFF));
247
 
247
 
248
-  NVIC_EnableIRQ(PWM1_IRQn);   // ?? fixes compiler problem??  ISR won't start
249
-                               // unless put in an extra "enable"
250
   NVIC_DisableIRQ(PWM1_IRQn);
248
   NVIC_DisableIRQ(PWM1_IRQn);
251
 
249
 
252
   uint8_t slot = 0xFF;
250
   uint8_t slot = 0xFF;
253
   for (uint8_t i = 0; i < NUM_PWMS; i++)         // find slot
251
   for (uint8_t i = 0; i < NUM_PWMS; i++)         // find slot
254
     if (ISR_table[i].pin == pin) { slot = i; break; }
252
     if (ISR_table[i].pin == pin) { slot = i; break; }
255
-  if (slot == 0xFF) return false;    // return error if pin not found
253
+  if (slot == 0xFF) {   // return error if pin not found
254
+    NVIC_EnableIRQ(PWM1_IRQn);
255
+    return false;
256
+  }
256
 
257
 
257
   LPC1768_PWM_update_map_MR();
258
   LPC1768_PWM_update_map_MR();
258
 
259
 
315
   uint8_t slot = 0xFF;
316
   uint8_t slot = 0xFF;
316
   for (uint8_t i = 0; i < NUM_PWMS; i++)         // find slot
317
   for (uint8_t i = 0; i < NUM_PWMS; i++)         // find slot
317
     if (ISR_table[i].pin == pin) { slot = i; break; }
318
     if (ISR_table[i].pin == pin) { slot = i; break; }
318
-  if (slot == 0xFF) return false;    // return error if pin not found
319
+  if (slot == 0xFF) {   // return error if pin not found
320
+    NVIC_EnableIRQ(PWM1_IRQn);
321
+    return false;
322
+  }
319
 
323
 
320
   LPC1768_PWM_update_map_MR();
324
   LPC1768_PWM_update_map_MR();
321
 
325
 

Notiek ielāde…
Atcelt
Saglabāt