projects
/
sx
/
simavr.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
regExp
home
|
summary
|
tags
|
heads
|
shortlog
|
log
|
commit
| commitdiff |
tree
|
raw
|
patch
| inline |
side by side
(parent:
2a257b4
)
Commit
f7baf8c57b19b791863c1e9bb6e59c967ddd4871
author
Michel Pollet
<buserror@gmail.com>
Thu, 2 Sep 2010 11:55:40 +0000
(12:55 +0100)
committer
Michel Pollet
<buserror@gmail.com>
Thu, 2 Sep 2010 11:55:40 +0000
(12:55 +0100)
frees the eeprom memory at teardown time
Signed-off-by: Michel Pollet <buserror@gmail.com>
simavr/sim/avr_eeprom.c
patch
|
blob
|
history
|
download
diff --git
a/simavr/sim/avr_eeprom.c
b/simavr/sim/avr_eeprom.c
index 60043eed85e68b5efa512113d4587bc034b00408..eccedbe7c495c0455abfe059f4a0b4d6cdf3bde0 100644
(file)
--- a/
simavr/sim/avr_eeprom.c
+++ b/
simavr/sim/avr_eeprom.c
@@
-113,9
+113,18
@@
static int avr_eeprom_ioctl(struct avr_io_t * port, uint32_t ctl, void * io_para
return res;
}
+static void avr_eeprom_dealloc(struct avr_io_t * port)
+{
+ avr_eeprom_t * p = (avr_eeprom_t *)port;
+ if (p->eeprom)
+ free(p->eeprom);
+ p->eeprom = NULL;
+}
+
static avr_io_t _io = {
.kind = "eeprom",
.ioctl = avr_eeprom_ioctl,
+ .dealloc = avr_eeprom_dealloc,
};
void avr_eeprom_init(avr_t * avr, avr_eeprom_t * p)