increased reciver time tolerance

This commit is contained in:
IMback
2018-11-27 18:48:34 +01:00
parent f963c5b312
commit 775ff9313b
6 changed files with 45 additions and 34 deletions

View File

@ -17,6 +17,9 @@ private:
static constexpr uint16_t SYNC_TIME = 800;
static constexpr uint16_t LARGE_TIME = 2000;
static constexpr uint16_t SMALL_TIME = 500;
static constexpr uint8_t SYNC_TIME_TOLERANCE = SYNC_TIME*0.15;
static constexpr uint8_t LARGE_TIME_TOLERANCE = LARGE_TIME*0.15;
static constexpr uint8_t SMALL_TIME_TOLERANCE = SMALL_TIME*0.15;
static constexpr uint16_t TICKS_PER_US = (F_CPU) / (1000000*CLOCK_DEVIDER) ;
static constexpr uint8_t signature = 0xA5;
@ -59,7 +62,7 @@ private:
inline bool recivedByte(const uint16_t elapsedTime);
inline bool reciveSync(const uint16_t elapsedTime);
static inline bool isTime(int16_t input, const uint16_t time, const bool state = true, const uint16_t tollerance = 50);
static inline bool isTime(int16_t input, const uint16_t time, const bool state = true, const uint16_t tollerance = 100);
public: