mirror of
https://github.com/bdring/Grbl_Esp32.git
synced 2025-08-30 09:39:49 +02:00
Various cleanups; working pretty well now
This commit is contained in:
@@ -309,9 +309,16 @@ void print_axes() {
|
|||||||
}
|
}
|
||||||
end_section();
|
end_section();
|
||||||
}
|
}
|
||||||
|
const char* engine_names[] = {
|
||||||
|
"Timed",
|
||||||
|
"RMT",
|
||||||
|
"I2S_stream",
|
||||||
|
"I2S_static",
|
||||||
|
};
|
||||||
|
|
||||||
void print_stepping() {
|
void print_stepping() {
|
||||||
section("stepping");
|
section("stepping");
|
||||||
item("engine", stepper_names[current_stepper]);
|
item("engine", engine_names[current_stepper]);
|
||||||
item("idle_ms", stepper_idle_lock_time->get());
|
item("idle_ms", stepper_idle_lock_time->get());
|
||||||
item("pulse_us", pulse_microseconds->get());
|
item("pulse_us", pulse_microseconds->get());
|
||||||
item("dir_delay_us", direction_delay_microseconds->get());
|
item("dir_delay_us", direction_delay_microseconds->get());
|
||||||
@@ -497,7 +504,6 @@ void print_spindle(const char* name, Spindle* s) {
|
|||||||
item("spindown_ms", s->_spindown_delay);
|
item("spindown_ms", s->_spindown_delay);
|
||||||
item("tool", int(0));
|
item("tool", int(0));
|
||||||
item("speeds", makeSpeedMap(static_cast<PWM*>(s)));
|
item("speeds", makeSpeedMap(static_cast<PWM*>(s)));
|
||||||
end_section();
|
|
||||||
}
|
}
|
||||||
void print_onoff_spindle(const char* name, PWM* s) {
|
void print_onoff_spindle(const char* name, PWM* s) {
|
||||||
print_spindle(name, s);
|
print_spindle(name, s);
|
||||||
@@ -510,7 +516,6 @@ void print_onoff_spindle(const char* name, PWM* s) {
|
|||||||
void print_pwm_spindle(const char* name, PWM* s) {
|
void print_pwm_spindle(const char* name, PWM* s) {
|
||||||
print_onoff_spindle(name, s);
|
print_onoff_spindle(name, s);
|
||||||
item("pwm_freq", s->_pwm_freq);
|
item("pwm_freq", s->_pwm_freq);
|
||||||
end_section();
|
|
||||||
}
|
}
|
||||||
void print_relay_spindle(Relay* s) {
|
void print_relay_spindle(Relay* s) {
|
||||||
print_onoff_spindle("relay", s);
|
print_onoff_spindle("relay", s);
|
||||||
@@ -605,6 +610,7 @@ void print_spindle_class() {
|
|||||||
break;
|
break;
|
||||||
case int8_t(SpindleType::PWM):
|
case int8_t(SpindleType::PWM):
|
||||||
print_pwm_spindle("pwm", static_cast<PWM*>(s));
|
print_pwm_spindle("pwm", static_cast<PWM*>(s));
|
||||||
|
end_section();
|
||||||
break;
|
break;
|
||||||
case int8_t(SpindleType::RELAY):
|
case int8_t(SpindleType::RELAY):
|
||||||
print_relay_spindle(static_cast<Relay*>(s));
|
print_relay_spindle(static_cast<Relay*>(s));
|
||||||
@@ -633,12 +639,12 @@ void print_spindle_class() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
void dump_config() {
|
void dump_config() {
|
||||||
|
item("name", MACHINE_NAME);
|
||||||
#ifdef USE_I2S_OUT
|
#ifdef USE_I2S_OUT
|
||||||
item("board", "6-pack");
|
item("board", "6-pack");
|
||||||
#else
|
#else
|
||||||
item("board", "unknown");
|
item("board", "unknown");
|
||||||
#endif
|
#endif
|
||||||
item("name", MACHINE_NAME);
|
|
||||||
print_stepping();
|
print_stepping();
|
||||||
print_axes();
|
print_axes();
|
||||||
print_i2so();
|
print_i2so();
|
||||||
@@ -706,8 +712,3 @@ void dump_config() {
|
|||||||
|
|
||||||
print_spindle_class();
|
print_spindle_class();
|
||||||
}
|
}
|
||||||
#if 0
|
|
||||||
void machine_init() {
|
|
||||||
print_machine();
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
@@ -36,10 +36,10 @@ void grbl_init() {
|
|||||||
#endif
|
#endif
|
||||||
client_init(); // Setup serial baud rate and interrupts
|
client_init(); // Setup serial baud rate and interrupts
|
||||||
display_init();
|
display_init();
|
||||||
|
#ifndef EMIT_YAML
|
||||||
grbl_msg_sendf(CLIENT_SERIAL, MsgLevel::Info, "Grbl_ESP32 Ver %s Date %s", GRBL_VERSION, GRBL_VERSION_BUILD); // print grbl_esp32 verion info
|
grbl_msg_sendf(CLIENT_SERIAL, MsgLevel::Info, "Grbl_ESP32 Ver %s Date %s", GRBL_VERSION, GRBL_VERSION_BUILD); // print grbl_esp32 verion info
|
||||||
grbl_msg_sendf(CLIENT_SERIAL, MsgLevel::Info, "Compiled with ESP32 SDK:%s", ESP.getSdkVersion()); // print the SDK version
|
grbl_msg_sendf(CLIENT_SERIAL, MsgLevel::Info, "Compiled with ESP32 SDK:%s", ESP.getSdkVersion()); // print the SDK version
|
||||||
// show the map name at startup
|
// show the map name at startup
|
||||||
#ifndef EMIT_YAML
|
|
||||||
# ifdef MACHINE_NAME
|
# ifdef MACHINE_NAME
|
||||||
report_machine_type(CLIENT_SERIAL);
|
report_machine_type(CLIENT_SERIAL);
|
||||||
# endif
|
# endif
|
||||||
@@ -146,6 +146,7 @@ int main(int arc, char** argv) {
|
|||||||
char line[10];
|
char line[10];
|
||||||
strcpy(line, "$cd");
|
strcpy(line, "$cd");
|
||||||
system_execute_line(line, uint8_t(CLIENT_SERIAL), WebUI::AuthenticationLevel::LEVEL_ADMIN);
|
system_execute_line(line, uint8_t(CLIENT_SERIAL), WebUI::AuthenticationLevel::LEVEL_ADMIN);
|
||||||
|
Uart0.flush();
|
||||||
# else
|
# else
|
||||||
while (1) { // loop()
|
while (1) { // loop()
|
||||||
run_once();
|
run_once();
|
||||||
|
@@ -111,7 +111,9 @@ void client_init() {
|
|||||||
Uart0.begin(BAUD_RATE, Uart::Data::Bits8, Uart::Stop::Bits1, Uart::Parity::None);
|
Uart0.begin(BAUD_RATE, Uart::Data::Bits8, Uart::Stop::Bits1, Uart::Parity::None);
|
||||||
|
|
||||||
client_reset_read_buffer(CLIENT_ALL);
|
client_reset_read_buffer(CLIENT_ALL);
|
||||||
|
# ifndef NATIVE
|
||||||
Uart0.write("\r\n"); // create some white space after ESP32 boot info
|
Uart0.write("\r\n"); // create some white space after ESP32 boot info
|
||||||
|
# endif
|
||||||
#endif
|
#endif
|
||||||
clientCheckTaskHandle = 0;
|
clientCheckTaskHandle = 0;
|
||||||
// create a task to check for incoming data
|
// create a task to check for incoming data
|
||||||
|
@@ -77,7 +77,9 @@ bool Uart::setHalfDuplex() {
|
|||||||
bool Uart::setPins(int tx_pin, int rx_pin, int rts_pin, int cts_pin) {
|
bool Uart::setPins(int tx_pin, int rx_pin, int rts_pin, int cts_pin) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
void Uart::flush() {}
|
void Uart::flush() {
|
||||||
|
fflush(stdout);
|
||||||
|
}
|
||||||
bool Uart::flushTxTimed(TickType_t ticks) {
|
bool Uart::flushTxTimed(TickType_t ticks) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@@ -28,14 +28,12 @@ def convertMachine(baseName, verbose=True, extraArgs=None):
|
|||||||
print(line, end='')
|
print(line, end='')
|
||||||
app.wait()
|
app.wait()
|
||||||
if app.returncode == 0:
|
if app.returncode == 0:
|
||||||
print()
|
|
||||||
cmd = [ '.pio/build/native/program.exe' ]
|
cmd = [ '.pio/build/native/program.exe' ]
|
||||||
out_filename = "yaml/" + Path(baseName).stem + ".yaml"
|
out_filename = "yaml/" + Path(baseName).stem + ".yaml"
|
||||||
app = subprocess.Popen(cmd, env=env, stdout=open(out_filename, "w"), stderr=subprocess.STDOUT, bufsize=1)
|
app = subprocess.Popen(cmd, env=env, stdout=open(out_filename, "w"), stderr=subprocess.STDOUT, bufsize=1)
|
||||||
app.wait()
|
app.wait()
|
||||||
# return app.returncode
|
return app.returncode
|
||||||
else:
|
else:
|
||||||
out_filename = "yaml/" + Path(baseName).stem + ".ERROR"
|
out_filename = "yaml/" + Path(baseName).stem + ".ERROR"
|
||||||
open(out_filename, "w")
|
open(out_filename, "w")
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user