Renesas Single-Chip Microcomputer M38C89T-ADF Uživatelský manuál Strana 119

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 138
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 118
5-3
5
4BUsage Examples
5.1 21BInterrupt control
);
if ((irq_status & 0x01) == 0)
{
/* Disable IRQ1 */
R_INTC_ControlExtInterrupt(
PDL_INTC_IRQ1,
PDL_INTC_CLEAR_IR_FLAG
);
}
/* Has IRQ2 triggered? */
if (irq2_low == 1)
{
/* Re-enable the interrupt if the signal has returned to the high level */
R_IO_PORT_Compare(
PDL_IO_PORT_E_2,
1,
ReEnableIRQ2
);
}
}
}
void IRQ0Handler(void)
{
/* Process the IRQ0 event here (the flag is cleared automatically */
switch_sw1_pressed = 1;
}
void IRQ2Handler(void)
{
/* Disable the level-triggered interrupt */
R_INTC_ControlExtInterrupt(
PDL_INTC_IRQ2,
PDL_INTC_CLEAR_IR_FLAG
);
irq2_low = 1;
}
static void ReEnableIRQ2 (void)
{
/* Re-enable the interrupt (and try to clear it) */
R_INTC_ControlExtInterrupt(
PDL_INTC_IRQ2,
PDL_INTC_ENABLE | PDL_INTC_CLEAR_IR_FLAG
);
}
Figure 5-1 Example of External Interrupt
Zobrazit stránku 118
1 2 ... 114 115 116 117 118 119 120 121 122 123 124 ... 137 138

Komentáře k této Příručce

Žádné komentáře