FSensor - code cleaning
This commit is contained in:
parent
2e260aeccc
commit
980c044dac
2 changed files with 19 additions and 29 deletions
|
@ -1,7 +1,5 @@
|
||||||
#include "Marlin.h"
|
#include "Marlin.h"
|
||||||
|
|
||||||
#ifdef PAT9125
|
|
||||||
|
|
||||||
#include "fsensor.h"
|
#include "fsensor.h"
|
||||||
#include "pat9125.h"
|
#include "pat9125.h"
|
||||||
#include "stepper.h"
|
#include "stepper.h"
|
||||||
|
@ -9,6 +7,17 @@
|
||||||
#include "fastio.h"
|
#include "fastio.h"
|
||||||
#include "cmdqueue.h"
|
#include "cmdqueue.h"
|
||||||
|
|
||||||
|
//Basic params
|
||||||
|
#define FSENSOR_CHUNK_LEN 180 //filament sensor chunk length in steps - 0.64mm
|
||||||
|
#define FSENSOR_ERR_MAX 10 //filament sensor maximum error count for runout detection
|
||||||
|
|
||||||
|
//Optical quality meassurement params
|
||||||
|
#define FSENSOR_OQ_MAX_ER 5 //maximum error count for loading (~150mm)
|
||||||
|
#define FSENSOR_OQ_MIN_YD 2 //minimum yd per chunk
|
||||||
|
#define FSENSOR_OQ_MAX_YD 200 //maximum yd per chunk
|
||||||
|
#define FSENSOR_OQ_MAX_PD 3 //maximum positive deviation (= yd_max/yd_avg)
|
||||||
|
#define FSENSOR_OQ_MAX_ND 5 //maximum negative deviation (= yd_avg/yd_min)
|
||||||
|
|
||||||
|
|
||||||
const char ERRMSG_PAT9125_NOT_RESP[] PROGMEM = "PAT9125 not responding (%d)!\n";
|
const char ERRMSG_PAT9125_NOT_RESP[] PROGMEM = "PAT9125 not responding (%d)!\n";
|
||||||
|
|
||||||
|
@ -413,6 +422,3 @@ void fsensor_setup_interrupt(void)
|
||||||
|
|
||||||
pciSetup(FSENSOR_INT_PIN);
|
pciSetup(FSENSOR_INT_PIN);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif //PAT9125
|
|
||||||
|
|
|
@ -1,17 +1,15 @@
|
||||||
#ifndef FSENSOR_H
|
#ifndef FSENSOR_H
|
||||||
#define FSENSOR_H
|
#define FSENSOR_H
|
||||||
|
|
||||||
#include "planner.h"
|
#include <inttypes.h>
|
||||||
|
|
||||||
#define FSENSOR_CHUNK_LEN 180 //filament sensor chunk length in steps - 0.64mm
|
|
||||||
#define FSENSOR_ERR_MAX 10 //filament sensor maximum error count for runout detection
|
|
||||||
|
|
||||||
//Optical quality meassurement params
|
//minimum meassured chunk length in steps
|
||||||
#define FSENSOR_OQ_MAX_ER 5 //maximum error count for loading (~150mm)
|
extern int16_t fsensor_chunk_len;
|
||||||
#define FSENSOR_OQ_MIN_YD 2 //minimum yd per chunk
|
//enable/disable flag
|
||||||
#define FSENSOR_OQ_MAX_YD 200 //maximum yd per chunk
|
extern bool fsensor_enabled;
|
||||||
#define FSENSOR_OQ_MAX_PD 3 //maximum positive deviation (= yd_max/yd_avg)
|
//not responding flag
|
||||||
#define FSENSOR_OQ_MAX_ND 5 //maximum negative deviation (= yd_avg/yd_min)
|
extern bool fsensor_not_responding;
|
||||||
|
|
||||||
|
|
||||||
//save restore printing
|
//save restore printing
|
||||||
|
@ -46,23 +44,9 @@ extern void fsensor_oq_meassure_stop(void);
|
||||||
extern bool fsensor_oq_result(void);
|
extern bool fsensor_oq_result(void);
|
||||||
|
|
||||||
//callbacks from stepper
|
//callbacks from stepper
|
||||||
|
#include "planner.h"
|
||||||
extern void fsensor_st_block_begin(block_t* bl);
|
extern void fsensor_st_block_begin(block_t* bl);
|
||||||
extern void fsensor_st_block_chunk(block_t* bl, int cnt);
|
extern void fsensor_st_block_chunk(block_t* bl, int cnt);
|
||||||
|
|
||||||
//minimum meassured chunk length in steps
|
|
||||||
extern int16_t fsensor_chunk_len;
|
|
||||||
//enable/disable flag
|
|
||||||
extern bool fsensor_enabled;
|
|
||||||
//watch runout flag
|
|
||||||
extern bool fsensor_watch_runout;
|
|
||||||
//not responding flag
|
|
||||||
extern bool fsensor_not_responding;
|
|
||||||
|
|
||||||
//error counter
|
|
||||||
extern uint8_t fsensor_err_cnt;
|
|
||||||
|
|
||||||
//autoload enable/disable flag
|
|
||||||
extern bool fsensor_watch_autoload;
|
|
||||||
|
|
||||||
|
|
||||||
#endif //FSENSOR_H
|
#endif //FSENSOR_H
|
||||||
|
|
Loading…
Reference in a new issue