Merge pull request #4515 from thinkyhead/rc_fix_speaker_tone

Prevent the 'tone(f,d)' function from being interrupted
This commit is contained in:
Scott Lahteine 2016-08-02 21:13:47 -07:00 committed by GitHub
commit 7ed70305df
12 changed files with 24 additions and 12 deletions

View File

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

View File

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

View File

@ -31,13 +31,8 @@
#ifndef MarlinSerial_h
#define MarlinSerial_h
#include "Marlin.h"
#ifndef CRITICAL_SECTION_START
#define CRITICAL_SECTION_START unsigned char _sreg = SREG; cli();
#define CRITICAL_SECTION_END SREG = _sreg;
#endif
#include "MarlinConfig.h"
#ifndef SERIAL_PORT
#define SERIAL_PORT 0

View File

@ -61,6 +61,7 @@
#include "math.h"
#include "nozzle.h"
#include "duration_t.h"
#include "types.h"
#if ENABLED(USE_WATCHDOG)
#include "watchdog.h"

View File

@ -23,6 +23,7 @@
#ifndef __BUZZER_H__
#define __BUZZER_H__
#include "types.h"
#include "fastio.h"
#include "circularqueue.h"
#include "temperature.h"
@ -127,7 +128,9 @@ class Buzzer {
if (this->state.tone.frequency > 0) {
#if ENABLED(SPEAKER)
CRITICAL_SECTION_START;
::tone(BEEPER_PIN, this->state.tone.frequency, this->state.tone.duration);
CRITICAL_SECTION_END;
#else
this->on();
#endif

View File

@ -20,13 +20,15 @@
*
*/
#include "Marlin.h"
#include "cardreader.h"
#include "ultralcd.h"
#include "stepper.h"
#include "temperature.h"
#include "language.h"
#include "Marlin.h"
#if ENABLED(SDSUPPORT)
CardReader::CardReader() {

View File

@ -23,11 +23,15 @@
#ifndef CARDREADER_H
#define CARDREADER_H
#include "MarlinConfig.h"
#if ENABLED(SDSUPPORT)
#define MAX_DIR_DEPTH 10 // Maximum folder depth
#include "SdFile.h"
#include "types.h"
#include "enum.h"
class CardReader {

View File

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

View File

@ -58,13 +58,14 @@
*
*/
#include "Marlin.h"
#include "planner.h"
#include "stepper.h"
#include "temperature.h"
#include "ultralcd.h"
#include "language.h"
#include "Marlin.h"
#if ENABLED(MESH_BED_LEVELING)
#include "mesh_bed_leveling.h"
#endif

View File

@ -32,7 +32,8 @@
#ifndef PLANNER_H
#define PLANNER_H
#include "Marlin.h"
#include "types.h"
#include "MarlinConfig.h"
#if ENABLED(AUTO_BED_LEVELING_FEATURE)
#include "vector_3.h"

View File

@ -47,6 +47,7 @@
#include "speed_lookuptable.h"
#include "stepper_indirection.h"
#include "language.h"
#include "types.h"
class Stepper;
extern Stepper stepper;

View File

@ -27,10 +27,11 @@
#ifndef TEMPERATURE_H
#define TEMPERATURE_H
#include "Marlin.h"
#include "planner.h"
#include "thermistortables.h"
#include "MarlinConfig.h"
#if ENABLED(PID_EXTRUSION_SCALING)
#include "stepper.h"
#endif