-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmultitask.py
executable file
·50 lines (35 loc) · 994 Bytes
/
multitask.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/usr/bin/python
# Multi Tasker
from boneless.arch.opcode import Instr
from boneless.arch.opcode import *
from spork.firmware.base import *
from spork.lib.uartIO import UART
from spork.firmware.firmware import Firmware
from spork.logger import logger
log = logger(__name__)
from spork.lib.alloc import GAlloc
class MultiTask(Firmware):
def setup(self):
"registers in the bottom Window"
self.w.req(["temp", "counter", "pointer", "dur", "size"])
def prelude(self):
return []
def instr(self):
w = self.w
reg = self.reg
ll = LocalLabels()
uart = UART()
ma = GAlloc()
return [
MOVI(w.size, 10),
ma(w.size, ret=[w.pointer]),
uart.writeHex(w.pointer),
uart.cr(),
]
firmware = MultiTask
if __name__ == "__main__":
from spork.upload import Uploader
import fwtest
spork = fwtest.build(firmware)
up = Uploader()
up.upload(spork)