diff options
Diffstat (limited to 'Sprinter/Sprinter.h')
-rw-r--r-- | Sprinter/Sprinter.h | 68 |
1 files changed, 54 insertions, 14 deletions
diff --git a/Sprinter/Sprinter.h b/Sprinter/Sprinter.h index 7a4b8a9..d612b5d 100644 --- a/Sprinter/Sprinter.h +++ b/Sprinter/Sprinter.h @@ -1,6 +1,7 @@ // Tonokip RepRap firmware rewrite based off of Hydra-mmm firmware. // Licence: GPL #include <WProgram.h> +#include "fastio.h" extern "C" void __cxa_pure_virtual(); void __cxa_pure_virtual(){}; void get_command(); @@ -9,10 +10,59 @@ void process_commands(); void manage_inactivity(byte debug); void manage_heater(); -float temp2analog(int celsius); -float temp2analogBed(int celsius); -float analog2temp(int raw); -float analog2tempBed(int raw); +int temp2analogu(int celsius, const short table[][2], int numtemps, int source); +int analog2tempu(int raw, const short table[][2], int numtemps, int source); +#ifdef HEATER_USES_THERMISTOR + #define HEATERSOURCE 1 +#endif +#ifdef HEATER_USES_AD595 + #define HEATERSOURCE 2 +#endif +#ifdef HEATER_USES_MAX6675 + #define HEATERSOURCE 3 +#endif +#ifdef BED_USES_THERMISTOR + #define BEDSOURCE 1 +#endif +#ifdef BED_USES_AD595 + #define BEDSOURCE 2 +#endif +#ifdef BED_USES_MAX6675 + #define BEDSOURCE 3 +#endif + +#define temp2analogh( c ) temp2analogu((c),temptable,NUMTEMPS,HEATERSOURCE) +#define temp2analogBed( c ) temp2analogu((c),bedtemptable,BNUMTEMPS,BEDSOURCE) +#define analog2temp( c ) analog2tempu((c),temptable,NUMTEMPS,HEATERSOURCE) +#define analog2tempBed( c ) analog2tempu((c),bedtemptable,BNUMTEMPS,BEDSOURCE) +#if X_ENABLE_PIN > -1 +#define enable_x() WRITE(X_ENABLE_PIN, X_ENABLE_ON) +#define disable_x() WRITE(X_ENABLE_PIN,!X_ENABLE_ON) +#else +#define enable_x() ; +#define disable_x() ; +#endif +#if Y_ENABLE_PIN > -1 +#define enable_y() WRITE(Y_ENABLE_PIN, Y_ENABLE_ON) +#define disable_y() WRITE(Y_ENABLE_PIN,!Y_ENABLE_ON) +#else +#define enable_y() ; +#define disable_y() ; +#endif +#if Z_ENABLE_PIN > -1 +#define enable_z() WRITE(Z_ENABLE_PIN, Z_ENABLE_ON) +#define disable_z() WRITE(Z_ENABLE_PIN,!Z_ENABLE_ON) +#else +#define enable_z() ; +#define disable_z() ; +#endif +#if E_ENABLE_PIN > -1 +#define enable_e() WRITE(E_ENABLE_PIN, E_ENABLE_ON) +#define disable_e() WRITE(E_ENABLE_PIN,!E_ENABLE_ON) +#else +#define enable_e() ; +#define disable_e() ; +#endif void FlushSerialRequestResend(); void ClearToSend(); @@ -20,16 +70,6 @@ void ClearToSend(); void get_coordinates(); void prepare_move(); void linear_move(unsigned long steps_remaining[]); -void do_step_update_micros(int axis); -void disable_x(); -void disable_y(); -void disable_z(); -void disable_e(); -void enable_x(); -void enable_y(); -void enable_z(); -void enable_e(); void do_step(int axis); - void kill(byte debug); |