From ed41fcd1a9843ffde3366183d73cdb8d5fa1b5e2 Mon Sep 17 00:00:00 2001
From: Sergi Hernandez Juan <shernand@iri.upc.edu>
Date: Mon, 19 Oct 2020 16:31:02 +0200
Subject: [PATCH] The function to add an EEPROM memory segment already updated
 the number of EEPROM variables.

---
 memory/src/mem_module.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/memory/src/mem_module.c b/memory/src/mem_module.c
index e972388..5b390ad 100644
--- a/memory/src/mem_module.c
+++ b/memory/src/mem_module.c
@@ -1,6 +1,7 @@
 #include "mem_module.h"
 
 extern unsigned char mem_in_window(unsigned short int mem_start_address,unsigned short int mem_length,unsigned short int start_address,unsigned short int length);
+extern void EE_update_num_variables(unsigned int num);
 
 void mem_module_init(TMemModule *module)
 {
@@ -70,6 +71,7 @@ unsigned char mem_module_add_eeprom_segment(TMemModule *module,unsigned short in
     module->eeprom_segments[module->num_eeprom_segments].start_address=start_address;
     module->eeprom_segments[module->num_eeprom_segments].length=length;
     module->num_eeprom_segments++;
+    EE_update_num_variables(length);
     return 0x01;
   }
   else
-- 
GitLab