int main() { CyGlobalIntDisable; isr_sw_StartEx(SW_Int); CyGlobalIntEnable; /* Enable global interrupts */ UART_1_Start(); Timer_1_Start(); Timer_2_Start(); for(;;) { if(press == 2){ time_s = abs(seconds_new - seconds_old)/1000; time_ms = (ms_old + 24000 - ms_new); UART_1_UartPutString("\n \r Time Between Presses: "); PrintInt(time_s); UART_1_UartPutString("."); PrintInt(time_ms); UART_1_UartPutString(" s"); press = 0; } } }
void sonido(uint8 ld) { SDown_Write(1); CyDelay(250); if(ld==1){ isr_1_StartEx(Interrupcion_1); Timer_1_Start(); VDAC8_1_Start(); i1=0; NextSample_1=0; } else{ isr_2_StartEx(Interrupcion_2); Timer_2_Start(); VDAC8_2_Start(); i2=0; NextSample_2=0; } }