fsensor.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. #ifndef FSENSOR_H
  2. #define FSENSOR_H
  3. #include "planner.h"
  4. #define FSENSOR_CHUNK_LEN 180 //filament sensor chunk length in steps - 0.64mm
  5. #define FSENSOR_ERR_MAX 10 //filament sensor maximum error count for runout detection
  6. //Optical quality meassurement params
  7. #define FSENSOR_OQ_MAX_ER 5 //maximum error count for loading (~150mm)
  8. #define FSENSOR_OQ_MIN_YD 2 //minimum yd per chunk
  9. #define FSENSOR_OQ_MAX_YD 200 //maximum yd per chunk
  10. #define FSENSOR_OQ_MAX_PD 3 //maximum positive deviation (= yd_max/yd_avg)
  11. #define FSENSOR_OQ_MAX_ND 5 //maximum negative deviation (= yd_avg/yd_min)
  12. //save restore printing
  13. extern void fsensor_stop_and_save_print(void);
  14. extern void fsensor_restore_print_and_continue(void);
  15. //initialize
  16. extern void fsensor_init(void);
  17. //enable/disable
  18. extern bool fsensor_enable(void);
  19. extern void fsensor_disable(void);
  20. //autoload feature enabled
  21. extern bool fsensor_autoload_enabled;
  22. extern void fsensor_autoload_set(bool State);
  23. //update (perform M600 on filament runout)
  24. extern void fsensor_update(void);
  25. //setup pin-change interrupt
  26. extern void fsensor_setup_interrupt(void);
  27. //autoload support
  28. extern void fsensor_autoload_check_start(void);
  29. extern void fsensor_autoload_check_stop(void);
  30. extern bool fsensor_check_autoload(void);
  31. //optical quality meassurement support
  32. extern void fsensor_oq_meassure_start(void);
  33. extern void fsensor_oq_meassure_stop(void);
  34. extern bool fsensor_oq_result(void);
  35. //callbacks from stepper
  36. extern void fsensor_st_block_begin(block_t* bl);
  37. extern void fsensor_st_block_chunk(block_t* bl, int cnt);
  38. //minimum meassured chunk length in steps
  39. extern int16_t fsensor_chunk_len;
  40. //enable/disable flag
  41. extern bool fsensor_enabled;
  42. //watch runout flag
  43. extern bool fsensor_watch_runout;
  44. //not responding flag
  45. extern bool fsensor_not_responding;
  46. //error counter
  47. extern uint8_t fsensor_err_cnt;
  48. //autoload enable/disable flag
  49. extern bool fsensor_watch_autoload;
  50. #endif //FSENSOR_H