My Marlin configs for Fabrikator Mini and CTC i3 Pro B
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

12345678910111213141516171819202122232425262728293031323334353637
  1. /**
  2. * Marlin 3D Printer Firmware
  3. * Copyright (c) 2021 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
  4. *
  5. * Copyright (c) 2021 X-Ryl669 [https://blog.cyril.by]
  6. *
  7. * This program is free software: you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation, either version 3 of the License, or
  10. * (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program. If not, see <https://www.gnu.org/licenses/>.
  19. *
  20. */
  21. #pragma once
  22. // We need SERIAL_ECHOPAIR and macros.h
  23. #include "serial.h"
  24. #if ENABLED(POSTMORTEM_DEBUGGING)
  25. // Useful macro for stopping the CPU on an unexpected condition
  26. // This is used like SERIAL_ECHOPAIR, that is: a key-value call of the local variables you want
  27. // to dump to the serial port before stopping the CPU.
  28. #define BUG_ON(V...) do { SERIAL_ECHOPAIR(ONLY_FILENAME, __LINE__, ": "); SERIAL_ECHOLNPAIR(V); SERIAL_FLUSHTX(); *(char*)0 = 42; } while(0)
  29. #elif ENABLED(MARLIN_DEV_MODE)
  30. // Don't stop the CPU here, but at least dump the bug on the serial port
  31. #define BUG_ON(V...) do { SERIAL_ECHOPAIR(ONLY_FILENAME, __LINE__, ": BUG!\n"); SERIAL_ECHOLNPAIR(V); SERIAL_FLUSHTX(); } while(0)
  32. #else
  33. // Release mode, let's ignore the bug
  34. #define BUG_ON(V...) NOOP
  35. #endif