#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_iambic, bConfig.iambic); eeprom_write_word(&ee_sidetone_f, bConfig.sidetone_f); eeprom_write_byte(&ee_trx, bConfig.trx); sei(); } void ReadEEProm(void) { // wpm = eeprom_read_byte(&ee_wpm); } void WriteEEProm_WpM(void) { cli(); eeprom_write_byte(&ee_wpm, bConfig.wpm); sei(); } void ReadEEProm_WpM(void) { cli(); bConfig.wpm = eeprom_read_byte(&ee_wpm); sei(); if(bConfig.wpm > 50) { bConfig.wpm = 15; WriteEEProm_WpM(); } } /** \brief Read port pin of morse keys * This function reads the input of * the Paddle or Straight key. * */ uint8_t ReadKeyPin(uint8_t pin) { return(PIND & (1<