fsensor.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. //! @file
  2. #ifndef FSENSOR_H
  3. #define FSENSOR_H
  4. #include <inttypes.h>
  5. #include "config.h"
  6. // enable/disable flag
  7. extern bool fsensor_enabled;
  8. // not responding flag
  9. extern bool fsensor_not_responding;
  10. #ifdef PAT9125
  11. // optical checking "chunk lenght" (already in steps)
  12. extern int16_t fsensor_chunk_len;
  13. // count of soft failures
  14. extern uint8_t fsensor_softfail;
  15. #endif
  16. //! @name save restore printing
  17. //! @{
  18. //! split the current gcode stream to insert new instructions
  19. extern void fsensor_checkpoint_print(void);
  20. //! @}
  21. #ifdef PAT9125
  22. //! update axis resolution
  23. extern void fsensor_set_axis_steps_per_unit(float u);
  24. #endif
  25. //! @name enable/disable
  26. //! @{
  27. extern bool fsensor_enable(bool bUpdateEEPROM=true);
  28. extern void fsensor_disable(bool bUpdateEEPROM=true);
  29. //! @}
  30. //autoload feature enabled
  31. extern bool fsensor_autoload_enabled;
  32. extern void fsensor_autoload_set(bool State);
  33. #ifdef PAT9125
  34. //! setup pin-change interrupt
  35. extern void fsensor_setup_interrupt(void);
  36. //! @name autoload support
  37. //! @{
  38. extern void fsensor_autoload_check_start(void);
  39. extern void fsensor_autoload_check_stop(void);
  40. #endif //PAT9125
  41. //! @}
  42. #ifdef PAT9125
  43. //! @name callbacks from stepper
  44. //! @{
  45. extern void fsensor_st_block_chunk(int cnt);
  46. // debugging
  47. extern uint8_t fsensor_log;
  48. // There's really nothing to do in block_begin: the stepper ISR likely has
  49. // called us already at the end of the last block, making this integration
  50. // redundant. LA1.5 might not always do that during a coasting move, so attempt
  51. // to drain fsensor_st_cnt anyway at the beginning of the new block.
  52. #define fsensor_st_block_begin(rev) fsensor_st_block_chunk(0)
  53. //! @}
  54. #endif //PAT9125
  55. #ifdef IR_SENSOR_ANALOG
  56. enum class ClFsensorActionNA:uint_least8_t
  57. {
  58. _Continue=0,
  59. _Pause=1,
  60. _Undef=EEPROM_EMPTY_VALUE
  61. };
  62. extern ClFsensorActionNA oFsensorActionNA;
  63. #endif //IR_SENSOR_ANALOG
  64. #endif //FSENSOR_H