2019-08-16 23:34:13 +00:00
|
|
|
/************
|
|
|
|
* compat.h *
|
|
|
|
************/
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Written By Marcio Teixeira 2018 - Aleph Objects, Inc. *
|
|
|
|
* *
|
|
|
|
* This program is free software: you can redistribute it and/or modify *
|
|
|
|
* it under the terms of the GNU General Public License as published by *
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or *
|
|
|
|
* (at your option) any later version. *
|
|
|
|
* *
|
|
|
|
* This program is distributed in the hope that it will be useful, *
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
|
|
|
* GNU General Public License for more details. *
|
|
|
|
* *
|
|
|
|
* To view a copy of the GNU General Public License, go to the following *
|
2020-11-07 01:09:29 +00:00
|
|
|
* location: <https://www.gnu.org/licenses/>. *
|
2019-08-16 23:34:13 +00:00
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This following provides compatibility whether compiling
|
|
|
|
* as a part of Marlin or outside it
|
|
|
|
*/
|
|
|
|
|
2019-08-24 06:42:38 +00:00
|
|
|
#ifdef __has_include
|
2021-05-06 09:17:59 +00:00
|
|
|
#if __has_include("../ui_api.h")
|
|
|
|
#include "../ui_api.h"
|
2019-08-16 23:34:13 +00:00
|
|
|
#endif
|
|
|
|
#else
|
2021-05-06 09:17:59 +00:00
|
|
|
#include "../ui_api.h"
|
2019-08-16 23:34:13 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef __MARLIN_FIRMWARE__
|
2019-08-21 09:48:06 +00:00
|
|
|
// __MARLIN_FIRMWARE__ exists when compiled within Marlin.
|
|
|
|
#include "pin_mappings.h"
|
2020-02-14 13:18:57 +00:00
|
|
|
#undef max
|
|
|
|
#define max(a,b) ((a)>(b)?(a):(b))
|
|
|
|
#undef min
|
|
|
|
#define min(a,b) ((a)<(b)?(a):(b))
|
2019-08-16 23:34:13 +00:00
|
|
|
#else
|
|
|
|
namespace UI {
|
2021-12-28 08:57:24 +00:00
|
|
|
static uint32_t safe_millis() { return millis(); }
|
|
|
|
static void yield() {}
|
2019-08-16 23:34:13 +00:00
|
|
|
};
|
|
|
|
#endif
|
|
|
|
|
|
|
|
class __FlashStringHelper;
|
2021-09-25 07:27:07 +00:00
|
|
|
typedef const __FlashStringHelper *FSTR_P;
|
2021-01-30 05:41:45 +00:00
|
|
|
extern const char G28_STR[];
|