|
| 1 | +/** |
| 2 | + * Marlin 3D Printer Firmware |
| 3 | + * Copyright (c) 2021 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] |
| 4 | + * |
| 5 | + * This program is free software: you can redistribute it and/or modify |
| 6 | + * it under the terms of the GNU General Public License as published by |
| 7 | + * the Free Software Foundation, either version 3 of the License, or |
| 8 | + * (at your option) any later version. |
| 9 | + * |
| 10 | + * This program is distributed in the hope that it will be useful, |
| 11 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | + * GNU General Public License for more details. |
| 14 | + * |
| 15 | + * You should have received a copy of the GNU General Public License |
| 16 | + * along with this program. If not, see <https://www.gnu.org/licenses/>. |
| 17 | + * |
| 18 | + */ |
| 19 | + |
| 20 | +#ifdef __PLAT_NATIVE_SIM__ |
| 21 | + |
| 22 | +#include "../../inc/MarlinConfig.h" |
| 23 | +#include "pinsDebug.h" |
| 24 | + |
| 25 | +int8_t ADC_pin_mode(pin_t pin) { return -1; } |
| 26 | + |
| 27 | +int8_t get_pin_mode(const pin_t pin) { return VALID_PIN(pin) ? 0 : -1; } |
| 28 | + |
| 29 | +bool GET_PINMODE(const pin_t pin) { |
| 30 | + const int8_t pin_mode = get_pin_mode(pin); |
| 31 | + if (pin_mode == -1 || pin_mode == ADC_pin_mode(pin)) // Invalid pin or active analog pin |
| 32 | + return false; |
| 33 | + |
| 34 | + return (Gpio::getMode(pin) != 0); // Input/output state |
| 35 | +} |
| 36 | + |
| 37 | +bool GET_ARRAY_IS_DIGITAL(const pin_t pin) { |
| 38 | + return !IS_ANALOG(pin) || get_pin_mode(pin) != ADC_pin_mode(pin); |
| 39 | +} |
| 40 | + |
| 41 | +void print_port(const pin_t) {} |
| 42 | +void pwm_details(const pin_t) {} |
| 43 | +bool pwm_status(const pin_t) { return false; } |
| 44 | + |
| 45 | +#endif |
0 commit comments