Merge remote-tracking branch 'upstream/master' into mimxrt-busio-cleanup
This commit is contained in:
commit
9ee278d2ac
|
@ -1,5 +1,5 @@
|
|||
USB_VID = 0x239A
|
||||
USB_PID = 0x0016
|
||||
USB_PID = 0x80B2
|
||||
USB_PRODUCT = "HiiBot BlueFi"
|
||||
USB_MANUFACTURER = "HiiBot"
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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__
|
||||
|
|
Loading…
Reference in New Issue