diff options
| author | Daniel Thompson <daniel@redfelineninja.org.uk> | 2020-02-08 07:49:38 (GMT) |
|---|---|---|
| committer | Daniel Thompson <daniel@redfelineninja.org.uk> | 2020-02-08 07:49:38 (GMT) |
| commit | bb033577dafc71e43a1c66c212cca806d862b657 (patch) | |
| tree | 454b6e2781f631493d7115d980c08adf7dbb3486 /wasp/boards/simulator/micropython.py | |
| parent | bfebf4c25045d0aa21b9ee430904819b4aaeacea (diff) | |
drivers: st7789: Optimize RLE decoding loop
Migrate the filling of the line buffer into a seperate function.
This does naturally reduce the cost of the loop management but
much more importantly allows us to use viper native code
generator.
Diffstat (limited to 'wasp/boards/simulator/micropython.py')
| -rw-r--r-- | wasp/boards/simulator/micropython.py | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/wasp/boards/simulator/micropython.py b/wasp/boards/simulator/micropython.py index a5740f1..578a12d 100644 --- a/wasp/boards/simulator/micropython.py +++ b/wasp/boards/simulator/micropython.py @@ -1,5 +1,16 @@ -def const(x): - return x +def const(fn): + return fn + +def native(fn): + return fn + +def viper(fn): + def ptr8(buf): + return buf + + # This is a bit of a hack since the scope for ptr8 won't be right + # but it does mean no changes to the client + fn.__globals__['ptr8'] = ptr8 + + return fn -def native(x): - return x |
