OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [or1ksim/] [testsuite/] [test-code-or1k/] [uos/] [tick.c] - Diff between revs 90 and 538

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 90 Rev 538
Line 41... Line 41...
{
{
  /* Call inf routine */
  /* Call inf routine */
  (*tick_inf)();
  (*tick_inf)();
 
 
  /* Set new counter period iand clear inet pending bit */
  /* Set new counter period iand clear inet pending bit */
        mtspr(SPR_TTMR, SPR_TTMR_IE | SPR_TTMR_RT | (tick_period & SPR_TTMR_PERIOD));
  mtspr(SPR_TTMR, SPR_TTMR_IE | SPR_TTMR_RT | (tick_period & SPR_TTMR_TP));
}
}
 
 
/* Initialize routine */
/* Initialize routine */
int tick_init(unsigned long period, void (* inf)())
int tick_init(unsigned long period, void (* inf)())
{
{
  /* Save tick timer period and inform routine */
  /* Save tick timer period and inform routine */
  tick_period = period;
  tick_period = period;
  tick_inf = inf;
  tick_inf = inf;
 
 
  /* Set counter period, enable timer and interrupt */
  /* Set counter period, enable timer and interrupt */
  mtspr(SPR_TTMR, SPR_TTMR_IE | SPR_TTMR_RT | (period & SPR_TTMR_PERIOD));
  mtspr(SPR_TTMR, SPR_TTMR_IE | SPR_TTMR_RT | (period & SPR_TTMR_TP));
 
 
  return 0;
  return 0;
}
}
 
 
 No newline at end of file
 No newline at end of file

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.