Created
April 27, 2012 14:02
-
-
Save mguentner/2509533 to your computer and use it in GitHub Desktop.
Display the EEPROM allocation of an ethersex firmware/config
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Compile with gcc eeprom_check.c -I /usr/avr/include/ -I . within the ethersex directory | |
How to get the MCU define (__AVR_AT....): | |
avr-gcc -mmcu=$MCU -E -dM - < /dev/null | grep _AVR_AT | |
where $MCU is MCU in autoconf.h */ | |
#define __AVR_ATmega644P__ | |
#include "config.h" | |
#include "core/eeprom.h" | |
#include "avr/io.h" | |
int | |
main(void) | |
{ | |
printf("EEPROM: %d/%d bytes: (%.2f%)\n", sizeof(struct eeprom_config_t), | |
(E2END + 1), 100 * (float) sizeof(struct eeprom_config_t) / (E2END + 1) ); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment