25 #include <avr/interrupt.h>
38 #define EEPROM_IGNORE_SELFPROG
51 do {}
while( EECR & (1<<
EEPE) );
81 do {}
while( EECR & (1<<
EEPE) );
82 #ifndef EEPROM_IGNORE_SELFPROG
83 do {}
while( SPMCSR & (1<<SELFPRGEN) );
89 diff_mask = old_value ^ new_value;
92 if( diff_mask & new_value ) {
96 if( new_value != 0xff ) {
130 unsigned char checksum = 0;
131 for(; size > 0; size--) {
132 checksum = (checksum << 1) || (checksum >> 7);
140 unsigned char data, checksum = 0;
141 for(; size > 0; size--) {
143 checksum = (checksum << 1) || (checksum >> 7);
145 *(destination++) = data;
#define EEPM1
These two are unfortunately not defined in the device include files.
#define EEPM0
EEPROM Programming Mode Bit 0.
#define EEMPE
EEPROM master program/write enable.
unsigned char eeprom_get_char(unsigned int addr)
Read byte from EEPROM.
int memcpy_from_eeprom_with_checksum(char *destination, unsigned int source, unsigned int size)
void eeprom_put_char(unsigned int addr, unsigned char new_value)
Write byte to EEPROM.
#define EEPE
These EEPROM bits have different names on different devices.
void memcpy_to_eeprom_with_checksum(unsigned int destination, char *source, unsigned int size)
Extensions added as part of Grbl.