OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [bootloaders/] [orpmon/] [drivers/] [tick.c] - Blame information for rev 343

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 marcus.erl
 
2
#include "common.h"
3
#include "support.h"
4 246 julius
#include "spr-defs.h"
5 140 julius
#include "spincursor.h"
6 2 marcus.erl
 
7
void tick_init(void)
8
{
9
  mtspr(SPR_SR, SPR_SR_TEE | mfspr(SPR_SR));
10
  mtspr(SPR_TTMR, SPR_TTMR_IE | SPR_TTMR_RT | ((IN_CLK/TICKS_PER_SEC) & SPR_TTMR_PERIOD));
11
}
12
 
13
void tick_interrupt(void)
14
{
15
  timestamp++;
16
  mtspr(SPR_TTMR, SPR_TTMR_IE | SPR_TTMR_RT | ((IN_CLK/TICKS_PER_SEC) & SPR_TTMR_PERIOD));
17 140 julius
  spincursor(); // Check if we want to spin the cursor...
18 2 marcus.erl
}
19
 
20
/*
21
  sleep for n timer-ticks
22
*/
23
void sleep(unsigned long sleep_time)
24
{
25
  unsigned long start_time;
26
 
27
  start_time = timestamp;
28
 
29
  while ( (timestamp - start_time) < sleep_time)
30
  ; /* do nothing */
31
}
32
 

powered by: WebSVN 2.1.0

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