Advertisement
Rickybk

Sprinter.h

Feb 7th, 2016
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 2.69 KB | None | 0 0
  1. // Tonokip RepRap firmware rewrite based off of Hydra-mmm firmware.
  2. // Licence: GPL
  3. #include <WProgram.h>
  4. #include "fastio.h"
  5. extern "C" void __cxa_pure_virtual();
  6. void __cxa_pure_virtual(){};
  7. void get_command();
  8. void process_commands();
  9.  
  10. void manage_inactivity(byte debug);
  11. void setup_acceleration();
  12.  
  13. void manage_heater();
  14.  
  15. #if defined HEATER_USES_THERMISTOR
  16. #define temp2analogh( c ) temp2analog_thermistor(c,temptable,NUMTEMPS)
  17. #define analog2temp( c ) analog2temp_thermistor(c,temptable,NUMTEMPS)
  18. #elif defined HEATER_USES_AD595
  19. #define temp2analogh( c ) temp2analog_ad595(c)
  20. #define analog2temp( c ) analog2temp_ad595(c)
  21. #elif defined HEATER_USES_MAX6675
  22. #define temp2analogh( c ) temp2analog_max6675(c)
  23. #define analog2temp( c ) analog2temp_max6675(c)
  24. #endif
  25.  
  26. #if defined BED_USES_THERMISTOR
  27. #define temp2analogBed( c ) temp2analog_thermistor((c),bedtemptable,BNUMTEMPS)
  28. #define analog2tempBed( c ) analog2temp_thermistor((c),bedtemptable,BNUMTEMPS)
  29. #elif defined BED_USES_AD595
  30. #define temp2analogBed( c ) temp2analog_ad595(c)
  31. #define analog2tempBed( c ) analog2temp_ad595(c)
  32. #elif defined BED_USES_MAX6675
  33. #define temp2analogBed( c ) temp2analog_max6675(c)
  34. #define analog2tempBed( c ) analog2temp_max6675(c)
  35. #endif
  36.  
  37. #if defined (HEATER_USES_THERMISTOR) || defined (BED_USES_THERMISTOR)
  38. int temp2analog_thermistor(int celsius, const short table[][2], int numtemps);
  39. int analog2temp_thermistor(int raw,const short table[][2], int numtemps);
  40. #endif
  41.  
  42. #if defined (HEATER_USES_AD595) || defined (BED_USES_AD595)
  43. int temp2analog_ad595(int celsius);
  44. int analog2temp_ad595(int raw);
  45. #endif
  46.  
  47. #if defined (HEATER_USES_MAX6675) || defined (BED_USES_MAX6675)
  48. int temp2analog_max6675(int celsius);
  49. int analog2temp_max6675(int raw);
  50. #endif
  51.  
  52. #if X_ENABLE_PIN > -1
  53. #define  enable_x() WRITE(X_ENABLE_PIN, X_ENABLE_ON)
  54. #define disable_x() WRITE(X_ENABLE_PIN,!X_ENABLE_ON)
  55. #else
  56. #define enable_x() ;
  57. #define disable_x() ;
  58. #endif
  59. #if Y_ENABLE_PIN > -1
  60. #define  enable_y() WRITE(Y_ENABLE_PIN, Y_ENABLE_ON)
  61. #define disable_y() WRITE(Y_ENABLE_PIN,!Y_ENABLE_ON)
  62. #else
  63. #define enable_y() ;
  64. #define disable_y() ;
  65. #endif
  66. #if Z_ENABLE_PIN > -1
  67. #define  enable_z() WRITE(Z_ENABLE_PIN, Z_ENABLE_ON)
  68. #define disable_z() WRITE(Z_ENABLE_PIN,!Z_ENABLE_ON)
  69. #else
  70. #define enable_z() ;
  71. #define disable_z() ;
  72. #endif
  73. #if E_ENABLE_PIN > -1
  74. #define  enable_e() WRITE(E_ENABLE_PIN, E_ENABLE_ON)
  75. #define disable_e() WRITE(E_ENABLE_PIN,!E_ENABLE_ON)
  76. #else
  77. #define enable_e() ;
  78. #define disable_e() ;
  79. #endif
  80.  
  81. void FlushSerialRequestResend();
  82. void ClearToSend();
  83.  
  84. void get_coordinates();
  85. void prepare_move();
  86. void linear_move(unsigned long steps_remaining[]);
  87. void do_step(int axis);
  88. void kill(byte debug);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement