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.

spindle_laser_types.h 2.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /**
  2. * Marlin 3D Printer Firmware
  3. * Copyright (c) 2020 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 <https://www.gnu.org/licenses/>.
  20. *
  21. */
  22. #pragma once
  23. /**
  24. * feature/spindle_laser_types.h
  25. * Support for Laser Power or Spindle Power & Direction
  26. */
  27. #include "../inc/MarlinConfigPre.h"
  28. #define MSG_CUTTER(M) _MSG_CUTTER(M)
  29. #ifndef SPEED_POWER_INTERCEPT
  30. #define SPEED_POWER_INTERCEPT 0
  31. #endif
  32. #if ENABLED(SPINDLE_FEATURE)
  33. #define _MSG_CUTTER(M) MSG_SPINDLE_##M
  34. #ifndef SPEED_POWER_MIN
  35. #define SPEED_POWER_MIN 5000
  36. #endif
  37. #ifndef SPEED_POWER_MAX
  38. #define SPEED_POWER_MAX 30000
  39. #endif
  40. #ifndef SPEED_POWER_STARTUP
  41. #define SPEED_POWER_STARTUP 25000
  42. #endif
  43. #else
  44. #define _MSG_CUTTER(M) MSG_LASER_##M
  45. #ifndef SPEED_POWER_MIN
  46. #define SPEED_POWER_MIN 0
  47. #endif
  48. #ifndef SPEED_POWER_MAX
  49. #define SPEED_POWER_MAX 255
  50. #endif
  51. #ifndef SPEED_POWER_STARTUP
  52. #define SPEED_POWER_STARTUP 255
  53. #endif
  54. #endif
  55. typedef IF<(SPEED_POWER_MAX > 255), uint16_t, uint8_t>::type cutter_cpower_t;
  56. #if CUTTER_UNIT_IS(RPM) && SPEED_POWER_MAX > 255
  57. typedef uint16_t cutter_power_t;
  58. #define CUTTER_MENU_POWER_TYPE uint16_5
  59. #define cutter_power2str ui16tostr5rj
  60. #else
  61. typedef uint8_t cutter_power_t;
  62. #if CUTTER_UNIT_IS(PERCENT)
  63. #define CUTTER_MENU_POWER_TYPE percent_3
  64. #define cutter_power2str pcttostrpctrj
  65. #else
  66. #define CUTTER_MENU_POWER_TYPE uint8
  67. #define cutter_power2str ui8tostr3rj
  68. #endif
  69. #endif
  70. typedef uint16_t cutter_frequency_t;
  71. #if ENABLED(LASER_FEATURE)
  72. typedef uint16_t cutter_test_pulse_t;
  73. #define CUTTER_MENU_PULSE_TYPE uint16_3
  74. #define CUTTER_MENU_FREQUENCY_TYPE uint16_5
  75. #endif