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.

HAL_AVR.cpp 3.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. /* **************************************************************************
  2. Marlin 3D Printer Firmware
  3. Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
  4. Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com
  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. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program. If not, see <http://www.gnu.org/licenses/>.
  15. ****************************************************************************/
  16. /**
  17. * Description: HAL for AVR
  18. *
  19. * For ARDUINO_ARCH_AVR
  20. */
  21. #ifdef ARDUINO_ARCH_AVR
  22. // --------------------------------------------------------------------------
  23. // Includes
  24. // --------------------------------------------------------------------------
  25. #include "../HAL.h"
  26. #include "../../../macros.h"
  27. // --------------------------------------------------------------------------
  28. // Externals
  29. // --------------------------------------------------------------------------
  30. // --------------------------------------------------------------------------
  31. // Local defines
  32. // --------------------------------------------------------------------------
  33. // --------------------------------------------------------------------------
  34. // Types
  35. // --------------------------------------------------------------------------
  36. // --------------------------------------------------------------------------
  37. // Variables
  38. // --------------------------------------------------------------------------
  39. // --------------------------------------------------------------------------
  40. // Public Variables
  41. // --------------------------------------------------------------------------
  42. //uint8_t MCUSR;
  43. // --------------------------------------------------------------------------
  44. // Private Variables
  45. // --------------------------------------------------------------------------
  46. // --------------------------------------------------------------------------
  47. // Function prototypes
  48. // --------------------------------------------------------------------------
  49. // --------------------------------------------------------------------------
  50. // Private functions
  51. // --------------------------------------------------------------------------
  52. // --------------------------------------------------------------------------
  53. // Public functions
  54. // --------------------------------------------------------------------------
  55. #if ENABLED(SDSUPPORT)
  56. #include "../../../SdFatUtil.h"
  57. int freeMemory() { return SdFatUtil::FreeRam(); }
  58. #else
  59. extern "C" {
  60. extern char __bss_end;
  61. extern char __heap_start;
  62. extern void* __brkval;
  63. int freeMemory() {
  64. int free_memory;
  65. if ((int)__brkval == 0)
  66. free_memory = ((int)&free_memory) - ((int)&__bss_end);
  67. else
  68. free_memory = ((int)&free_memory) - ((int)__brkval);
  69. return free_memory;
  70. }
  71. }
  72. #endif //!SDSUPPORT
  73. #endif