coredevice/comm_kernel: attributes writeback update

This commit is contained in:
pca006132 2022-03-26 19:22:39 +08:00
parent bd3ab50a09
commit 6aec423838
2 changed files with 4 additions and 4 deletions

View File

@ -658,10 +658,10 @@ class CommKernel:
return_tags = self._read_bytes()
if service_id == 0:
def service(header, *values):
def service(*values):
counter = 0
for obj in json.loads(header):
old_val = embedding_map.globals_map[obj["id"]]
for obj in embedding_map.attributes_writeback:
old_val = obj["obj"]
if "fields" in obj:
for name in obj["fields"]:
setattr(old_val, name, values[counter])

View File

@ -9,7 +9,7 @@ class EmbeddingMap:
self.string_map = {}
self.string_reverse_map = {}
self.function_map = {}
self.globals_map = {}
self.attributes_writeback = []
# preallocate exception names
# must be kept in sync with EXCEPTION_ID_LOOKUP in artiq/firmware/ksupport/eh_artiq.rs,