Skip to content
This repository was archived by the owner on Apr 25, 2021. It is now read-only.

Commit 8971339

Browse files
committed
oprom modules 고침
1 parent 911c1b1 commit 8971339

3 files changed

Lines changed: 10 additions & 12 deletions

File tree

src/modules/_bios.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import builtins
22
import sys
33

4-
import micropython
54
import machine
5+
import micropython
66
import uos
7+
from machine import components
78

89
from component import devices, Component
910
from handler import monitor
10-
from machine import components
1111
from vfs import FileSystem
1212

1313

src/modules/_boot.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,2 @@
1-
import machine
2-
from handler import print_handler, signal_handler, input_handler
3-
machine.interrupt_hook(signal_handler)
4-
machine.input_hook(input_handler)
5-
machine.print_hook(print_handler)
6-
7-
__all__ = ["print_handler", "signal_handler"]
8-
del __all__
1+
# noinspection PyUnresolvedReferences
2+
import handler

src/modules/handler.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,36 @@
1-
from machine import signal as pop_signal, debug
1+
import machine
2+
from machine import debug, signal as pop_signal
23

34
from component import Component, Monitor, devices
45

56
devices = devices()
67
gpu = devices["gpu"]
78
screen = devices["screen"]
89

9-
gpu.bind(screen.address)
1010
monitor = Monitor(gpu)
11+
gpu.bind(screen.address)
1112
gpu.fill(1, 1, monitor.widthSize, monitor.heightSize, " ")
1213

1314
buf = []
1415

1516

17+
@machine.hook_input
1618
def input_handler():
1719
while not buf:
1820
signal_handler()
1921

2022
return int(buf.pop(0))
2123

2224

25+
@machine.hook_print
2326
def print_handler(buf):
2427
try:
2528
monitor.put(buf)
2629
except BaseException as e:
2730
debug("print_handler exc =? %s: %s" % (type(e).__name__, e))
2831

2932

33+
@machine.hook_signal
3034
def signal_handler():
3135
DEBUG = False
3236
try:

0 commit comments

Comments
 (0)