From 9a8c7ea79fd1ab60235d0732f47f890087c70156 Mon Sep 17 00:00:00 2001 From: Jack Date: Thu, 28 May 2020 09:15:33 +0000 Subject: [PATCH] Give sys_block scratchpad a default value Commit 71aeffb introduced a required default scratchpad value to the sys_block YellowBlock, causing all instantiations of it which don't privide one to break. This commit simply gives gives a default value of zero if no other value has been specified at construction. --- jasper_library/yellow_blocks/sys_block.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/jasper_library/yellow_blocks/sys_block.py b/jasper_library/yellow_blocks/sys_block.py index abe89937e4..26bd3b425d 100644 --- a/jasper_library/yellow_blocks/sys_block.py +++ b/jasper_library/yellow_blocks/sys_block.py @@ -6,7 +6,8 @@ class sys_block(YellowBlock): def initialize(self): self.typecode = TYPECODE_SYSBLOCK - self.add_source('sys_block') + self.add_source('sys_block') + if not hasattr(self, 'scratchpad'): self.scratchpad = 0 # the internal memory_map self.memory_map = [ Register('sys_board_id', mode='r', offset=0, default_val=self.board_id),