8000 Merge branch 'adafruit:main' into issue-9937 · cezer-io/circuitpython@06a2fe1 · GitHub
[go: up one dir, main page]

Skip to content

Commit 06a2fe1

Browse files
authored
Merge branch 'adafruit:main' into issue-9937
2 parents 3da2914 + b044c4c commit 06a2fe1

File tree

20 files changed

+99
-28
lines changed

20 files changed

+99
-28
lines changed

Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,22 +156,28 @@ epub:
156156
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
157157

158158
latex:
159+
$(PYTHON) docs/prepare_readme_for_latex.py
159160
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
161+
mv README.rst.bak README.rst
160162
@echo
161163
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
162164
@echo "Run \`make' in that directory to run these through (pdf)latex" \
163165
"(use \`make latexpdf' here to do that automatically)."
164166

165167
# seems to be malfunctioning
166168
latexpdf:
169+
$(PYTHON) docs/prepare_readme_for_latex.py
167170
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
171+
mv README.rst.bak README.rst
168172
@echo "Running LaTeX files through pdflatex..."
169173
$(MAKE) -C $(BUILDDIR)/latex all-pdf
170174
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
171175

172176
# seems to be malfunctioning
173177
latexpdfja:
178+
$(PYTHON) docs/prepare_readme_for_latex.py
174179
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
180+
mv README.rst.bak README.rst
175181
@echo "Running LaTeX files through platex and dvipdfmx..."
176182
$(MAKE) -C $(BUILDDIR)/latex all-pdf-ja
177183
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."

docs/prepare_readme_for_latex.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import shutil
2+
3+
with open("README.rst", "r") as f:
4+
readme_content = f.read()
5+
6+
shutil.copyfile("README.rst", "README.rst.bak")
7+
8+
# turn badge into text only
9+
modified_readme_content = readme_content.replace("|Weblate|", "Weblate", 1)
10+
11+
# remove image link
12+
badge_link_lines = """.. |Weblate| image:: https://hosted.weblate.org/widgets/circuitpython/-/svg-badge.svg
13+
:target: https://hosted.weblate.org/engage/circuitpython/?utm_source=widget"""
14+
15+
modified_readme_content = modified_readme_content.replace(badge_link_lines, "")
16+
17+
with open("README.rst", "w") as f:
18+
f.write(modified_readme_content)

ports/broadcom/supervisor/port.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,11 @@ uint64_t port_get_raw_ticks(uint8_t *subticks) {
143143
}
144144
COMPLETE_MEMORY_READS;
145145
uint64_t microseconds = hi << 32 | lo;
146-
return 1024 * (microseconds / 1000000) + (microseconds % 1000000) / 977;
146+
int64_t all_subticks = microseconds * 512 / 15625;
147+
if (subticks != NULL) {
148+
*subticks = all_subticks % 32;
149+
}
150+
return all_subticks / 32;
147151
}
148152

149153
void TIMER_1_IRQHandler(void) {

ports/cxd56/supervisor/port.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,9 @@ void board_timerhook(void) {
124124

125125
uint64_t port_get_raw_ticks(uint8_t *subticks) {
126126
uint64_t count = cxd56_rtc_count();
127-
*subticks = count % 32;
127+
if (subticks != NULL) {
128+
*subticks = count % 32;
129+
}
128130

129131
return count / 32;
130132
}

ports/espressif/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,7 @@ else ifeq ($(IDF_TARGET),esp32c3)
268268
LDFLAGS += \
269269
-Tesp32c3.rom.newlib.ld \
270270
-Tesp32c3.rom.version.ld \
271+
-Tesp32c3.rom.eco3_bt_funcs.ld \
271272
-Tesp32c3.rom.eco3.ld \
272273
-Tesp32c3.rom.bt_funcs.ld
273274

ports/litex/supervisor/port.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,9 @@ uint64_t port_get_raw_ticks(uint8_t *subticks) {
114114
common_hal_mcu_disable_interrupts();
115115
uint64_t raw_tick_snapshot = raw_ticks;
116116
common_hal_mcu_enable_interrupts();
117+
if (subticks != NULL) {
118+
*subticks = 0;
119+
}
117120
return raw_tick_snapshot;
118121
}
119122

ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1011/pin_names.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66
//
77
// SPDX-License-Identifier: MIT
88

9-
#pragma once
10-
9+
// OK to include more than once because FORMAT_PIN may be different.
1110

1211
// define FORMAT_PIN(pin_name) and then include this file.
1312

ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1015/pin_names.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
//
77
// SPDX-License-Identifier: MIT
88

9-
#pragma once
9+
// OK to include more than once because FORMAT_PIN may be different.
1010

1111

1212
// define FORMAT_PIN(pin_name) and then include this file.

ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1021/pin_names.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
//
77
// SPDX-License-Identifier: MIT
88

9-
#pragma once
9+
// OK to include more than once because FORMAT_PIN may be different.
1010

1111

1212
// define FORMAT_PIN(pin_name) and then include this file.

ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1042/pin_names.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
//
77
// SPDX-License-Identifier: MIT
88

9-
#pragma once
9+
// OK to include more than once because FORMAT_PIN may be different.
1010

1111

1212
// define FORMAT_PIN(pin_name) and then include this file.

0 commit comments

Comments
 (0)
0