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.

HAL.cpp 1.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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 TARGET_LPC1768
  23. #include "../../inc/MarlinConfig.h"
  24. #include "../shared/Delay.h"
  25. #include "../../../gcode/parser.h"
  26. // U8glib required functions
  27. extern "C" void u8g_xMicroDelay(uint16_t val) {
  28. DELAY_US(val);
  29. }
  30. extern "C" void u8g_MicroDelay(void) {
  31. u8g_xMicroDelay(1);
  32. }
  33. extern "C" void u8g_10MicroDelay(void) {
  34. u8g_xMicroDelay(10);
  35. }
  36. extern "C" void u8g_Delay(uint16_t val) {
  37. delay(val);
  38. }
  39. //************************//
  40. // return free heap space
  41. int freeMemory() {
  42. char stack_end;
  43. void *heap_start = malloc(sizeof(uint32_t));
  44. if (heap_start == 0) return 0;
  45. uint32_t result = (uint32_t)&stack_end - (uint32_t)heap_start;
  46. free(heap_start);
  47. return result;
  48. }
  49. int16_t PARSED_PIN_INDEX(const char code, const int16_t dval) {
  50. const uint16_t val = (uint16_t)parser.intval(code), port = val / 100, pin = val % 100;
  51. const int16_t ind = (port < (NUM_DIGITAL_PINS >> 5) && (pin < 32))
  52. ? GET_PIN_MAP_INDEX(port << 5 | pin) : -2;
  53. return ind > -2 ? ind : dval;
  54. }
  55. void flashFirmware(int16_t value) {
  56. NVIC_SystemReset();
  57. }
  58. #endif // TARGET_LPC1768