浏览代码

board:tricorder: always work with valid eeprom data

Commit 890880583d84607e36b52a785a96b167728bbf73 introduced EEPROM parsing and
board detection but faild to return a valid tricorder_eeprom struct for backup
case.  When pressing S200 while reading EEPROM we ignore the value. We
returned falsely a tricorder_eeprom struct with uninitialized data which is
just garbage.
Initialize it by zeroing the whole structure.

Signed-off-by: Andreas Bießmann <andreas.biessmann@corscience.de>
Cc: Thomas Weber <thomas.weber@corscience.de>
Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
Andreas Bießmann 11 年之前
父节点
当前提交
1ea2301fcf
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      board/corscience/tricorder/tricorder.c

+ 2 - 0
board/corscience/tricorder/tricorder.c

@@ -79,6 +79,8 @@ static void get_eeprom(struct tricorder_eeprom *eeprom)
 		} else {
 			panic("Could not get board revision\n");
 		}
+	} else {
+		memset(eeprom, 0, TRICORDER_EEPROM_SIZE);
 	}
 }