My Marlin configs for Fabrikator Mini and CTC i3 Pro B
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

irq_overrid.cpp 1.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /**
  2. * Marlin 3D Printer Firmware
  3. * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
  4. *
  5. * Based on Sprinter and grbl.
  6. * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
  7. *
  8. * This program is free software: you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation, either version 3 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program. If not, see <https://www.gnu.org/licenses/>.
  20. *
  21. */
  22. #include "../../../../inc/MarlinConfigPre.h"
  23. #if HAS_TFT_LVGL_UI
  24. #include "draw_ui.h"
  25. #if ENABLED(USE_WIFI_FUNCTION)
  26. #include "wifiSerial.h"
  27. #include <libmaple/libmaple.h>
  28. #include <libmaple/gpio.h>
  29. #include <libmaple/timer.h>
  30. #include <libmaple/usart.h>
  31. #include <libmaple/ring_buffer.h>
  32. #include "../../../../inc/MarlinConfig.h"
  33. #ifdef __cplusplus
  34. extern "C" { /* C-declarations for C++ */
  35. #endif
  36. #define WIFI_IO1_SET() WRITE(WIFI_IO1_PIN, HIGH);
  37. #define WIFI_IO1_RESET() WRITE(WIFI_IO1_PIN, LOW);
  38. void __irq_usart1(void) {
  39. WIFISERIAL.wifi_usart_irq(USART1_BASE);
  40. if (wifi_link_state == WIFI_TRANS_FILE) {
  41. if (WIFISERIAL.available() == (400)) WIFI_IO1_SET();
  42. if (WIFISERIAL.wifi_rb_is_full()) {
  43. if (esp_state == TRANSFER_IDLE) esp_state = TRANSFERING;
  44. if (storeRcvData(UART_RX_BUFFER_SIZE)) {
  45. if (wifiTransError.flag != 0x1) WIFI_IO1_RESET();
  46. }
  47. else {
  48. WIFI_IO1_SET();
  49. esp_state = TRANSFER_STORE;
  50. }
  51. }
  52. }
  53. }
  54. #ifdef __cplusplus
  55. } /* C-declarations for C++ */
  56. #endif
  57. #endif // USE_WIFI_FUNCTION
  58. #endif // HAS_TFT_LVGL_UI