My Marlin configs for Fabrikator Mini and CTC i3 Pro B
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

Marlin.h 3.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. #ifndef __MARLINH
  2. #define __MARLINH
  3. // Tonokip RepRap firmware rewrite based off of Hydra-mmm firmware.
  4. // Licence: GPL
  5. #define HardwareSerial_h // trick to disable the standard HWserial
  6. #include <math.h>
  7. #if ARDUINO >= 100
  8. #include "Arduino.h"
  9. #else
  10. #include "WProgram.h"
  11. #endif
  12. #include "fastio.h"
  13. #include <avr/pgmspace.h>
  14. #include "Configuration.h"
  15. #include "MarlinSerial.h"
  16. #define FORCE_INLINE __attribute__((always_inline)) inline
  17. //#define SERIAL_ECHO(x) Serial << "echo: " << x;
  18. //#define SERIAL_ECHOLN(x) Serial << "echo: "<<x<<endl;
  19. //#define SERIAL_ERROR(x) Serial << "Error: " << x;
  20. //#define SERIAL_ERRORLN(x) Serial << "Error: " << x<<endl;
  21. //#define SERIAL_PROTOCOL(x) Serial << x;
  22. //#define SERIAL_PROTOCOLLN(x) Serial << x<<endl;
  23. #define SERIAL_PROTOCOL(x) MSerial.print(x);
  24. #define SERIAL_PROTOCOLPGM(x) serialprintPGM(PSTR(x));
  25. #define SERIAL_PROTOCOLLN(x) {MSerial.print(x);MSerial.write('\n');}
  26. #define SERIAL_PROTOCOLLNPGM(x) {serialprintPGM(PSTR(x));MSerial.write('\n');}
  27. const char errormagic[] PROGMEM ="Error:";
  28. const char echomagic[] PROGMEM ="echo:";
  29. #define SERIAL_ERROR_START serialprintPGM(errormagic);
  30. #define SERIAL_ERROR(x) SERIAL_PROTOCOL(x)
  31. #define SERIAL_ERRORPGM(x) SERIAL_PROTOCOLPGM(x)
  32. #define SERIAL_ERRORLN(x) SERIAL_PROTOCOLLN(x)
  33. #define SERIAL_ERRORLNPGM(x) SERIAL_PROTOCOLLNPGM(x)
  34. #define SERIAL_ECHO_START serialprintPGM(echomagic);
  35. #define SERIAL_ECHO(x) SERIAL_PROTOCOL(x)
  36. #define SERIAL_ECHOPGM(x) SERIAL_PROTOCOLPGM(x)
  37. #define SERIAL_ECHOLN(x) SERIAL_PROTOCOLLN(x)
  38. #define SERIAL_ECHOLNPGM(x) SERIAL_PROTOCOLLNPGM(x)
  39. #define SERIAL_ECHOPAIR(name,value) {SERIAL_ECHOPGM(name);SERIAL_ECHO(value);}
  40. //things to write to serial from Programmemory. saves 400 to 2k of RAM.
  41. #define SerialprintPGM(x) serialprintPGM(PSTR(x))
  42. FORCE_INLINE void serialprintPGM(const char *str)
  43. {
  44. char ch=pgm_read_byte(str);
  45. while(ch)
  46. {
  47. MSerial.write(ch);
  48. ch=pgm_read_byte(++str);
  49. }
  50. }
  51. void get_command();
  52. void process_commands();
  53. void manage_inactivity(byte debug);
  54. #if X_ENABLE_PIN > -1
  55. #define enable_x() WRITE(X_ENABLE_PIN, X_ENABLE_ON)
  56. #define disable_x() WRITE(X_ENABLE_PIN,!X_ENABLE_ON)
  57. #else
  58. #define enable_x() ;
  59. #define disable_x() ;
  60. #endif
  61. #if Y_ENABLE_PIN > -1
  62. #define enable_y() WRITE(Y_ENABLE_PIN, Y_ENABLE_ON)
  63. #define disable_y() WRITE(Y_ENABLE_PIN,!Y_ENABLE_ON)
  64. #else
  65. #define enable_y() ;
  66. #define disable_y() ;
  67. #endif
  68. #if Z_ENABLE_PIN > -1
  69. #define enable_z() WRITE(Z_ENABLE_PIN, Z_ENABLE_ON)
  70. #define disable_z() WRITE(Z_ENABLE_PIN,!Z_ENABLE_ON)
  71. #else
  72. #define enable_z() ;
  73. #define disable_z() ;
  74. #endif
  75. #if E_ENABLE_PIN > -1
  76. #define enable_e() WRITE(E_ENABLE_PIN, E_ENABLE_ON)
  77. #define disable_e() WRITE(E_ENABLE_PIN,!E_ENABLE_ON)
  78. #else
  79. #define enable_e() ;
  80. #define disable_e() ;
  81. #endif
  82. enum AxisEnum {X_AXIS=0, Y_AXIS=1, Z_AXIS=2, E_AXIS=3};
  83. void FlushSerialRequestResend();
  84. void ClearToSend();
  85. void get_coordinates();
  86. void prepare_move();
  87. void kill();
  88. void enquecommand(const char *cmd); //put an ascii command at the end of the current buffer.
  89. void prepare_arc_move(char isclockwise);
  90. #ifndef CRITICAL_SECTION_START
  91. #define CRITICAL_SECTION_START unsigned char _sreg = SREG; cli();
  92. #define CRITICAL_SECTION_END SREG = _sreg;
  93. #endif //CRITICAL_SECTION_START
  94. extern float homing_feedrate[];
  95. extern bool axis_relative_modes[];
  96. extern float current_position[NUM_AXIS] ;
  97. extern float add_homeing[3];
  98. #endif