void main(void)
{
setup_adc_ports(NO_ANALOGS|VSS_VDD);
setup_adc(ADC_OFF);
setup_spi(SPI_SS_DISABLED);
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
setup_timer_1(T1_DISABLED);
setup_timer_2(T2_DISABLED,0,1);
setup_comparator(NC_NC_NC_NC);// This device COMP currently not supported by the PICWizard
enable_interrupts(INT_RB4); //debí poner así, ya que INT_RB no funcionaba,
enable_interrupts(INT_RB5); //las interrupciones se configuran pin a pin
enable_interrupts(INT_RB6);
enable_interrupts(INT_RB7);
enable_interrupts(GLOBAL); // enable a todas...
setup_oscillator(OSC_8MHZ);
//---------------------------------
lcd_init();
Lcd_putc("Panobot V1.0"); // <<<--- Acá me trae al cambiar RB4 (o más arriva...), la unica forma de llegar acá es reiniciando
delay_ms(1000);
set_tris_c(0b11110000);
port_c = 1;
bandera = 1;
while (1) {
if (bandera == 1) { //acá entra la bandera, si está en 0 no hace nada...
bandera = 0; // si se produjo la interrupción, resetea la bandera y
menu(); // ejecuta el menu (que es donde se hace todo...)
}
}
}