Skip to content

Instantly share code, notes, and snippets.

@scottellis
Created December 6, 2010 11:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save scottellis/730170 to your computer and use it in GitHub Desktop.
Save scottellis/730170 to your computer and use it in GitHub Desktop.
spike_timer_callback
static enum hrtimer_restart spike_timer_callback(struct hrtimer *timer)
{
if (!spike_dev.running) {
return HRTIMER_NORESTART;
}
/* busy means the previous message has not completed */
if (spike_ctl.busy) {
spike_ctl.busy_counter++;
}
else if (spike_queue_spi_write() != 0) {
return HRTIMER_NORESTART;
}
hrtimer_forward_now(&spike_dev.timer,
ktime_set(spike_dev.timer_period_sec,
spike_dev.timer_period_ns));
return HRTIMER_RESTART;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment