My Marlin configs for Fabrikator Mini and CTC i3 Pro B
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. /**
  2. * Marlin 3D Printer Firmware
  3. * Copyright (c) 2020 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 <http://www.gnu.org/licenses/>.
  17. *
  18. */
  19. #pragma once
  20. #define NUMBER_PINS_TOTAL NUM_DIGITAL_PINS
  21. #define MULTI_NAME_PAD 16 // space needed to be pretty if not first name assigned to a pin
  22. #define FTM0_CH0_PIN 22
  23. #define FTM0_CH1_PIN 23
  24. #define FTM0_CH2_PIN 9
  25. #define FTM0_CH3_PIN 10
  26. #define FTM0_CH4_PIN 6
  27. #define FTM0_CH5_PIN 20
  28. #define FTM0_CH6_PIN 21
  29. #define FTM0_CH7_PIN 5
  30. #define FTM1_CH0_PIN 3
  31. #define FTM1_CH1_PIN 4
  32. #define FTM2_CH0_PIN 29
  33. #define FTM2_CH1_PIN 30
  34. #define FTM3_CH0_PIN 2
  35. #define FTM3_CH1_PIN 14
  36. #define FTM3_CH2_PIN 7
  37. #define FTM3_CH3_PIN 8
  38. #define FTM3_CH4_PIN 35
  39. #define FTM3_CH5_PIN 36
  40. #define FTM3_CH6_PIN 37
  41. #define FTM3_CH7_PIN 38
  42. #ifdef __MK66FX1M0__ // Teensy3.6
  43. #define TPM1_CH0_PIN 16
  44. #define TPM1_CH1_PIN 17
  45. #endif
  46. #define IS_ANALOG(P) ((P) >= analogInputToDigitalPin(0) && (P) <= analogInputToDigitalPin(9)) || ((P) >= analogInputToDigitalPin(12) && (P) <= analogInputToDigitalPin(20))
  47. void HAL_print_analog_pin(char buffer[], int8_t pin) {
  48. if (pin <= 23) sprintf_P(buffer, PSTR("(A%2d) "), int(pin - 14));
  49. else if (pin <= 39) sprintf_P(buffer, PSTR("(A%2d) "), int(pin - 19));
  50. }
  51. void HAL_analog_pin_state(char buffer[], int8_t pin) {
  52. if (pin <= 23) sprintf_P(buffer, PSTR("Analog in =% 5d"), analogRead(pin - 14));
  53. else if (pin <= 39) sprintf_P(buffer, PSTR("Analog in =% 5d"), analogRead(pin - 19));
  54. }
  55. #define PWM_PRINT(V) do{ sprintf_P(buffer, PSTR("PWM: %4d"), 22); SERIAL_ECHO(buffer); }while(0)
  56. #define FTM_CASE(N,Z) \
  57. case FTM##N##_CH##Z##_PIN: \
  58. if (FTM##N##_C##Z##V) { \
  59. PWM_PRINT(FTM##N##_C##Z##V); \
  60. return true; \
  61. } else return false
  62. /**
  63. * Print a pin's PWM status.
  64. * Return true if it's currently a PWM pin.
  65. */
  66. bool HAL_pwm_status(int8_t pin) {
  67. char buffer[20]; // for the sprintf statements
  68. switch (pin) {
  69. FTM_CASE(0,0);
  70. FTM_CASE(0,1);
  71. FTM_CASE(0,2);
  72. FTM_CASE(0,3);
  73. FTM_CASE(0,4);
  74. FTM_CASE(0,5);
  75. FTM_CASE(0,6);
  76. FTM_CASE(0,7);
  77. FTM_CASE(1,0);
  78. FTM_CASE(1,1);
  79. FTM_CASE(2,0);
  80. FTM_CASE(2,1);
  81. FTM_CASE(3,0);
  82. FTM_CASE(3,1);
  83. FTM_CASE(3,2);
  84. FTM_CASE(3,3);
  85. FTM_CASE(3,4);
  86. FTM_CASE(3,5);
  87. FTM_CASE(3,6);
  88. FTM_CASE(3,7);
  89. case NOT_ON_TIMER:
  90. default:
  91. return false;
  92. }
  93. SERIAL_ECHOPGM(" ");
  94. }
  95. static void HAL_pwm_details(uint8_t pin) { /* TODO */ }