
AN07-00200-03E
77
Next, an interrupt is created when SW2 is pushed. The external interrupt function _interrupt void
Ext_int1_5 in ext_int.c will be called as shown in “Figure 4-15 SW2 interrupts (LED on/off
processing)”.Here, the LED display is turned on/off, due to the output settings for the port connected
to the LED, or due to the switch being pressed several times, is shown.
Figure 4-15 SW2 interrupts (LED on/off processing)
An interrupt is also created if SW3 is pressed, and the external interrupt function __interrupt void
Ext_int2_6 in ext_int.c is called as shown in “Figure 4-16 SW3 interrupts (buzzer output
processing)”.This is where the PPG timer output settings are made, and timer start/stop process is
performed.
Figure 4-16 SW3 interrupts (buzzer output processing)
_interrupt void Ext_int1_5(void)
{
IO_EIC20.bit.EIR1 = 0;
if (TEMP_MEASURE_OFF){
IO_DDR1.bit.P14 = 1;
IO_DDR1.bit.P15 = 1;
IO_DDR1.bit.P16 = 1;
S+;
if(SW_count > 3){
SW_count = 0;
}
IO_PDR1.byte = LED_pat[SW_count];
}
else if(TEMP_MEASURE_ON){
(Omitted)
}
}
When using Volume SW
Using temperature sensor
Port output setting
LED ON processing
__interrupt void Ext_int2_6(void)
{
IO_EIC30.bit.EIR0 = 0;
IO_PC00.byte = 0x0E;
IO_PPGS.byte = ~IO_PPGS.byte;
}
PPG timer output setting
PPG timer start/stop