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