drivers: Add "from micropython import const" when const is used.

Following best-practice use of the const feature, to make it compatible
with Python.
pull/2586/head
Damien George 2016-11-03 12:41:11 +11:00
rodzic 561844f3ba
commit 7bb0f7b0f6
6 zmienionych plików z 7 dodań i 0 usunięć

Wyświetl plik

@ -1,5 +1,6 @@
# MicroPython SSD1306 OLED driver, I2C and SPI interfaces
from micropython import const
import time
import framebuf

Wyświetl plik

@ -1,6 +1,7 @@
"""NRF24L01 driver for Micro Python
"""
from micropython import const
import pyb
# nRF24L01+ registers

Wyświetl plik

@ -21,6 +21,7 @@ Example usage on ESP8266:
"""
from micropython import const
import time

Wyświetl plik

@ -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)

Wyświetl plik

@ -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):

Wyświetl plik

@ -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