boards: simulator: Add ptr32 support
This commit is contained in:
parent
1fe0602995
commit
bfd914a5d1
1 changed files with 8 additions and 3 deletions
|
@ -12,12 +12,17 @@ def viper(fn):
|
||||||
return buf
|
return buf
|
||||||
|
|
||||||
def ptr16(buf):
|
def ptr16(buf):
|
||||||
return memoryview(buf).cast('H')
|
return memoryview(buf).cast('b').cast('H')
|
||||||
|
|
||||||
# This is a bit of a hack since the scope for ptr8 won't be right
|
def ptr32(buf):
|
||||||
# but it does mean no changes to the client
|
return memoryview(buf).cast('b').cast('I')
|
||||||
|
|
||||||
|
# This is a bit of a hack since the scopes don't exactly match where
|
||||||
|
# they would be in micropython but for the simple cases it does mean
|
||||||
|
# no changes to the client
|
||||||
fn.__globals__['ptr8'] = ptr8
|
fn.__globals__['ptr8'] = ptr8
|
||||||
fn.__globals__['ptr16'] = ptr16
|
fn.__globals__['ptr16'] = ptr16
|
||||||
|
fn.__globals__['ptr32'] = ptr32
|
||||||
|
|
||||||
return fn
|
return fn
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue