/****************************************************************************** * Function: void writeEE(unsigned char address, float data) * * PreCondition: None * * Input: address, data * * Output: None * * Side Effects: None * * Overview: Writes a float (4 bytes) to EEPROM * Send it the address and the data to place in that address * * Note: MUST HAVE INTERRUPTS TURNED OFF! - do this in HISR * PROBLEM - this might slow everything down (but only takes 32 cycles normally...) *****************************************************************************/ void writeEE_float(unsigned char address, float data) { int i; for (i = 0; i < 4; i++) { writeEE(i + address, *(((char*)&data)+i) ) ; } }
//Kalibriermodus Tiefststand void kaliblow(void) { _delay_ms(200); DClear(DADR); OutStr_DP (DADR,PSTR("SET CMIN: pF")); while(getD(PIN7)); _delay_ms(200); //Nach loslassen der Taste 1.Messung //Kapaziteat Tiefstand messcap(); messcap(); messcap(); Dpos(DADR,9); //Kapazitaet am Display anzeigen DLong(DADR,Cfix,4,1); cli(); writeEE(CMIN,(U8)Cfix); //Gemessene Kapazitaet is EEprom writeEE(CMIN+1,(U8)(Cfix>>8)); sei(); while(!getD(PIN7)); DClear(DADR); OutStr_DP (DADR,PSTR("Fuellstand:000mm")); Dpos(DADR,64); OutStr_DP (DADR,PSTR(" Hz pF")); }