drivers: Add "from micropython import const" when const is used.
Following best-practice use of the const feature, to make it compatible with Python.
This commit is contained in:
parent
561844f3ba
commit
7bb0f7b0f6
@ -1,5 +1,6 @@
|
||||
# MicroPython SSD1306 OLED driver, I2C and SPI interfaces
|
||||
|
||||
from micropython import const
|
||||
import time
|
||||
import framebuf
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
"""NRF24L01 driver for Micro Python
|
||||
"""
|
||||
|
||||
from micropython import const
|
||||
import pyb
|
||||
|
||||
# nRF24L01+ registers
|
||||
|
@ -21,6 +21,7 @@ Example usage on ESP8266:
|
||||
|
||||
"""
|
||||
|
||||
from micropython import const
|
||||
import time
|
||||
|
||||
|
||||
|
@ -1,6 +1,8 @@
|
||||
# DS18x20 temperature sensor driver for MicroPython.
|
||||
# MIT license; Copyright (c) 2016 Damien P. George
|
||||
|
||||
from micropython import const
|
||||
|
||||
_CONVERT = const(0x44)
|
||||
_RD_SCRATCH = const(0xbe)
|
||||
_WR_SCRATCH = const(0x4e)
|
||||
|
@ -1,6 +1,7 @@
|
||||
# 1-Wire driver for MicroPython on ESP8266
|
||||
# MIT license; Copyright (c) 2016 Damien P. George
|
||||
|
||||
from micropython import const
|
||||
import _onewire as _ow
|
||||
|
||||
class OneWireError(Exception):
|
||||
|
@ -14,6 +14,7 @@ See:
|
||||
STM32Cube_FW_F4_V1.1.0/Projects/STM32F4-Discovery/Demonstrations/Src/main.c
|
||||
"""
|
||||
|
||||
from micropython import const
|
||||
from pyb import Pin
|
||||
from pyb import SPI
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user