/* Check if a time difference calculation is valid and return the difference.  */
static bool isoal_get_time_diff(uint32_t time_before, uint32_t time_after, uint32_t *result)
/* Check if a time difference calculation is valid and return the difference.  */
static bool isoal_get_time_diff(uint32_t time_before, uint32_t time_after, uint32_t *result)
{
	bool valid = false;
	LL_ASSERT(time_before <= ISOAL_TIME_WRAPPING_POINT_US);
	LL_ASSERT(time_after <= ISOAL_TIME_WRAPPING_POINT_US);
	if (time_before > time_after) {
		if (time_before >= ISOAL_TIME_MID_POINT_US &&
			time_after <= ISOAL_TIME_MID_POINT_US) {
			if ((time_before - time_after) <=  ISOAL_TIME_SPAN_HALF_US) {
			} else {
				*result = time_after + ISOAL_TIME_SPAN_FULL_US - time_before;
				valid = true;
			}
		}
	} else {
		*result = time_after - time_before;
		if (*result <=  ISOAL_TIME_SPAN_HALF_US) {
			valid = true;
		} else {
		}
	}
	return valid;
}