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.

settings.h 7.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  1. /**
  2. * Copyright (C) 2011 Circuits At Home, LTD. All rights reserved.
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation; either version 2 of the License, or
  7. * (at your option) any later version.
  8. *
  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. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program; if not, write to the Free Software
  16. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  17. *
  18. * Contact information
  19. * -------------------
  20. *
  21. * Circuits At Home, LTD
  22. * Web : https://www.circuitsathome.com
  23. * e-mail : support@circuitsathome.com
  24. */
  25. #pragma once
  26. #include "../../../inc/MarlinConfig.h"
  27. #include "macros.h"
  28. #if ENABLED(USB_FLASH_DRIVE_SUPPORT)
  29. ////////////////////////////////////////////////////////////////////////////////
  30. /* Added by Bill Greiman to speed up mass storage initialization with USB
  31. * flash drives and simple USB hard drives.
  32. * Disable this by defining DELAY(x) to be delay(x).
  33. */
  34. #define delay(x) if ((x) < 200) safe_delay(x)
  35. /* Almost all USB flash drives and simple USB hard drives fail the write
  36. * protect test and add 20 - 30 seconds to USB init. Set SKIP_WRITE_PROTECT
  37. * to nonzero to skip the test and assume the drive is writable.
  38. */
  39. #define SKIP_WRITE_PROTECT 1
  40. /* Since Marlin only cares about USB flash drives, we only need one LUN. */
  41. #define MASS_MAX_SUPPORTED_LUN 1
  42. #endif
  43. ////////////////////////////////////////////////////////////////////////////////
  44. // SPI Configuration
  45. ////////////////////////////////////////////////////////////////////////////////
  46. #ifndef USB_SPI
  47. #define USB_SPI SPI
  48. //#define USB_SPI SPI1
  49. #endif
  50. ////////////////////////////////////////////////////////////////////////////////
  51. // DEBUGGING
  52. ////////////////////////////////////////////////////////////////////////////////
  53. /* Set this to 1 to activate serial debugging */
  54. #define ENABLE_UHS_DEBUGGING 0
  55. /* This can be used to select which serial port to use for debugging if
  56. * multiple serial ports are available.
  57. * For example Serial3.
  58. */
  59. #if ENABLED(USB_FLASH_DRIVE_SUPPORT)
  60. #define USB_HOST_SERIAL MYSERIAL1
  61. #endif
  62. #ifndef USB_HOST_SERIAL
  63. #define USB_HOST_SERIAL Serial
  64. #endif
  65. ////////////////////////////////////////////////////////////////////////////////
  66. // Manual board activation
  67. ////////////////////////////////////////////////////////////////////////////////
  68. /* Set this to 1 if you are using an Arduino Mega ADK board with MAX3421e built-in */
  69. #define USE_UHS_MEGA_ADK 0 // If you are using Arduino 1.5.5 or newer there is no need to do this manually
  70. /* Set this to 1 if you are using a Black Widdow */
  71. #define USE_UHS_BLACK_WIDDOW 0
  72. /* Set this to a one to use the xmem2 lock. This is needed for multitasking and threading */
  73. #define USE_XMEM_SPI_LOCK 0
  74. ////////////////////////////////////////////////////////////////////////////////
  75. // Wii IR camera
  76. ////////////////////////////////////////////////////////////////////////////////
  77. /* Set this to 1 to activate code for the Wii IR camera */
  78. #define ENABLE_WII_IR_CAMERA 0
  79. ////////////////////////////////////////////////////////////////////////////////
  80. // MASS STORAGE
  81. ////////////////////////////////////////////////////////////////////////////////
  82. // ******* IMPORTANT *******
  83. // Set this to 1 to support single LUN devices, and save RAM. -- I.E. thumb drives.
  84. // Each LUN needs ~13 bytes to be able to track the state of each unit.
  85. #ifndef MASS_MAX_SUPPORTED_LUN
  86. #define MASS_MAX_SUPPORTED_LUN 8
  87. #endif
  88. ////////////////////////////////////////////////////////////////////////////////
  89. // Set to 1 to use the faster spi4teensy3 driver.
  90. ////////////////////////////////////////////////////////////////////////////////
  91. #ifndef USE_SPI4TEENSY3
  92. #define USE_SPI4TEENSY3 1
  93. #endif
  94. // Disabled on the Teensy LC, as it is incompatible for now
  95. #ifdef __MKL26Z64__
  96. #undef USE_SPI4TEENSY3
  97. #define USE_SPI4TEENSY3 0
  98. #endif
  99. ////////////////////////////////////////////////////////////////////////////////
  100. // AUTOMATIC Settings
  101. ////////////////////////////////////////////////////////////////////////////////
  102. // No user serviceable parts below this line.
  103. // DO NOT change anything below here unless you are a developer!
  104. //#include "version_helper.h"
  105. #if defined(__GNUC__) && defined(__AVR__)
  106. #ifndef GCC_VERSION
  107. #define GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
  108. #endif
  109. #if GCC_VERSION < 40602 // Test for GCC < 4.6.2
  110. #ifdef PROGMEM
  111. #undef PROGMEM
  112. #define PROGMEM __attribute__((section(".progmem.data"))) // Workaround for https://gcc.gnu.org/bugzilla/show_bug.cgi?id=34734#c4
  113. #ifdef PSTR
  114. #undef PSTR
  115. #define PSTR(s) (__extension__({static const char __c[] PROGMEM = (s); &__c[0];})) // Copied from pgmspace.h in avr-libc source
  116. #endif
  117. #endif
  118. #endif
  119. #endif
  120. #if !defined(DEBUG_USB_HOST) && ENABLE_UHS_DEBUGGING
  121. #define DEBUG_USB_HOST
  122. #endif
  123. #if !defined(WIICAMERA) && ENABLE_WII_IR_CAMERA
  124. #define WIICAMERA
  125. #endif
  126. // To use some other locking (e.g. freertos),
  127. // define XMEM_ACQUIRE_SPI and XMEM_RELEASE_SPI to point to your lock and unlock.
  128. // NOTE: NO argument is passed. You have to do this within your routine for
  129. // whatever you are using to lock and unlock.
  130. #ifndef XMEM_ACQUIRE_SPI
  131. #if USE_XMEM_SPI_LOCK || defined(USE_MULTIPLE_APP_API)
  132. #include <xmem.h>
  133. #else
  134. #define XMEM_ACQUIRE_SPI() (void(0))
  135. #define XMEM_RELEASE_SPI() (void(0))
  136. #endif
  137. #endif
  138. #if !defined(EXT_RAM) && defined(EXT_RAM_STACK) || defined(EXT_RAM_HEAP)
  139. #include <xmem.h>
  140. #else
  141. #define EXT_RAM 0
  142. #endif
  143. #if defined(CORE_TEENSY) && defined(KINETISK)
  144. #define USING_SPI4TEENSY3 USE_SPI4TEENSY3
  145. #else
  146. #define USING_SPI4TEENSY3 0
  147. #endif
  148. #if ((defined(ARDUINO_SAM_DUE) && defined(__SAM3X8E__)) || defined(__ARDUINO_X86__) || ARDUINO >= 10600) && !USING_SPI4TEENSY3
  149. #include <SPI.h> // Use the Arduino SPI library for the Arduino Due, Intel Galileo 1 & 2, Intel Edison or if the SPI library with transaction is available
  150. #endif
  151. #ifdef RBL_NRF51822
  152. #include <nrf_gpio.h>
  153. #include <SPI_Master.h>
  154. #define SPI SPI_Master
  155. #define MFK_CASTUINT8T (uint8_t) // RBLs return type for sizeof needs casting to uint8_t
  156. #endif
  157. #if defined(__PIC32MX__) || defined(__PIC32MZ__)
  158. #include <../../../../hardware/pic32/libraries/SPI/SPI.h> // Hack to use the SPI library
  159. #endif
  160. #if defined(ESP8266) || defined(ESP32)
  161. #define MFK_CASTUINT8T (uint8_t) // ESP return type for sizeof needs casting to uint8_t
  162. #endif
  163. #ifdef STM32F4
  164. #include "stm32f4xx_hal.h"
  165. extern SPI_HandleTypeDef SPI_Handle; // Needed to be declared in your main.cpp
  166. #endif
  167. // Fix defines on Arduino Due
  168. #ifdef ARDUINO_SAM_DUE
  169. #ifdef tokSETUP
  170. #undef tokSETUP
  171. #endif
  172. #ifdef tokIN
  173. #undef tokIN
  174. #endif
  175. #ifdef tokOUT
  176. #undef tokOUT
  177. #endif
  178. #ifdef tokINHS
  179. #undef tokINHS
  180. #endif
  181. #ifdef tokOUTHS
  182. #undef tokOUTHS
  183. #endif
  184. #endif
  185. // Set defaults
  186. #ifndef MFK_CASTUINT8T
  187. #define MFK_CASTUINT8T
  188. #endif
  189. // Workaround issue: https://github.com/esp8266/Arduino/issues/2078
  190. #ifdef ESP8266
  191. #undef PROGMEM
  192. #define PROGMEM
  193. #undef PSTR
  194. #define PSTR(s) (s)
  195. #undef pgm_read_byte
  196. #define pgm_read_byte(addr) (*reinterpret_cast<const uint8_t*>(addr))
  197. #undef pgm_read_word
  198. #define pgm_read_word(addr) (*reinterpret_cast<const uint16_t*>(addr))
  199. #endif
  200. #ifdef ARDUINO_ESP8266_WIFIO
  201. #error "This board is currently not supported"
  202. #endif