summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Shawcroft <scott.shawcroft@gmail.com>2017-05-24 10:53:04 -0700
committerScott Shawcroft <scott.shawcroft@gmail.com>2017-05-24 10:53:52 -0700
commit3cad7b7b0329c130a4991d53dd1354bd632d02c4 (patch)
tree0275ff3d00c1ee430d8e4849f7fb4516cad93ba9
parentb444788451e4f9cfbe942518c48c761b27195339 (diff)
atmel-samd: correctly reset the REPL history on reload. Fixes #141
-rw-r--r--atmel-samd/main.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/atmel-samd/main.c b/atmel-samd/main.c
index a45a59d1e..5eabd7d74 100644
--- a/atmel-samd/main.c
+++ b/atmel-samd/main.c
@@ -125,6 +125,9 @@ void reset_mp(void) {
disk_ioctl(1, CTRL_SYNC, NULL);
disk_ioctl(2, CTRL_SYNC, NULL);
+ // Clear the readline history. It references the heap we're about to destroy.
+ readline_init0();
+
#if MICROPY_ENABLE_GC
gc_init(heap, heap + sizeof(heap));
#endif