Skip to content

Commit

Permalink
Accept np.int32 and np.uint32 as write data type. Fix Xilinx#634
Browse files Browse the repository at this point in the history
  • Loading branch information
Mario Ruiz committed Jan 29, 2022
1 parent b85f453 commit a7dc4d0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pynq/mmio.py
Expand Up @@ -176,9 +176,9 @@ def write_mm(self, offset, data):
if offset % 4:
raise MemoryError('Unaligned write: offset must be multiple of 4.')

if type(data) is int:
if isinstance(data, (int, np.int32, np.uint32)):
self.array[idx] = np.uint32(data)
elif type(data) is bytes:
elif isinstance(data, bytes):
length = len(data)
num_words = length >> 2
if length % 4:
Expand Down

0 comments on commit a7dc4d0

Please sign in to comment.