diff --git a/Marlin/src/MarlinCore.cpp b/Marlin/src/MarlinCore.cpp index 0ea1a22fd8..7230b5389d 100644 --- a/Marlin/src/MarlinCore.cpp +++ b/Marlin/src/MarlinCore.cpp @@ -181,6 +181,11 @@ #include "libs/L64XX/L64XX_Marlin.h" #endif +#ifdef MKS_WIFI + #include "module/mks_wifi/mks_wifi.h" +#endif + + const char NUL_STR[] PROGMEM = "", M112_KILL_STR[] PROGMEM = "M112 Shutdown", G28_STR[] PROGMEM = "G28", @@ -926,7 +931,7 @@ void setup() { SERIAL_ECHOLNPGM("start"); SERIAL_ECHO_START(); - #if HAS_TMC_SPI + #if HAS_TMC_SPI #if DISABLED(TMC_USE_SW_SPI) SPI.begin(); #endif @@ -975,7 +980,7 @@ void setup() { }; #define SETUP_LOG(M) log_current_ms(PSTR(M)) #else - #define SETUP_LOG(...) NOOP + #define SETUP_LOG(C) DEBUG(C) #endif #define SETUP_RUN(C) do{ SETUP_LOG(STRINGIFY(C)); C; }while(0) @@ -1183,6 +1188,10 @@ void setup() { SETUP_RUN(max7219.init()); #endif + #if ENABLED(MKS_WIFI) + mks_wifi_init(); + #endif + marlin_state = MF_RUNNING; SETUP_LOG("setup() completed."); diff --git a/Marlin/src/module/mks_wifi/mks_wifi.cpp b/Marlin/src/module/mks_wifi/mks_wifi.cpp new file mode 100644 index 0000000000..730239dba7 --- /dev/null +++ b/Marlin/src/module/mks_wifi/mks_wifi.cpp @@ -0,0 +1,15 @@ +#include "mks_wifi.h" + +void mks_wifi_init(void){ + DEBUG("Init MKS WIFI"); + SET_INPUT_PULLUP(MKS_WIFI_IO0); + attachInterrupt(MKS_WIFI_IO0, mks_wifi_io0_irq, FALLING); +} + + +void mks_wifi_io0_irq(void){ + + INFO("IO0 Irq"); + +} + diff --git a/Marlin/src/module/mks_wifi/mks_wifi.h b/Marlin/src/module/mks_wifi/mks_wifi.h new file mode 100644 index 0000000000..31241dd43a --- /dev/null +++ b/Marlin/src/module/mks_wifi/mks_wifi.h @@ -0,0 +1,13 @@ +#ifndef MKS_WIFI_H +#define MKS_WIFI_H + +#include "../../MarlinCore.h" +#include "../../inc/MarlinConfig.h" +#include "../../libs/Segger/log.h" + +void mks_wifi_init(void); +void mks_wifi_io0_irq(void); + + + +#endif \ No newline at end of file