DIAG_MAX_DIFFERENCE

#define DIAG_MAX_DIFFERENCE (uint16_t) ((1e0L * DIAG_TIMER_COUNT_REF * DIAG_TOLERANCE_LIMIT) / 100L )

This is a macro to set the Maximum absolute difference between the reference and estimated frequencies. Note that multiplying by 1e0L forces the preprocessor to do operations with higher precision.