diff -r 8fede80bde19 -r 96f051df5d60 firmware/user.c --- a/firmware/user.c Fri Jun 27 18:09:13 2008 +0200 +++ b/firmware/user.c Sat Jul 26 14:22:38 2008 +0200 @@ -86,6 +86,9 @@ unsigned char gg_pwm1dc = 0x00; unsigned char gg_mode = MODE_UNMANAGED; +unsigned char ee_display; +unsigned char ee_features; + unsigned char nKeys1, nKeys2; unsigned char oKeys1, oKeys2; unsigned char dKeys1, dKeys2; @@ -110,6 +113,10 @@ // make sure, PC wont start... PIN_POWER = 0; + // read saved settings + ee_display = Read_b_eep (EE_ADDR_DISPLAY); + ee_features = Read_b_eep (EE_ADDR_FEATURES); + // reset INT settings... INTCON = 0x00; // first disable all ints.. @@ -133,16 +140,22 @@ INTCON2bits.RBIP = 0; //make this a low-priority-interrupt PIN_I2C_INT = 1; //switch pin to high-level (doesnt really work.. its an open collector. BUT i've got pullups) DDR_I2C_INT = 1; //woo woo! this one has to be an input, for interrupts to work - nKeys1 = 0xFF - LDByteReadI2C(pcf8574A_1); // make sure to reset i2c_int... just in case... - oKeys1 = nKeys1; - nKeys2 = 0xFF - LDByteReadI2C(pcf8574A_2); - oKeys2 = nKeys2; + if (ee_features && 0x01) + { + nKeys1 = 0xFF - LDByteReadI2C(pcf8574A_1); // make sure to reset i2c_int... just in case... + oKeys1 = nKeys1; + nKeys2 = 0xFF - LDByteReadI2C(pcf8574A_2); + oKeys2 = nKeys2; + } INTCONbits.RBIF = 0; // then clear the flag! INTCONbits.RBIE = 1; // Activate PortB interrupts // enable alarm - LDByteWriteI2C(pcf8583,0x00,0x04); + if (ee_features && 0x00) + { + LDByteWriteI2C(pcf8583,0x00,0x04); + } // Timer3 acts as 'event-ticker' @@ -181,8 +194,11 @@ // init & clear Display - lcd_InitDisplay(); - lcd_InitDisplay(); // ugly workaround... + if (ee_display) + { + lcd_InitDisplay(); + lcd_InitDisplay(); // ugly workaround... + } }//end UserInit