mirror of
https://github.com/bdring/Grbl_Esp32.git
synced 2025-08-24 07:03:01 +02:00
Cleaner code for setup() and loop()
This commit is contained in:
@@ -134,23 +134,23 @@ void WEAK_FUNC display_init() {}
|
||||
void WEAK_FUNC user_m30() {}
|
||||
|
||||
void WEAK_FUNC user_tool_change(uint8_t new_tool) {}
|
||||
|
||||
#ifdef NATIVE
|
||||
// setup() and loop() in the Arduino .ino implements this control flow:
|
||||
|
||||
# ifdef EMIT_YAML
|
||||
# include "System.h"
|
||||
# endif
|
||||
int main(int arc, char** argv) {
|
||||
grbl_init(); // setup()
|
||||
void setup() {
|
||||
grbl_init();
|
||||
}
|
||||
void loop() {
|
||||
# ifdef EMIT_YAML
|
||||
char line[10];
|
||||
strcpy(line, "$cd");
|
||||
system_execute_line(line, uint8_t(CLIENT_SERIAL), WebUI::AuthenticationLevel::LEVEL_ADMIN);
|
||||
Uart0.flush();
|
||||
exit(0);
|
||||
# else
|
||||
while (1) { // loop()
|
||||
run_once();
|
||||
}
|
||||
# endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@@ -97,7 +97,7 @@ namespace Motors {
|
||||
bool set_homing_mode(bool is_homing) override;
|
||||
void set_disable(bool disable) override;
|
||||
|
||||
const char* name() override { return _driver_part_number == 2008 ? "tmc_2008" : "tmc_2009"; }
|
||||
const char* name() override { return _driver_part_number == 2208 ? "tmc_2208" : "tmc_2209"; }
|
||||
|
||||
uint8_t addr;
|
||||
|
||||
|
Reference in New Issue
Block a user