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.

compat.h 1.9KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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: <https://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. #ifdef __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. // __MARLIN_FIRMWARE__ exists when compiled within Marlin.
  34. #include "pin_mappings.h"
  35. #undef max
  36. #define max(a,b) ((a)>(b)?(a):(b))
  37. #undef min
  38. #define min(a,b) ((a)<(b)?(a):(b))
  39. #else
  40. namespace UI {
  41. static uint32_t safe_millis() { return millis(); }
  42. static void yield() {}
  43. };
  44. #endif
  45. class __FlashStringHelper;
  46. typedef const __FlashStringHelper *FSTR_P;
  47. extern const char G28_STR[];