Skip to content

Commit 70f673e

Browse files
committed
Moved imports to speed up on M0
1 parent 645da5f commit 70f673e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

adafruit_character_lcd/character_lcd.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,6 @@
4949
import time
5050
import digitalio
5151
from micropython import const
52-
import adafruit_mcp230xx
53-
import adafruit_74hc595
5452

5553
__version__ = "0.0.0-auto.0"
5654
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_CharLCD.git"
@@ -556,6 +554,7 @@ def __init__(self, i2c, columns, lines, backlight_inverted=False):
556554
on the specified I2C bus with the specified number of columns and
557555
lines on the display. Optionally specify if backlight is inverted.
558556
"""
557+
import adafruit_mcp230xx
559558
self._mcp = adafruit_mcp230xx.MCP23008(i2c)
560559
reset = self._mcp.get_pin(1)
561560
enable = self._mcp.get_pin(2)
@@ -583,6 +582,7 @@ def __init__(self, spi, latch, columns, lines, backlight_inverted=False):
583582
inverted.
584583
"""
585584
# pylint: enable=too-many-arguments
585+
import adafruit_74hc595
586586
self._shift_register = adafruit_74hc595.ShiftRegister74HC595(spi, latch)
587587
reset = self._shift_register.get_pin(1)
588588
enable = self._shift_register.get_pin(2)

adafruit_character_lcd/character_lcd_rgb.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848
import time
4949
import digitalio
5050
from micropython import const
51-
import adafruit_mcp230xx
5251

5352
# pylint: disable-msg=bad-whitespace
5453
# Commands
@@ -572,6 +571,7 @@ def __init__(self, i2c, columns, lines):
572571
on the specified I2C bus with the specified number of columns and lines
573572
on the display.
574573
"""
574+
import adafruit_mcp230xx
575575
self._mcp = adafruit_mcp230xx.MCP23017(i2c)
576576
reset = self._mcp.get_pin(15)
577577
read_write = self._mcp.get_pin(14)

0 commit comments

Comments
 (0)