My Marlin configs for Fabrikator Mini and CTC i3 Pro B
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

compat.h 2.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /************
  2. * compat.h *
  3. ************/
  4. /****************************************************************************
  5. * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. *
  6. * *
  7. * This program is free software: you can redistribute it and/or modify *
  8. * it under the terms of the GNU General Public License as published by *
  9. * the Free Software Foundation, either version 3 of the License, or *
  10. * (at your option) any later version. *
  11. * *
  12. * This program is distributed in the hope that it will be useful, *
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of *
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
  15. * GNU General Public License for more details. *
  16. * *
  17. * To view a copy of the GNU General Public License, go to the following *
  18. * location: <http://www.gnu.org/licenses/>. *
  19. ****************************************************************************/
  20. #pragma once
  21. /**
  22. * This following provides compatibility whether compiling
  23. * as a part of Marlin or outside it
  24. */
  25. #if defined __has_include
  26. #if __has_include ("../../ui_api.h")
  27. #include "../../ui_api.h"
  28. #endif
  29. #else
  30. #include "../../ui_api.h"
  31. #endif
  32. #ifdef __MARLIN_FIRMWARE__
  33. // If __MARLIN_FIRMWARE__ exists, then we are being
  34. // compiled inside Marlin.
  35. #include "pin_mappings.h"
  36. #else
  37. // Messages that are declared in Marlin
  38. #define WELCOME_MSG "Printer Ready"
  39. #define MSG_SD_INSERTED "Media Inserted"
  40. #define MSG_SD_REMOVED "Media Removed"
  41. // Define macros for compatibility
  42. #define EXTENSIBLE_UI
  43. #define _CAT(a, ...) a ## __VA_ARGS__
  44. #define SWITCH_ENABLED_ 1
  45. #define ENABLED(b) _CAT(SWITCH_ENABLED_, b)
  46. #define DISABLED(b) !ENABLED(b)
  47. namespace UI {
  48. static inline uint32_t safe_millis() {return millis();};
  49. static inline void yield() {};
  50. };
  51. #endif
  52. class __FlashStringHelper;
  53. typedef const __FlashStringHelper *progmem_str;