Browse Source

Merge pull request #4515 from thinkyhead/rc_fix_speaker_tone

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

+ 0
- 1
Marlin/Marlin.h View File

215
 /**
215
 /**
216
  * The axis order in all axis related arrays is X, Y, Z, E
216
  * The axis order in all axis related arrays is X, Y, Z, E
217
  */
217
  */
218
-#define NUM_AXIS 4
219
 #define _AXIS(AXIS) AXIS ##_AXIS
218
 #define _AXIS(AXIS) AXIS ##_AXIS
220
 
219
 
221
 void enable_all_steppers();
220
 void enable_all_steppers();

+ 3
- 1
Marlin/MarlinSerial.cpp View File

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

+ 1
- 6
Marlin/MarlinSerial.h View File

31
 
31
 
32
 #ifndef MarlinSerial_h
32
 #ifndef MarlinSerial_h
33
 #define MarlinSerial_h
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
 #ifndef SERIAL_PORT
37
 #ifndef SERIAL_PORT
43
   #define SERIAL_PORT 0
38
   #define SERIAL_PORT 0

+ 1
- 0
Marlin/Marlin_main.cpp View File

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

+ 3
- 0
Marlin/buzzer.h View File

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

+ 3
- 1
Marlin/cardreader.cpp View File

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

+ 4
- 0
Marlin/cardreader.h View File

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

+ 2
- 0
Marlin/macros.h View File

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

+ 2
- 1
Marlin/planner.cpp View File

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

+ 2
- 1
Marlin/planner.h View File

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

+ 1
- 0
Marlin/stepper.h View File

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

+ 2
- 1
Marlin/temperature.h View File

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

Loading…
Cancel
Save