3be859ece9
Depending on the filament surface and moving speed, the PAT9125 sensor can stop being able to track movement. In such cases, instead of triggering false errors and/or relying on previous states, read and use the exposure data off the sensor and increase error counts only for poorly exposed images instead, which is a good indicator of a far-away (or missing!) tracking surface.
32 lines
606 B
C
Executable File
32 lines
606 B
C
Executable File
//pat9125.h
|
|
#ifndef PAT9125_H
|
|
#define PAT9125_H
|
|
|
|
#include <inttypes.h>
|
|
|
|
|
|
#if defined(__cplusplus)
|
|
extern "C" {
|
|
#endif //defined(__cplusplus)
|
|
|
|
|
|
extern uint8_t pat9125_PID1;
|
|
extern uint8_t pat9125_PID2;
|
|
|
|
extern int16_t pat9125_x;
|
|
extern int16_t pat9125_y;
|
|
extern uint8_t pat9125_b;
|
|
extern uint8_t pat9125_s;
|
|
|
|
extern uint8_t pat9125_init(void);
|
|
extern uint8_t pat9125_update(void); // update all sensor data
|
|
extern uint8_t pat9125_update_y(void); // update _y only
|
|
extern uint8_t pat9125_update_bs(void); // update _b/_s only
|
|
|
|
|
|
#if defined(__cplusplus)
|
|
}
|
|
#endif //defined(__cplusplus)
|
|
|
|
#endif //PAT9125_H
|