My Marlin configs for Fabrikator Mini and CTC i3 Pro B
Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

pinmapping.cpp 1.9KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /**
  2. * Marlin 3D Printer Firmware
  3. * Copyright (c) 2019 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 <http://www.gnu.org/licenses/>.
  20. *
  21. */
  22. #ifdef __PLAT_LINUX__
  23. #include <pinmapping.h>
  24. #include "../../../gcode/parser.h"
  25. uint8_t analog_offset = NUM_DIGITAL_PINS - NUM_ANALOG_INPUTS;
  26. // Get the digital pin for an analog index
  27. pin_t analogInputToDigitalPin(const int8_t p) {
  28. return (WITHIN(p, 0, NUM_ANALOG_INPUTS) ? analog_offset + p : P_NC);
  29. }
  30. // Return the index of a pin number
  31. int16_t GET_PIN_MAP_INDEX(const pin_t pin) {
  32. return pin;
  33. }
  34. // Test whether the pin is valid
  35. bool VALID_PIN(const pin_t p) {
  36. return WITHIN(p, 0, NUM_DIGITAL_PINS);
  37. }
  38. // Get the analog index for a digital pin
  39. int8_t DIGITAL_PIN_TO_ANALOG_PIN(const pin_t p) {
  40. return (WITHIN(p, analog_offset, NUM_DIGITAL_PINS) ? p - analog_offset : P_NC);
  41. }
  42. // Test whether the pin is PWM
  43. bool PWM_PIN(const pin_t p) {
  44. return false;
  45. }
  46. // Test whether the pin is interruptable
  47. bool INTERRUPT_PIN(const pin_t p) {
  48. return false;
  49. }
  50. // Get the pin number at the given index
  51. pin_t GET_PIN_MAP_PIN(const int16_t ind) {
  52. return ind;
  53. }
  54. int16_t PARSED_PIN_INDEX(const char code, const int16_t dval) {
  55. return parser.intval(code, dval);
  56. }
  57. #endif // __PLAT_LINUX__