Browse Source

Merge pull request #4721 from thinkyhead/rc_temperature_isr_comments

Rc temperature isr comments
Scott Lahteine 9 years ago
parent
commit
7e893f4309
3 changed files with 21 additions and 3 deletions
  1. 2
    1
      Marlin/enum.h
  2. 11
    0
      Marlin/planner.cpp
  3. 8
    2
      Marlin/temperature.cpp

+ 2
- 1
Marlin/enum.h View File

70
   DEBUG_ERRORS        = _BV(2), ///< Not implemented
70
   DEBUG_ERRORS        = _BV(2), ///< Not implemented
71
   DEBUG_DRYRUN        = _BV(3), ///< Ignore temperature setting and E movement commands
71
   DEBUG_DRYRUN        = _BV(3), ///< Ignore temperature setting and E movement commands
72
   DEBUG_COMMUNICATION = _BV(4), ///< Not implemented
72
   DEBUG_COMMUNICATION = _BV(4), ///< Not implemented
73
-  DEBUG_LEVELING      = _BV(5)  ///< Print detailed output for homing and leveling
73
+  DEBUG_LEVELING      = _BV(5), ///< Print detailed output for homing and leveling
74
+  DEBUG_ALL           = 0xFF
74
 };
75
 };
75
 
76
 
76
 enum EndstopEnum {
77
 enum EndstopEnum {

+ 11
- 0
Marlin/planner.cpp View File

567
        dy = target[Y_AXIS] - position[Y_AXIS],
567
        dy = target[Y_AXIS] - position[Y_AXIS],
568
        dz = target[Z_AXIS] - position[Z_AXIS];
568
        dz = target[Z_AXIS] - position[Z_AXIS];
569
 
569
 
570
+  /*
571
+  SERIAL_ECHO_START;
572
+  SERIAL_ECHOPAIR("Planner X:", x);
573
+  SERIAL_ECHOPAIR(" (", dx);
574
+  SERIAL_ECHOPAIR(") Y:", y);
575
+  SERIAL_ECHOPAIR(" (", dy);
576
+  SERIAL_ECHOPAIR(") Z:", z);
577
+  SERIAL_ECHOPAIR(" (", dz);
578
+  SERIAL_ECHOLNPGM(")");
579
+  //*/
580
+
570
   // DRYRUN ignores all temperature constraints and assures that the extruder is instantly satisfied
581
   // DRYRUN ignores all temperature constraints and assures that the extruder is instantly satisfied
571
   if (DEBUGGING(DRYRUN))
582
   if (DEBUGGING(DRYRUN))
572
     position[E_AXIS] = target[E_AXIS];
583
     position[E_AXIS] = target[E_AXIS];

+ 8
- 2
Marlin/temperature.cpp View File

1399
 }
1399
 }
1400
 
1400
 
1401
 /**
1401
 /**
1402
- * Timer 0 is shared with millies
1402
+ * Timer 0 is shared with millies so don't change the prescaler.
1403
+ *
1404
+ * This ISR uses the compare method so it runs at the base
1405
+ * frequency (16 MHz / 256 = 62500 Hz), but at the TCNT0 set
1406
+ * in OCR0B above (128 or halfway between OVFs).
1407
+ *
1403
  *  - Manage PWM to all the heaters and fan
1408
  *  - Manage PWM to all the heaters and fan
1404
  *  - Update the raw temperature values
1409
  *  - Update the raw temperature values
1405
  *  - Check new temperature values for MIN/MAX errors
1410
  *  - Check new temperature values for MIN/MAX errors
1515
       #endif
1520
       #endif
1516
     #endif
1521
     #endif
1517
 
1522
 
1523
+    // 488.28 Hz (or 1:976.56, 2:1953.12, 3:3906.25, 4:7812.5, 5:7812.5 6:15625, 6:15625 7:31250)
1518
     pwm_count += _BV(SOFT_PWM_SCALE);
1524
     pwm_count += _BV(SOFT_PWM_SCALE);
1519
     pwm_count &= 0x7f;
1525
     pwm_count &= 0x7f;
1520
 
1526
 
1523
     /**
1529
     /**
1524
      * SLOW PWM HEATERS
1530
      * SLOW PWM HEATERS
1525
      *
1531
      *
1526
-     * for heaters drived by relay
1532
+     * For relay-driven heaters
1527
      */
1533
      */
1528
     #ifndef MIN_STATE_TIME
1534
     #ifndef MIN_STATE_TIME
1529
       #define MIN_STATE_TIME 16 // MIN_STATE_TIME * 65.5 = time in milliseconds
1535
       #define MIN_STATE_TIME 16 // MIN_STATE_TIME * 65.5 = time in milliseconds

Loading…
Cancel
Save