mirror of
https://github.com/bdring/Grbl_Esp32.git
synced 2025-08-24 15:13:02 +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_m30() {}
|
||||||
|
|
||||||
void WEAK_FUNC user_tool_change(uint8_t new_tool) {}
|
void WEAK_FUNC user_tool_change(uint8_t new_tool) {}
|
||||||
|
|
||||||
#ifdef NATIVE
|
#ifdef NATIVE
|
||||||
// setup() and loop() in the Arduino .ino implements this control flow:
|
// setup() and loop() in the Arduino .ino implements this control flow:
|
||||||
|
|
||||||
# ifdef EMIT_YAML
|
void setup() {
|
||||||
# include "System.h"
|
grbl_init();
|
||||||
# endif
|
}
|
||||||
int main(int arc, char** argv) {
|
void loop() {
|
||||||
grbl_init(); // setup()
|
|
||||||
# ifdef EMIT_YAML
|
# ifdef EMIT_YAML
|
||||||
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();
|
Uart0.flush();
|
||||||
|
exit(0);
|
||||||
# else
|
# else
|
||||||
while (1) { // loop()
|
|
||||||
run_once();
|
run_once();
|
||||||
}
|
|
||||||
# endif
|
# endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -97,7 +97,7 @@ namespace Motors {
|
|||||||
bool set_homing_mode(bool is_homing) override;
|
bool set_homing_mode(bool is_homing) override;
|
||||||
void set_disable(bool disable) 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;
|
uint8_t addr;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user