#include "functions.h" void delayms(uint16_t ms) { t_wait = 0; while(t_wait < ms); } void IntEnable(void) { SREG = sreg_tmp; sei(); } void IntDisable(void) { sreg_tmp = SREG; cli(); } /** \brief MilliSeconds * * Get the milliseconds of TIMER 0 * */ uint32_t MilliSeconds(void) { uint32_t m; ATOMIC_BLOCK(ATOMIC_FORCEON){ m = ms; } return m; } void ResetMilliSeconds(void) { ATOMIC_BLOCK(ATOMIC_FORCEON){ ms = 0; } } /** \brief EEPROM schreiben */ void WriteEEprom(void) { cli(); eeprom_write_byte(&ee_Dummy,0x55); eeprom_write_byte(&ee_WpM, bConfig.WpM); eeprom_write_byte(&ee_IambicMode, bConfig.IambicMode); eeprom_write_word(&ee_FrequencySidetone, bConfig.FrequencySidetone); eeprom_write_byte(&ee_TRX, bConfig.TRX); sei(); } void ReadEEprom(void) { // wpm = eeprom_read_byte(&ee_wpm); } void WriteEEpromWpM(void) { cli(); sprintf(sdebug," %i WpM in EEprom schreiben\r\n",bConfig.WpM); SendSerialString(sdebug); eeprom_write_byte(&ee_WpM, bConfig.WpM); sei(); } void ReadEEpromWpM(void) { cli(); bConfig.WpM = eeprom_read_byte(&ee_WpM); sei(); sprintf(sdebug," %i WpM von EEprom gelesen\r\n",bConfig.WpM); SendSerialString(sdebug); if(bConfig.WpM > 50) { bConfig.WpM = 15; WriteEEpromWpM(); } } void SendSerialChar(unsigned char data) { while(!(UCSR0A & (1<