Skip to content

Commit 0fa5f6a

Browse files
author
dherrada
committed
Merge branch 'extract-types' of https://github.com/dherrada/circuitpython into extract-types
2 parents cf524cb + e67d675 commit 0fa5f6a

File tree

24 files changed

+815
-740
lines changed

24 files changed

+815
-740
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ _build
5252
# Generated rst files
5353
######################
5454
genrst/
55-
autoapi/
55+
/autoapi/
5656

5757
# ctags and similar
5858
###################

Makefile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ help:
6767

6868
clean:
6969
rm -rf $(BUILDDIR)/*
70+
rm -rf autoapi
7071
rm -rf $(STUBDIR) $(DISTDIR) *.egg-info
7172

7273
html: stubs
@@ -213,10 +214,10 @@ check-translate: locale/circuitpython.pot $(wildcard locale/*.po)
213214
$(PYTHON) tools/check_translations.py $^
214215

215216
stubs:
216-
mkdir -p circuitpython-stubs
217-
python tools/extract_pyi.py shared-bindings/ $(STUBDIR)
218-
python tools/extract_pyi.py ports/atmel-samd/bindings $(STUBDIR)
219-
python setup.py sdist
217+
@mkdir -p circuitpython-stubs
218+
@$(PYTHON) tools/extract_pyi.py shared-bindings/ $(STUBDIR)
219+
@$(PYTHON) tools/extract_pyi.py ports/atmel-samd/bindings $(STUBDIR)
220+
@$(PYTHON) setup.py -q sdist
220221

221222
update-frozen-libraries:
222223
@echo "Updating all frozen libraries to latest tagged version."

conf.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,12 @@
7171

7272
autoapi_type = 'python'
7373
# Uncomment this if debugging autoapi
74-
# autoapi_keep_files = True
75-
autoapi_dirs = ['circuitpython-stubs']
74+
autoapi_keep_files = True
75+
autoapi_dirs = [os.path.join('circuitpython-stubs', x) for x in os.listdir('circuitpython-stubs')]
7676
autoapi_add_toctree_entry = False
7777
autoapi_options = ['members', 'undoc-members', 'private-members', 'show-inheritance', 'special-members', 'show-module-summary']
7878
autoapi_template_dir = 'docs/autoapi/templates'
79+
autoapi_python_use_implicit_namespaces = True
7980

8081
# The encoding of source files.
8182
#source_encoding = 'utf-8-sig'
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
{% if not obj.display %}
2+
:orphan:
3+
4+
{% endif %}
5+
:mod:`{{ obj.name }}`
6+
======={{ "=" * obj.name|length }}
7+
8+
.. py:module:: {{ obj.name }}
9+
10+
{% if obj.docstring %}
11+
.. autoapi-nested-parse::
12+
13+
{{ obj.docstring|prepare_docstring|indent(3) }}
14+
15+
{% endif %}
16+
17+
{% block subpackages %}
18+
{% set visible_subpackages = obj.subpackages|selectattr("display")|list %}
19+
{% if visible_subpackages %}
20+
.. toctree::
21+
:titlesonly:
22+
:maxdepth: 3
23+
24+
{% for subpackage in visible_subpackages %}
25+
{{ subpackage.short_name }}/index.rst
26+
{% endfor %}
27+
28+
29+
{% endif %}
30+
{% endblock %}
31+
{% block submodules %}
32+
{% set visible_submodules = obj.submodules|selectattr("display")|list %}
33+
{% if visible_submodules %}
34+
35+
.. toctree::
36+
:titlesonly:
37+
:maxdepth: 1
38+
39+
{% for submodule in visible_submodules %}
40+
{{ submodule.short_name }}/index.rst
41+
{% endfor %}
42+
43+
44+
{% endif %}
45+
{% endblock %}
46+
{% block content %}
47+
{% if obj.all is not none %}
48+
{% set visible_children = obj.children|selectattr("short_name", "in", obj.all)|list %}
49+
{% elif obj.type is equalto("package") %}
50+
{% set visible_children = obj.children|selectattr("display")|list %}
51+
{% else %}
52+
{% set visible_children = obj.children|selectattr("display")|rejectattr("imported")|list %}
53+
{% endif %}
54+
{% if visible_children %}
55+
56+
{% set visible_classes = visible_children|selectattr("type", "equalto", "class")|list %}
57+
{% set visible_functions = visible_children|selectattr("type", "equalto", "function")|list %}
58+
{% if "show-module-summary" in autoapi_options and (visible_classes or visible_functions) %}
59+
{% block classes %}
60+
{% if visible_classes %}
61+
Classes
62+
~~~~~~~
63+
64+
.. autoapisummary::
65+
66+
{% for klass in visible_classes %}
67+
{{ klass.id }}
68+
{% endfor %}
69+
70+
71+
{% endif %}
72+
{% endblock %}
73+
74+
{% block functions %}
75+
{% if visible_functions %}
76+
Functions
77+
~~~~~~~~~
78+
79+
.. autoapisummary::
80+
81+
{% for function in visible_functions %}
82+
{{ function.id }}
83+
{% endfor %}
84+
85+
86+
{% endif %}
87+
{% endblock %}
88+
{% endif %}
89+
{% for obj_item in visible_children %}
90+
{{ obj_item.rendered|indent(0) }}
91+
{% endfor %}
92+
{% endif %}
93+
{% endblock %}

locale/sv.po

Lines changed: 39 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,28 @@
33
# This file is distributed under the same license as the PACKAGE package.
44
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
55
#
6-
#, fuzzy
76
msgid ""
87
msgstr ""
98
"Project-Id-Version: PACKAGE VERSION\n"
109
"Report-Msgid-Bugs-To: \n"
1110
"POT-Creation-Date: 2020-05-12 14:37+1000\n"
12-
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13-
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
11+
"PO-Revision-Date: 2020-05-14 12:41+0000\n"
12+
"Last-Translator: Jonny Bergdahl <[email protected]>\n"
1413
"Language-Team: LANGUAGE <[email protected]>\n"
15-
"Language: \n"
14+
"Language: sv\n"
1615
"MIME-Version: 1.0\n"
1716
"Content-Type: text/plain; charset=UTF-8\n"
1817
"Content-Transfer-Encoding: 8bit\n"
18+
"Plural-Forms: nplurals=2; plural=n != 1;\n"
19+
"X-Generator: Weblate 4.1-dev\n"
1920

2021
#: main.c
2122
msgid ""
2223
"\n"
2324
"Code done running. Waiting for reload.\n"
2425
msgstr ""
26+
"\n"
27+
"Koden har kört klart. Väntar på omladdning.\n"
2528

2629
#: supervisor/shared/safe_mode.c
2730
msgid ""
@@ -35,23 +38,26 @@ msgid ""
3538
"\n"
3639
"To exit, please reset the board without "
3740
msgstr ""
41+
"\n"
42+
"För att avsluta, resetta kortet utan "
3843

3944
#: py/obj.c
4045
msgid " File \"%q\""
41-
msgstr ""
46+
msgstr " Filen \"%q\""
4247

4348
#: py/obj.c
4449
msgid " File \"%q\", line %d"
45-
msgstr ""
50+
msgstr " Fil \"%q\", rad %d"
4651

4752
#: main.c
53+
#, fuzzy
4854
msgid " output:\n"
49-
msgstr ""
55+
msgstr " utdata:\n"
5056

5157
#: py/objstr.c
5258
#, c-format
5359
msgid "%%c requires int or char"
54-
msgstr ""
60+
msgstr "%%c kräver int eller char"
5561

5662
#: shared-bindings/rgbmatrix/RGBMatrix.c
5763
#, c-format
@@ -60,100 +66,101 @@ msgstr ""
6066

6167
#: shared-bindings/microcontroller/Pin.c
6268
msgid "%q in use"
63-
msgstr ""
69+
msgstr "%q används redan"
6470

6571
#: py/obj.c
6672
msgid "%q index out of range"
67-
msgstr ""
73+
msgstr "Index %q ligger utanför intervallet"
6874

6975
#: py/obj.c
7076
msgid "%q indices must be integers, not %s"
71-
msgstr ""
77+
msgstr "Indexet %q måste vara ett heltal, inte %s"
7278

7379
#: shared-bindings/vectorio/Polygon.c
80+
#, fuzzy
7481
msgid "%q list must be a list"
75-
msgstr ""
82+
msgstr "%q-listan måste vara en lista"
7683

7784
#: shared-bindings/_bleio/CharacteristicBuffer.c
7885
#: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c
7986
#: shared-bindings/displayio/Shape.c shared-bindings/vectorio/Circle.c
8087
#: shared-bindings/vectorio/Rectangle.c
8188
msgid "%q must be >= 1"
82-
msgstr ""
89+
msgstr "%q måste vara >= 1"
8390

8491
#: shared-bindings/vectorio/Polygon.c
8592
msgid "%q must be a tuple of length 2"
86-
msgstr ""
93+
msgstr "%q måste vara en tuple av längd 2"
8794

8895
#: shared-bindings/fontio/BuiltinFont.c
8996
msgid "%q should be an int"
90-
msgstr ""
97+
msgstr "%q ska vara en int"
9198

9299
#: py/bc.c py/objnamedtuple.c
93100
msgid "%q() takes %d positional arguments but %d were given"
94-
msgstr ""
101+
msgstr "%q() kräver %d positionsargument men %d gavs"
95102

96103
#: py/argcheck.c
97104
msgid "'%q' argument required"
98-
msgstr ""
105+
msgstr "'%q' argument krävs"
99106

100107
#: py/emitinlinethumb.c py/emitinlinextensa.c
101108
#, c-format
102109
msgid "'%s' expects a label"
103-
msgstr ""
110+
msgstr "'%s' förväntar sig en etikett"
104111

105112
#: py/emitinlinethumb.c py/emitinlinextensa.c
106113
#, c-format
107114
msgid "'%s' expects a register"
108-
msgstr ""
115+
msgstr "'%s' förväntar sig ett register"
109116

110117
#: py/emitinlinethumb.c
111118
#, c-format
112119
msgid "'%s' expects a special register"
113-
msgstr ""
120+
msgstr "'%s' förväntar sig ett specialregister"
114121

115122
#: py/emitinlinethumb.c
116123
#, c-format
117124
msgid "'%s' expects an FPU register"
118-
msgstr ""
125+
msgstr "'%s' förväntar sig ett FPU-register"
119126

120127
#: py/emitinlinethumb.c
121128
#, c-format
122129
msgid "'%s' expects an address of the form [a, b]"
123-
msgstr ""
130+
msgstr "'%s' förväntar sig en adress i formen [a, b]"
124131

125132
#: py/emitinlinethumb.c py/emitinlinextensa.c
126133
#, c-format
127134
msgid "'%s' expects an integer"
128-
msgstr ""
135+
msgstr "'%s' förväntar sig ett heltal"
129136

130137
#: py/emitinlinethumb.c
131138
#, c-format
132139
msgid "'%s' expects at most r%d"
133-
msgstr ""
140+
msgstr "'%s' förväntar sig högst r%d"
134141

135142
#: py/emitinlinethumb.c
136143
#, c-format
137144
msgid "'%s' expects {r0, r1, ...}"
138-
msgstr ""
145+
msgstr "'%s' förväntar sig {r0, r1, ...}"
139146

140147
#: py/emitinlinextensa.c
141148
#, c-format
142149
msgid "'%s' integer %d is not within range %d..%d"
143-
msgstr ""
150+
msgstr "'%s' heltal %d ligger inte inom intervallet %d..%d"
144151

145152
#: py/emitinlinethumb.c
146153
#, c-format
147154
msgid "'%s' integer 0x%x does not fit in mask 0x%x"
148-
msgstr ""
155+
msgstr "'%s' heltal 0x%x får inte plats i mask 0x%x"
149156

150157
#: py/runtime.c
151158
msgid "'%s' object cannot assign attribute '%q'"
152-
msgstr ""
159+
msgstr "Objektet '%s' kan inte tilldela attributet '%q'"
153160

154161
#: py/proto.c
155162
msgid "'%s' object does not support '%q'"
156-
msgstr ""
163+
msgstr "Objektet '%s' har inte stöd för '%q'"
157164

158165
#: py/obj.c
159166
#, c-format
@@ -167,17 +174,17 @@ msgstr ""
167174

168175
#: py/runtime.c
169176
msgid "'%s' object has no attribute '%q'"
170-
msgstr ""
177+
msgstr "Objektet '%s' har inget attribut '%q'"
171178

172179
#: py/runtime.c
173180
#, c-format
174181
msgid "'%s' object is not an iterator"
175-
msgstr ""
182+
msgstr "Objektet '%s' är inte en iterator"
176183

177184
#: py/objtype.c py/runtime.c
178185
#, c-format
179186
msgid "'%s' object is not callable"
180-
msgstr ""
187+
msgstr "Objektet '%s' kan inte anropas"
181188

182189
#: py/runtime.c
183190
#, c-format

ports/atmel-samd/audio_dma.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131

3232
#include "shared-bindings/audiocore/RawSample.h"
3333
#include "shared-bindings/audiocore/WaveFile.h"
34+
#include "supervisor/shared/tick.h"
3435

3536
#include "py/mpstate.h"
3637
#include "py/runtime.h"
@@ -60,6 +61,7 @@ void audio_dma_free_channel(uint8_t channel) {
6061
assert(audio_dma_allocated[channel]);
6162
audio_dma_disable_channel(channel);
6263
audio_dma_allocated[channel] = false;
64+
supervisor_disable_tick();
6365
}
6466

6567
void audio_dma_disable_channel(uint8_t channel) {
@@ -71,6 +73,7 @@ void audio_dma_disable_channel(uint8_t channel) {
7173
void audio_dma_enable_channel(uint8_t channel) {
7274
if (channel >= AUDIO_DMA_CHANNEL_COUNT)
7375
return;
76+
supervisor_enable_tick();
7477
dma_enable_channel(channel);
7578
}
7679

@@ -318,6 +321,9 @@ void audio_dma_reset(void) {
318321
for (uint8_t i = 0; i < AUDIO_DMA_CHANNEL_COUNT; i++) {
319322
audio_dma_state[i] = NULL;
320323
audio_dma_pending[i] = false;
324+
if (audio_dma_allocated[i]) {
325+
supervisor_disable_tick();
326+
}
321327
audio_dma_allocated[i] = false;
322328
audio_dma_disable_channel(i);
323329
dma_descriptor(i)->BTCTRL.bit.VALID = false;

0 commit comments

Comments
 (0)