Browse Source

Merge pull request #4515 from thinkyhead/rc_fix_speaker_tone

Prevent the 'tone(f,d)' function from being interrupted
Scott Lahteine 8 years ago
parent
commit
7ed70305df

+ 0
- 1
Marlin/Marlin.h View File

@@ -215,7 +215,6 @@ void manage_inactivity(bool ignore_stepper_queue = false);
215 215
 /**
216 216
  * The axis order in all axis related arrays is X, Y, Z, E
217 217
  */
218
-#define NUM_AXIS 4
219 218
 #define _AXIS(AXIS) AXIS ##_AXIS
220 219
 
221 220
 void enable_all_steppers();

+ 3
- 1
Marlin/MarlinSerial.cpp View File

@@ -29,10 +29,12 @@
29 29
   Modified 14 February 2016 by Andreas Hardtung (added tx buffer)
30 30
 */
31 31
 
32
-#include "Marlin.h"
33 32
 #include "MarlinSerial.h"
33
+
34 34
 #include "stepper.h"
35 35
 
36
+#include "Marlin.h"
37
+
36 38
 #ifndef USBCON
37 39
 // this next line disables the entire HardwareSerial.cpp,
38 40
 // this is so I can support Attiny series and any other chip without a UART

+ 1
- 6
Marlin/MarlinSerial.h View File

@@ -31,13 +31,8 @@
31 31
 
32 32
 #ifndef MarlinSerial_h
33 33
 #define MarlinSerial_h
34
-#include "Marlin.h"
35
-
36
-#ifndef CRITICAL_SECTION_START
37
-  #define CRITICAL_SECTION_START  unsigned char _sreg = SREG; cli();
38
-  #define CRITICAL_SECTION_END    SREG = _sreg;
39
-#endif
40 34
 
35
+#include "MarlinConfig.h"
41 36
 
42 37
 #ifndef SERIAL_PORT
43 38
   #define SERIAL_PORT 0

+ 1
- 0
Marlin/Marlin_main.cpp View File

@@ -61,6 +61,7 @@
61 61
 #include "math.h"
62 62
 #include "nozzle.h"
63 63
 #include "duration_t.h"
64
+#include "types.h"
64 65
 
65 66
 #if ENABLED(USE_WATCHDOG)
66 67
   #include "watchdog.h"

+ 3
- 0
Marlin/buzzer.h View File

@@ -23,6 +23,7 @@
23 23
 #ifndef __BUZZER_H__
24 24
 #define __BUZZER_H__
25 25
 
26
+#include "types.h"
26 27
 #include "fastio.h"
27 28
 #include "circularqueue.h"
28 29
 #include "temperature.h"
@@ -127,7 +128,9 @@ class Buzzer {
127 128
 
128 129
         if (this->state.tone.frequency > 0) {
129 130
           #if ENABLED(SPEAKER)
131
+            CRITICAL_SECTION_START;
130 132
             ::tone(BEEPER_PIN, this->state.tone.frequency, this->state.tone.duration);
133
+            CRITICAL_SECTION_END;
131 134
           #else
132 135
             this->on();
133 136
           #endif

+ 3
- 1
Marlin/cardreader.cpp View File

@@ -20,13 +20,15 @@
20 20
  *
21 21
  */
22 22
 
23
-#include "Marlin.h"
24 23
 #include "cardreader.h"
24
+
25 25
 #include "ultralcd.h"
26 26
 #include "stepper.h"
27 27
 #include "temperature.h"
28 28
 #include "language.h"
29 29
 
30
+#include "Marlin.h"
31
+
30 32
 #if ENABLED(SDSUPPORT)
31 33
 
32 34
 CardReader::CardReader() {

+ 4
- 0
Marlin/cardreader.h View File

@@ -23,11 +23,15 @@
23 23
 #ifndef CARDREADER_H
24 24
 #define CARDREADER_H
25 25
 
26
+#include "MarlinConfig.h"
27
+
26 28
 #if ENABLED(SDSUPPORT)
27 29
 
28 30
 #define MAX_DIR_DEPTH 10          // Maximum folder depth
29 31
 
30 32
 #include "SdFile.h"
33
+
34
+#include "types.h"
31 35
 #include "enum.h"
32 36
 
33 37
 class CardReader {

+ 2
- 0
Marlin/macros.h View File

@@ -23,6 +23,8 @@
23 23
 #ifndef MACROS_H
24 24
 #define MACROS_H
25 25
 
26
+#define NUM_AXIS 4
27
+
26 28
 #define FORCE_INLINE __attribute__((always_inline)) inline
27 29
 
28 30
 // Bracket code that shouldn't be interrupted

+ 2
- 1
Marlin/planner.cpp View File

@@ -58,13 +58,14 @@
58 58
  *
59 59
  */
60 60
 
61
-#include "Marlin.h"
62 61
 #include "planner.h"
63 62
 #include "stepper.h"
64 63
 #include "temperature.h"
65 64
 #include "ultralcd.h"
66 65
 #include "language.h"
67 66
 
67
+#include "Marlin.h"
68
+
68 69
 #if ENABLED(MESH_BED_LEVELING)
69 70
   #include "mesh_bed_leveling.h"
70 71
 #endif

+ 2
- 1
Marlin/planner.h View File

@@ -32,7 +32,8 @@
32 32
 #ifndef PLANNER_H
33 33
 #define PLANNER_H
34 34
 
35
-#include "Marlin.h"
35
+#include "types.h"
36
+#include "MarlinConfig.h"
36 37
 
37 38
 #if ENABLED(AUTO_BED_LEVELING_FEATURE)
38 39
   #include "vector_3.h"

+ 1
- 0
Marlin/stepper.h View File

@@ -47,6 +47,7 @@
47 47
 #include "speed_lookuptable.h"
48 48
 #include "stepper_indirection.h"
49 49
 #include "language.h"
50
+#include "types.h"
50 51
 
51 52
 class Stepper;
52 53
 extern Stepper stepper;

+ 2
- 1
Marlin/temperature.h View File

@@ -27,10 +27,11 @@
27 27
 #ifndef TEMPERATURE_H
28 28
 #define TEMPERATURE_H
29 29
 
30
-#include "Marlin.h"
31 30
 #include "planner.h"
32 31
 #include "thermistortables.h"
33 32
 
33
+#include "MarlinConfig.h"
34
+
34 35
 #if ENABLED(PID_EXTRUSION_SCALING)
35 36
   #include "stepper.h"
36 37
 #endif

Loading…
Cancel
Save