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

Subversion Repositories or1k

[/] [or1k/] [tags/] [initial/] [orpmon/] [drivers/] [tick.c] - Blame information for rev 1778

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

Line No. Rev Author Line
1 809 simons
 
2
#include "common.h"
3
#include "support.h"
4
#include "spr_defs.h"
5
 
6
#define TICKS_PER_SEC 100
7
 
8
void tick_init(void)
9
{
10
  mtspr(SPR_SR, SPR_SR_TEE | mfspr(SPR_SR));
11
  mtspr(SPR_TTMR, SPR_TTMR_IE | SPR_TTMR_RT | ((TICKS_PER_SEC/IN_CLK) & SPR_TTMR_PERIOD));
12
}
13
 
14
void tick_interrupt(void)
15
{
16
  timestamp++;
17
  mtspr(SPR_TTMR, SPR_TTMR_IE | SPR_TTMR_RT | ((TICKS_PER_SEC/IN_CLK) & SPR_TTMR_PERIOD));
18
}
19
 
20
 

powered by: WebSVN 2.1.0

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