Advertisement
jh_elec

Untitled

Jun 2nd, 2018
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.72 KB | None | 0 0
  1. void defaultEEP                 ( void )
  2. {
  3.     /*  EEPROM
  4.     *   Prüfen ob der EEPROM schon initalisiert wurden ist..
  5.     */
  6.     eeprom_busy_wait();
  7.    
  8.     if ( eeprom_read_byte( &eep.byte8[IS_INIT] ) == 0xA3 )
  9.     {
  10.         return;
  11.     }
  12.    
  13.     eeprom_busy_wait();
  14.     eeprom_write_byte(&eep.byte8[BRIGHT]                ,   0xAF    );
  15.     eeprom_busy_wait();
  16.     eeprom_write_byte(&eep.byte8[SOUND_ENABLE]          ,   0x01    );
  17.     eeprom_busy_wait();
  18.     eeprom_write_byte(&eep.byte8[MOTOR_ENABLE]          ,   0x01    );
  19.     eeprom_busy_wait();
  20.     eeprom_write_byte(&eep.byte8[ALERT]                 ,   0x00    );
  21.     eeprom_busy_wait();
  22.     eeprom_write_byte(&eep.byte8[DIMM_HOUR_ON]          ,   20  );
  23.     eeprom_busy_wait();
  24.     eeprom_write_byte(&eep.byte8[DIMM_MINUTE_ON]        ,   0   );
  25.     eeprom_busy_wait();
  26.     eeprom_write_byte(&eep.byte8[DIMM_HOUR_OFF]         ,   12  );
  27.     eeprom_busy_wait();
  28.     eeprom_write_byte(&eep.byte8[DIMM_MINUTE_OFF]       ,   0   );
  29.     eeprom_busy_wait();
  30.     eeprom_write_byte(&eep.byte8[SYNC_HOUR]             ,   3   );
  31.     eeprom_busy_wait();
  32.     eeprom_write_byte(&eep.byte8[SYNC_MINUTE]           ,   0   );
  33.     eeprom_busy_wait();
  34.     eeprom_write_byte(&eep.byte8[MES_MESZ]              ,   0   );
  35.     eeprom_busy_wait();
  36.     eeprom_write_byte(&eep.byte8[AUTO_CHANGE_MINUTE]    ,   5   );
  37.     eeprom_busy_wait();
  38.     eeprom_write_byte(&eep.byte8[AUTO_CHANGE_SECOUND]   ,   0   );
  39.     eeprom_busy_wait();
  40.     eeprom_write_byte(&eep.byte8[ALERT_CYCLES]          ,   1   );
  41.     eeprom_busy_wait();
  42.     eeprom_update_word(&erreep.byte16[SYNC_ERROR_CNT]   ,   0   );
  43.     eeprom_busy_wait();
  44.     eeprom_write_byte(&eep.byte8[DCF77_NUM_OF_RECORDS]  ,   2   );
  45.     eeprom_busy_wait();
  46.        
  47.     for ( uint8_t i = 0 ; i < ALERTS ; i++ )
  48.     {
  49.         eeprom_write_byte( &eep.byte8[ ALERT_HOUR_1 + i ]   ,   i + 1 );
  50.         eeprom_busy_wait();
  51.         eeprom_write_byte( &eep.byte8[ ALERT_MINUTE_1 + i ] ,   0 );
  52.         eeprom_busy_wait();
  53.     }  
  54.        
  55.     eeprom_write_byte(&eep.byte8[IS_INIT]   , 0xA3 );
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement