platforms/nuttx/src/px4/nxp/kinetis/hrt/hrt.c
static void
hrt_call_reschedule()
{
	hrt_abstime	now = hrt_absolute_time();
	struct hrt_call	*next = (struct hrt_call *)sq_peek(&callout_queue);
	hrt_abstime	deadline = now + HRT_INTERVAL_MAX;

	/*
	 * Determine what the next deadline will be.
	 *
	 * Note that we ensure that this will be within the counter
	 * period, so that when we truncate all but the low 16 bits
	 * the next time the compare matches it will be the deadline
	 * we want.
	 *
	 * It is important for accurate timekeeping that the compare
	 * interrupt fires sufficiently often that the base_time update in
	 * hrt_absolute_time runs at least once per timer period.
	 */
	if (next != NULL) {
		hrtinfo("entry in queue\n");

		if (next->deadline <= (now + HRT_INTERVAL_MIN)) {
			hrtinfo("pre-expired\n");
			/* set a minimal deadline so that we call ASAP */
			deadline = now + HRT_INTERVAL_MIN;

		} else if (next->deadline < deadline) {
			hrtinfo("due soon\n");
			deadline = next->deadline;
		}
	}

	hrtinfo("schedule for %u at %u\n", (unsigned)(deadline & 0xffffffff), (unsigned)(now & 0xffffffff));

	/* set the new compare value and remember it for latency tracking */
	rCNV_HRT = latency_baseline = deadline & 0xffff;
}
/**
 * Reschedule the next timer interrupt.
 *
 * This routine must be called with interrupts disabled.
 */
Reschedule the next timer interrupt.
This routine must be called with interrupts disabled.
Reschedule the next timer interrupt . This routine must be called with interrupts disabled .
static void
hrt_call_reschedule()
{
	hrt_abstime	now = hrt_absolute_time();
	struct hrt_call	*next = (struct hrt_call *)sq_peek(&callout_queue);
	hrt_abstime	deadline = now + HRT_INTERVAL_MAX;
	if (next != NULL) {
		hrtinfo("entry in queue\n");
		if (next->deadline <= (now + HRT_INTERVAL_MIN)) {
			hrtinfo("pre-expired\n");
			deadline = now + HRT_INTERVAL_MIN;
		} else if (next->deadline < deadline) {
			hrtinfo("due soon\n");
			deadline = next->deadline;
		}
	}
	hrtinfo("schedule for %u at %u\n", (unsigned)(deadline & 0xffffffff), (unsigned)(now & 0xffffffff));
	rCNV_HRT = latency_baseline = deadline & 0xffff;
}
static void hrt_call_reschedule ( ) { hrt_abstime now = hrt_absolute_time ( ) ; struct hrt_call * next = ( struct hrt_call * ) sq_peek ( & callout_queue ) ; hrt_abstime deadline = now + HRT_INTERVAL_MAX ; if ( next != NULL ) { hrtinfo ( " \n " ) ; if ( next -> deadline <= ( now + HRT_INTERVAL_MIN ) ) { hrtinfo ( " \n " ) ; deadline = now + HRT_INTERVAL_MIN ; } else if ( next -> deadline < deadline ) { hrtinfo ( " \n " ) ; deadline = next -> deadline ; } } hrtinfo ( " \n " , ( unsigned ) ( deadline & 0xffffffff ) , ( unsigned ) ( now & 0xffffffff ) ) ; rCNV_HRT = latency_baseline = deadline & 0xffff ; }
Reschedule the next timer interrupt.
Reschedule the next timer interrupt .
/*
	 * Determine what the next deadline will be.
	 *
	 * Note that we ensure that this will be within the counter
	 * period, so that when we truncate all but the low 16 bits
	 * the next time the compare matches it will be the deadline
	 * we want.
	 *
	 * It is important for accurate timekeeping that the compare
	 * interrupt fires sufficiently often that the base_time update in
	 * hrt_absolute_time runs at least once per timer period.
	 */ /* set a minimal deadline so that we call ASAP */ /* set the new compare value and remember it for latency tracking */