         Serial.print((int) value);
 }
 
+static uint8_t calcCrc (const void* ptr, uint8_t len) {
+    uint16_t crc = ~0;
+    for (byte i = 0; i < sizeof config - 2; ++i)
+        crc = _crc16_update(crc, ((const byte*) ptr)[i]);
+    return crc;
+}
+
+static uint8_t calcCrcEeprom (const void* ptr, uint8_t len) {
+    uint16_t crc = ~0;
+    for (byte i = 0; i < sizeof config - 2; ++i)
+        crc = _crc16_update(crc, eeprom_read_byte((const byte*) ptr + i));
+    return crc;
+}
+
 static void loadConfig () {
     eeprom_read_block(&config, RF12_EEPROM_ADDR, sizeof config);
 }
 
 static void saveConfig () {
     config.format = MAJOR_VERSION;
-    config.crc = ~0;
-    for (byte i = 0; i < sizeof config - 2; ++i)
-        config.crc = _crc16_update(config.crc, ((byte*) &config)[i]);
+    config.crc = calcCrc(&config, sizeof config - 2);
 
     eeprom_write_block(&config, RF12_EEPROM_ADDR, sizeof config);
-    Serial.println(sizeof config);
 
     if (rf12_configSilent())
         rf12_configDump();

                config.nodeId = (value << 6) + (config.nodeId & 0x3F);
                config.frequency_offset = 1600;
                saveConfig();
            } else {
                showString(INVALID1);
            }
            break;

        case 'o': // Increment frequency within band
                Serial.print(config.frequency_offset);
// Stay within your country's ISM spectrum management guidelines, i.e.
// allowable frequencies and their use when selecting operating frequencies.
                if (value) {
                    if ((value > 95) && (value < 3904)) {    // supported by the RFM12B
                        config.frequency_offset = value;
                        Serial.print('>');
                        Serial.println(config.frequency_offset);
                        saveConfig();
                    }
                    else {
                        showString(INVALID1);
                    }
                }
                else {
                    Serial.println();
                }
            break;

        case 'g': // set network group

        config.frequency_offset = 1600;
        config.quiet_mode = true;   // Default flags, quiet on
        saveConfig();
        rf12_configSilent();
    }
    
    rf12_configDump();
