Browse Source

Add missing AVR eeprom functions

teensy4-core
PaulStoffregen 11 years ago
parent
commit
ecf813e521
2 changed files with 7 additions and 0 deletions
  1. +2
    -0
      teensy3/avr_functions.h
  2. +5
    -0
      teensy3/eeprom.c

+ 2
- 0
teensy3/avr_functions.h View File

@@ -46,6 +46,8 @@ void eeprom_write_byte(uint8_t *addr, uint8_t value);
void eeprom_write_word(uint16_t *addr, uint16_t value);
void eeprom_write_dword(uint32_t *addr, uint32_t value);
void eeprom_write_block(const void *buf, void *addr, uint32_t len);
int eeprom_is_ready(void);
#define eeprom_busy_wait() do {} while (!eeprom_is_ready())

static inline float eeprom_read_float(const float *addr) __attribute__((pure, always_inline, unused));
static inline float eeprom_read_float(const float *addr)

+ 5
- 0
teensy3/eeprom.c View File

@@ -137,6 +137,11 @@ void eeprom_read_block(void *buf, const void *addr, uint32_t len)
}
}

int eeprom_is_ready(void)
{
return (FTFL_FCNFG & FTFL_FCNFG_EEERDY) ? 1 : 0;
}

static void flexram_wait(void)
{
while (!(FTFL_FCNFG & FTFL_FCNFG_EEERDY)) {

Loading…
Cancel
Save