1
0
mirror of https://github.com/bdring/Grbl_Esp32.git synced 2025-08-31 18:11:48 +02:00

Eliminated MachineCommon.h

It had only a few consts that were either unnecessary or module
specific.  I eliminated the former and moved the latter.
This commit is contained in:
Mitch Bradley
2021-07-01 14:03:42 -10:00
parent a06ea69af4
commit 5e698f2a09
6 changed files with 6 additions and 25 deletions

View File

@@ -48,13 +48,6 @@ Some features should not be changed. See notes below.
const int SUPPORT_TASK_CORE = 1; // Reference: CONFIG_ARDUINO_RUNNING_CORE = 1
// Include the file that loads the machine-specific config file.
// machine.h must be edited to choose the desired file.
#include "Machine.h"
// machine_common.h contains settings that do not change
#include "MachineCommon.h"
const int MAX_N_AXIS = 6;
// Serial baud rate

View File

@@ -254,8 +254,8 @@ void limits_go_home(uint8_t cycle_mask, uint32_t n_locate_cycles) {
break;
}
}
} while (STEP_MASK & axislock);
} while (axislock);
if (config->_stepType == ST_I2S_STREAM) {
if (!approach) {
delay_ms(I2S_OUT_DELAY_MS);

View File

@@ -1,15 +0,0 @@
#pragma once
// Grbl setting that are common to all machines
// It should not be necessary to change anything herein
const int32_t GRBL_SPI_FREQ = 4000000;
// ESP32 CPU Settings
const uint32_t fTimers = 80000000; // a reference to the speed of ESP32 timers
// =============== Don't change or comment these out ======================
// They are for legacy purposes and will not affect your I/O
const int STEP_MASK = 0x3F; // 111111
const int PROBE_MASK = 1;

View File

@@ -163,9 +163,8 @@ SDCard::State SDCard::get_state(bool refresh) {
_state = SDCard::State::NotPresent;
//using default value for speed ? should be parameter
//refresh content if card was removed
if (SD.begin(csPin, SPI, GRBL_SPI_FREQ, "/sd", 2)) {
if (SD.begin(csPin, SPI, SPIfreq, "/sd", 2)) {
if (SD.cardSize() > 0) {
_state = SDCard::State::Idle;
}

View File

@@ -26,6 +26,9 @@ namespace fs {
class FS;
}
// XXX This should be a configuration parameter of the SPI bus
const int32_t SPIfreq = 4000000;
class SDCard : public Configuration::Configurable {
public:
enum class State : uint8_t {

View File

@@ -24,6 +24,7 @@ struct PrepFlag {
};
// fStepperTimer should be an integer divisor of the bus speed, i.e. of fTimers
const uint32_t fTimers = 80000000; // the frequency of ESP32 timers
const uint32_t fStepperTimer = 20000000; // frequency of step pulse timer
const int ticksPerMicrosecond = fStepperTimer / 1000000;