Пример #1
0
void
benchmark_timer_initialize (void)
{
  TIMER_CR (1) = 0x0000;
  TIMER_CR (2) = 0x0000;
  TIMER_DATA (1) = TIMER_FREQ (1000000);
  TIMER_DATA (2) = 0x0000;
  TIMER_CR (1) = TIMER_ENABLE | TIMER_DIV_1;
  TIMER_CR (2) = TIMER_ENABLE | TIMER_CASCADE;
}
Пример #2
0
void gzmcpc_init_time(void) {

  TIMER0_CR = 0;

  // 16khz timer
  TIMER_DATA(0) = TIMER_FREQ(16384);

  // note: emacs syntax tab auto formatting did this to the line extensions.
  TIMER_CR(0) =					\
    TIMER_ENABLE |				\
    TIMER_DIV_1 |				\
    TIMER_IRQ_REQ;

  // configure gzmcp tick timer interrupt handler
  irqSet(IRQ_TIMER0, ms_timer_handler);

  // enable the ms timer irq
  irqEnable(IRQ_TIMER0);

}
Пример #3
0
/* Initialisation ************************************************************* 
 * --------------
 * Paramètres :
 * - parts : les parts qui devront être jouées
 * - nb_parts : le nombre de parts
 ******************************************************************************/
void DemoInit(T_Part* parts, int nb_parts)
{
	TimerMillis = 0;

	DemoParts = parts;
	NbParts = nb_parts;
	CurrentPart = 0;

	mmInitDefaultMem( (mm_addr)soundbank_bin );
	mmSelectMode(MM_MODE_C);
	mmLoad(0);

	// Initialisation du timer
	// Millisecond Timer refresh IRQ
    TIMER1_CR = 0;
    TIMER1_DATA = TIMER_FREQ(0x409);
    TIMER1_CR = TIMER_ENABLE | TIMER_DIV_1 | TIMER_IRQ_REQ;

	irqEnable(IRQ_TIMER1);
    irqSet(IRQ_TIMER1, _TimerMillisInterrupt);
    
    glInit();
}