1
0
mirror of https://github.com/bdring/Grbl_Esp32.git synced 2025-09-03 19:32:39 +02:00

Fix #386 - Arduino compiling problem

The core fix was to remove the redundant includes of grbl.h
from the individual spindle.cpp files.  Since those files
are inlined into Grbl_Esp32.ino via nested includes, the
top level include of grbl.h in the .ino covers them.

I also did some cleanups:
- renaming tools/ to Spindles/ .  While "tools" is a good
   name in the CNC domain, meaning "toolheads", in the
   software domain it typically means "ancillary programs
   used for building the software"
- Added a "#pragma once" to grbl.h just in case; it had
   no header guard.
- Removed a duplicate #include grbl.h from stepper.cpp
- Deleted some trailing whitespace
- Fixed missing newline at the end of some files
This commit is contained in:
Mitch Bradley
2020-04-28 08:27:02 -10:00
parent c0c27a3fbd
commit cc200cf8e2
12 changed files with 47 additions and 69 deletions

View File

@@ -21,7 +21,7 @@
#include "grbl.h"
#include "WiFi.h"
#include "tools/SpindleClass.cpp"
#include "Spindles/SpindleClass.cpp"
// Declare system global variable structure
system_t sys;

View File

@@ -38,9 +38,6 @@
*/
#include "grbl.h"
#include "SpindleClass.h"
// don't change these
#define BESC_PWM_FREQ 50.0f // Hz
#define BESC_PWM_BIT_PRECISION 16 // bits

View File

@@ -22,9 +22,6 @@
*/
#include "grbl.h"
#include "SpindleClass.h"
// ======================================== DacSpindle ======================================
void DacSpindle :: init() {
get_pins_and_settings();

View File

@@ -44,8 +44,6 @@
Add periodic pinging of VFD in run mode to see if it is still at correct RPM
*/
#include "grbl.h"
#include "SpindleClass.h"
#include "driver/uart.h"
#define HUANYANG_ADDR 0x01

View File

@@ -20,9 +20,6 @@
*/
#include "grbl.h"
#include "SpindleClass.h"
// ===================================== Laser ==============================================

View File

@@ -19,8 +19,6 @@
along with Grbl. If not, see <http://www.gnu.org/licenses/>.
*/
#include "grbl.h"
#include "SpindleClass.h"
// ======================= NullSpindle ==============================
// NullSpindle is just bunch of do nothing (ignore) methods to be used when you don't want a spindle

View File

@@ -19,8 +19,6 @@
along with Grbl. If not, see <http://www.gnu.org/licenses/>.
*/
#include "grbl.h"
#include "SpindleClass.h"
// ======================= PWMSpindle ==============================
/*

View File

@@ -19,8 +19,6 @@
along with Grbl. If not, see <http://www.gnu.org/licenses/>.
*/
#include "grbl.h"
#include "SpindleClass.h"
// ========================= RelaySpindle ==================================
/*

View File

@@ -32,8 +32,6 @@
SPINDLE_DIR_PIN
*/
#include "grbl.h"
#include "SpindleClass.h"
#include "NullSpindle.cpp"
#include "PWMSpindle.cpp"
#include "DacSpindle.cpp"
@@ -95,5 +93,3 @@ void Spindle :: spindle_sync(uint8_t state, float rpm) {
protocol_buffer_synchronize(); // Empty planner buffer to ensure spindle is set when programmed.
set_state(state, rpm);
}

View File

@@ -38,7 +38,7 @@
#ifndef SPINDLE_CLASS_H
#define SPINDLE_CLASS_H
#include "grbl.h"
#include "../grbl.h"
#include <driver/dac.h>
#include "driver/uart.h"

View File

@@ -18,6 +18,7 @@
along with Grbl. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
// Grbl versioning system
#define GRBL_VERSION "1.2a"
@@ -53,7 +54,7 @@
#include "protocol.h"
#include "report.h"
#include "serial.h"
#include "tools/SpindleClass.h"
#include "Spindles/SpindleClass.h"
#include "stepper.h"
#include "jog.h"
#include "inputbuffer.h"

View File

@@ -1,5 +1,3 @@
#include "grbl.h"
/*
stepper.c - stepper motor driver: executes motion plans using stepper motors
Part of Grbl