11 enum Type
{ NONE
, FLASH
, EEPROM
} type
;
12 Section() : type(NONE
), addr(0), siz(0), d(0) {}
13 Section(Type type
, int address
, int size
);
17 void init(Type type
, int address
, int size
);
21 unsigned char *data() { return d
; }
22 int size() const { return siz
; }
23 int address() const { return addr
; }
24 bool isFlash() const { return type
== FLASH
; }
25 bool isEeprom() const { return type
== EEPROM
; }
38 virtual void load(const char * filename
) = 0;
39 virtual bool readNextSection(Section
& sec
) const = 0;
40 const std::string
& functionName(int addr
) const;
43 void addSymbolFlash(int addr
, const char *name
);
44 void addSymbolEeprom(int addr
, const char *name
);
45 void addSymbolRam(int addr
, const char *name
);
48 typedef std::map
<int, std::string
> SymTable
;
52 inline Section::Section(Type type
, int address
, int size
) {
53 init( type
, address
, size
);
56 inline Section::~Section() {
60 inline void Section::init(Type type
, int address
, int size
) {
65 this->d
= new unsigned char[size
];
68 inline void Section::clear() {
81 #endif /*AVR_PROGRAM_H*/