summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLucian Copeland <hierophect@gmail.com>2020-05-28 12:24:37 -0400
committerLucian Copeland <hierophect@gmail.com>2020-05-28 12:24:37 -0400
commit9ee278d2ac8e23aac2c5235ddff4dae6349f7468 (patch)
tree9fef04609d114a3a76d2b37c44188f4deb0bffb7
parentfd00bb8b7faa630f6450feb27ad079f159a7b322 (diff)
parentf72d166e515a129bb6aa7839eff6392d12742867 (diff)
Merge remote-tracking branch 'upstream/master' into mimxrt-busio-cleanup
-rw-r--r--ports/nrf/boards/hiibot_bluefi/mpconfigboard.mk2
-rw-r--r--shared-bindings/audiobusio/I2SOut.c2
-rw-r--r--shared-bindings/audiocore/RawSample.c2
-rw-r--r--shared-bindings/audioio/AudioOut.c2
-rw-r--r--shared-bindings/audiopwmio/PWMAudioOut.c2
-rw-r--r--tools/extract_pyi.py17
6 files changed, 21 insertions, 6 deletions
diff --git a/ports/nrf/boards/hiibot_bluefi/mpconfigboard.mk b/ports/nrf/boards/hiibot_bluefi/mpconfigboard.mk
index ad477e534..b6614f8b3 100644
--- a/ports/nrf/boards/hiibot_bluefi/mpconfigboard.mk
+++ b/ports/nrf/boards/hiibot_bluefi/mpconfigboard.mk
@@ -1,5 +1,5 @@
USB_VID = 0x239A
-USB_PID = 0x0016
+USB_PID = 0x80B2
USB_PRODUCT = "HiiBot BlueFi"
USB_MANUFACTURER = "HiiBot"
diff --git a/shared-bindings/audiobusio/I2SOut.c b/shared-bindings/audiobusio/I2SOut.c
index d965aac89..fd71a6e85 100644
--- a/shared-bindings/audiobusio/I2SOut.c
+++ b/shared-bindings/audiobusio/I2SOut.c
@@ -61,7 +61,7 @@
//| length = 8000 // 440
//| sine_wave = array.array("H", [0] * length)
//| for i in range(length):
-//| sine_wave[i] = int(math.sin(math.pi * 2 * i / 18) * (2 ** 15) + 2 ** 15)
+//| sine_wave[i] = int(math.sin(math.pi * 2 * i / length) * (2 ** 15) + 2 ** 15)
//|
//| sine_wave = audiocore.RawSample(sine_wave, sample_rate=8000)
//| i2s = audiobusio.I2SOut(board.D1, board.D0, board.D9)
diff --git a/shared-bindings/audiocore/RawSample.c b/shared-bindings/audiocore/RawSample.c
index c0f9325e6..2eadf1fab 100644
--- a/shared-bindings/audiocore/RawSample.c
+++ b/shared-bindings/audiocore/RawSample.c
@@ -61,7 +61,7 @@
//| length = 8000 // 440
//| sine_wave = array.array("h", [0] * length)
//| for i in range(length):
-//| sine_wave[i] = int(math.sin(math.pi * 2 * i / 18) * (2 ** 15))
+//| sine_wave[i] = int(math.sin(math.pi * 2 * i / length) * (2 ** 15))
//|
//| dac = audioio.AudioOut(board.SPEAKER)
//| sine_wave = audiocore.RawSample(sine_wave)
diff --git a/shared-bindings/audioio/AudioOut.c b/shared-bindings/audioio/AudioOut.c
index 574868202..9ba72bd41 100644
--- a/shared-bindings/audioio/AudioOut.c
+++ b/shared-bindings/audioio/AudioOut.c
@@ -61,7 +61,7 @@
//| length = 8000 // 440
//| sine_wave = array.array("H", [0] * length)
//| for i in range(length):
-//| sine_wave[i] = int(math.sin(math.pi * 2 * i / 18) * (2 ** 15) + 2 ** 15)
+//| sine_wave[i] = int(math.sin(math.pi * 2 * i / length) * (2 ** 15) + 2 ** 15)
//|
//| dac = audioio.AudioOut(board.SPEAKER)
//| sine_wave = audiocore.RawSample(sine_wave, sample_rate=8000)
diff --git a/shared-bindings/audiopwmio/PWMAudioOut.c b/shared-bindings/audiopwmio/PWMAudioOut.c
index d6b102317..812b7330d 100644
--- a/shared-bindings/audiopwmio/PWMAudioOut.c
+++ b/shared-bindings/audiopwmio/PWMAudioOut.c
@@ -63,7 +63,7 @@
//| length = 8000 // 440
//| sine_wave = array.array("H", [0] * length)
//| for i in range(length):
-//| sine_wave[i] = int(math.sin(math.pi * 2 * i / 18) * (2 ** 15) + 2 ** 15)
+//| sine_wave[i] = int(math.sin(math.pi * 2 * i / length) * (2 ** 15) + 2 ** 15)
//|
//| dac = audiopwmio.PWMAudioOut(board.SPEAKER)
//| sine_wave = audiocore.RawSample(sine_wave, sample_rate=8000)
diff --git a/tools/extract_pyi.py b/tools/extract_pyi.py
index e590e25f1..d749d202b 100644
--- a/tools/extract_pyi.py
+++ b/tools/extract_pyi.py
@@ -52,7 +52,22 @@ def convert_folder(top_level, stub_directory):
# Validate that the module is a parseable stub.
total += 1
try:
- astroid.parse(stub_contents)
+ tree = astroid.parse(stub_contents)
+ for i in tree.body:
+ if 'name' in i.__dict__:
+ print(i.__dict__['name'])
+ for j in i.body:
+ if isinstance(j, astroid.scoped_nodes.FunctionDef):
+ if None in j.args.__dict__['annotations']:
+ print(f"Missing parameter type: {j.__dict__['name']} on line {j.__dict__['lineno']}\n")
+ if j.returns:
+ if 'Any' in j.returns.__dict__.values():
+ print(f"Missing return type: {j.__dict__['name']} on line {j.__dict__['lineno']}")
+ elif isinstance(j, astroid.node_classes.AnnAssign):
+ if 'name' in j.__dict__['annotation'].__dict__:
+ if j.__dict__['annotation'].__dict__['name'] == 'Any':
+ print(f"missing attribute type on line {j.__dict__['lineno']}")
+
ok += 1
except astroid.exceptions.AstroidSyntaxError as e:
e = e.__cause__