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

Subversion Repositories openrisc

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

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 355 julius
// No longer called - timpstamp variable incremented in vector code in reset.S
14 2 marcus.erl
void tick_interrupt(void)
15
{
16
  timestamp++;
17
  mtspr(SPR_TTMR, SPR_TTMR_IE | SPR_TTMR_RT | ((IN_CLK/TICKS_PER_SEC) & SPR_TTMR_PERIOD));
18 355 julius
  //spincursor(); // Check if we want to spin the cursor...
19 2 marcus.erl
}
20
 
21
/*
22
  sleep for n timer-ticks
23
*/
24
void sleep(unsigned long sleep_time)
25
{
26
  unsigned long start_time;
27
 
28
  start_time = timestamp;
29
 
30
  while ( (timestamp - start_time) < sleep_time)
31
  ; /* do nothing */
32
}
33
 

powered by: WebSVN 2.1.0

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