Commit Graph

434 Commits

Author SHA1 Message Date
Scott Shawcroft
5c6e80a2bb
Shrink builds by defining advanced micropython API
Also, ignore more pins on SAMD boards and disable EXFAT on others.
2021-08-19 16:49:33 -07:00
Scott Shawcroft
d2860b58b0
Check background pending before sleep
There is a race between when we run background tasks and when we
sleep. If an interrupt happens between the two, then we may delay
executing the background task. On some ports we checked this for
TinyUSB already. On iMX RT, we didn't which caused USB issues.
This PR makes it more generic for all background tasks including
USB.

Fixes #5086 and maybe others.
2021-08-19 12:18:13 -07:00
Jeff Epler
6ea136987e run codeformat 2021-08-19 13:54:13 -05:00
Jeff Epler
cabe96e188 canio: Run background tasks while waiting for message reception
Closes: #5004
2021-08-18 11:39:40 -05:00
Scott Shawcroft
e0ce5ff045
Fix some builds by disabling exfat 2021-08-18 08:22:29 -07:00
gamblor21
d02a4b9f71 Removed ulab to make space in blackpill with flash board 2021-08-18 10:16:44 -05:00
Scott Shawcroft
de796e2304
Move OneWire to onewireio from busio
This will allow finer grained inclusion in 8.0.0

Fixes #5135
2021-08-12 10:47:14 -07:00
Chris Wilson
c0902dade6 stm/boards: Add support for SparkFun STM32 MicroMod Processor board. 2021-08-09 23:11:13 -07:00
evildave666
4d14bcf2a2 Add WeAct manufacturer for black pill boards 2021-08-06 16:06:16 +09:00
Lucian Copeland
da149b0a42 Merge remote-tracking branch 'upstream/main' into stm32-sleepmem 2021-07-30 15:35:55 -04:00
Scott Shawcroft
daf90aae83
Merge remote-tracking branch 'adafruit/main' into pulseout_switch 2021-07-26 18:48:59 -07:00
Scott Shawcroft
412eb87080
Switch to pin, frequency and duty_cycle PulseOut
Passing in a PWMOut still works but is deprecated. It will be
removed in CircuitPython 8.0.0

This also switches STM32 timer indices and channel indices to
0-based in our pin data rather than `- 1` everywhere. The latter is
more bug prone.

Most of the way for #3264

Tested on Metro M0, Metro M4, Feather S2, Feather nRF52840, Feather
STM32F4 and Arduino RP2040.
2021-07-26 18:35:49 -07:00
Scott Shawcroft
8258f51132
Merge pull request #5061 from evildave666/blackpill-remove-nvm
remove unused nvm reserved space from stm32f411ce_blackpill_with_flash
2021-07-26 14:13:29 -07:00
evildave666
f059bab253 Modify mpconfigboard.mk to point to the new linker file and re-include modules 2021-07-26 14:13:41 +09:00
evildave666
57c6279b40 Added new linker file 2021-07-26 13:59:25 +09:00
Chris Wilson
49dc5805ee Fix CAN pin assignment on Feather STM32F405 Express board. 2021-07-24 22:01:50 -07:00
Lucian Copeland
696c035b67 Add STM32 sleep memory 2021-06-25 17:43:18 -04:00
Scott Shawcroft
b81573d439
Merge pull request #4891 from dhalbert/keypad-scanning-events
keypad: support for vector and matrix key scanning
2021-06-24 10:25:21 -07:00
Dan Halbert
db297add67 fix other too-big builds 2021-06-18 13:20:31 -04:00
Jeff Epler
e1d7e46e88 fix keyboard interrupt 2021-06-18 11:15:51 -05:00
Dan Halbert
4655a71793 Turn off keypad on some builds to avoid overflow 2021-06-15 14:11:04 -04:00
Dan Halbert
f97e0ec631 fix ulab commit 2021-06-15 11:51:28 -04:00
Dan Halbert
a192f1ca2f merge from upstream 2021-06-15 11:21:08 -04:00
Jeff Epler
1a06d06468 ulab: disable on several stm boards with constrained flash storage 2021-06-11 07:46:21 -05:00
Dan Halbert
b815164bdf Turn off keypad on a few small builds 2021-06-10 10:09:55 -04:00
Jeff Epler
49db85cb3d Check that select firmwares build on Windows with MSYS2
This configuration is used by @ladyada and more often than it should
we've discovered late that a change introduced problems building
there.

By adding this to regular CI, hopefully we learn about and fix these
issues sooner rather than later.
2021-05-28 16:47:29 -05:00
Scott Shawcroft
561ffec693
Merge remote-tracking branch 'adafruit/main' into simplify_status_led 2021-05-20 13:46:42 -07:00
Scott Shawcroft
5643355e90
Merge remote-tracking branch 'adafruit/main' into simplify_status_led 2021-05-20 08:35:15 -07:00
Scott Shawcroft
b78e9fcd19
Improve STM reset reason
This causes safe mode to skip the wait for reset when waking up
from an alarm. (It also means we don't flash the LED for it.)
2021-05-19 11:48:02 -07:00
Lucian Copeland
bce541dcc5 Minor text fixes 2021-05-18 15:16:25 -04:00
Lucian Copeland
633d83cc3e Merge remote-tracking branch 'upstream/main' into sleep-revamp 2021-05-17 18:57:10 -04:00
Lucian Copeland
715f7ee490 Add STM32 and NRF52 compatibility 2021-05-14 14:34:35 -04:00
Scott Shawcroft
689ec86225
Merge pull request #4754 from dhalbert/fix-endpoint-checking
Fix endpoint checking; Clean up safe mode printing
2021-05-14 11:25:01 -07:00
Dan Halbert
c65986f526 shrink a bit more 2021-05-14 09:18:14 -04:00
Dan Halbert
0fcb11b7b2 shrink some STM32F4 builds: turn MIDI back off 2021-05-13 23:14:12 -04:00
Dan Halbert
fa6c06fb38 count in/out endpoints; allow more usb modules on low-endpoint boards 2021-05-13 21:59:02 -04:00
Scott Shawcroft
1a0b4193b7
Simplify the status LED to save power
This also removes the need to pin share because we don't use the
status LED while user code is running.

The status flashes fallback to the HW_STATUS LED if no RGB LED is
present. Each status has a unique blink pattern as well.

One caveat is the REPL state. In order to not pin share, we set the
RGB color once. PWM and single color will be shutoff immediately but
DotStars and NeoPixels will hold the color until the user overrides
it.

Fixes #4133
2021-05-13 14:41:20 -07:00
Scott Shawcroft
35ee4add63
Merge pull request #4388 from hierophect/stm-alarm
STM32: Alarms and sleep
2021-05-13 10:27:51 -07:00
Lucian Copeland
849e3a7319 Style fixes, submodules 2021-05-13 11:24:27 -04:00
Lucian Copeland
525b34b042 Fix formatting and broken links
Implmements missed pre-commit changes for all files, and fixes links broken by
cleanup in #4698
2021-05-10 18:04:43 -04:00
Lucian Copeland
0d3c5222d8 Merge remote-tracking branch 'upstream/main' into stm-alarm 2021-05-10 17:30:33 -04:00
Kattni Rembor
294ef59f27 Add LED pin to Adafruit boards. 2021-05-10 16:39:01 -04:00
Jeff Epler
446169e078
Merge pull request #4720 from tannewt/merge_1.13
Merge in MicroPython 1.13
2021-05-08 08:46:03 -05:00
Lucian Copeland
9920741c2f Merge remote-tracking branch 'upstream/main' into stm-espr-pico-fix 2021-05-06 17:43:38 -04:00
Scott Shawcroft
42f4065c8a
Merge remote-tracking branch 'adafruit/main' into merge_1.13 2021-05-06 11:17:53 -07:00
Lucian Copeland
80a459d1f8 Remove settings for DNP oscillator 2021-05-06 13:52:07 -04:00
Dan Halbert
843598ec3a fix more board builds 2021-05-05 18:44:27 -04:00
Scott Shawcroft
f0bb26d70f
Merge MicroPython 1.13 into CircuitPython 2021-05-04 18:06:33 -07:00
Dan Halbert
d2b558993e merge from main, including MicroPython 1.12 merge 2021-05-03 20:56:04 -04:00
Dan Halbert
94ed5e0048
Merge pull request #4696 from dhalbert/no-pulseio-on-small-boards
Include pulseio only on CIRCUITPY_FULL_BUILD
2021-05-03 09:35:29 -04:00
Dan Halbert
e475dc8899 Fix broken builds 2021-05-03 00:09:15 -04:00
Jeff Epler
e95e921ca1 codeformat: Fix filename matching
In #4683, tannewt noticed that uncrustify was not running on some
file in common-hal.

I investigated and found that it was not being run on a bunch of paths.

Rather than make incremental changes, I rewrote list_files to work
bsaed on regular expressions; these regular expressions are created from
the same git-style glob patterns.

I spot-checked some specific filenames after this change, and all looks good:

```
$ python3 tools/codeformat.py -v --dry-run tests/basics/int_small.py ports/raspberrypi/common-hal/pulseio/PulseIn.c extmod/virtpin.c tests/thread/thread_exit1.py  ports/raspberrypi/background.h extmod/re1.5/recursiveloop.c
tools/codeformat.py -v --dry-run tests/basics/int_small.py ports/raspberrypi/common-hal/pulseio/PulseIn.c extmod/virtpin.c tests/thread/thread_exit1.py ports/raspberrypi/background.h extmod/re1.5/recursiveloop.c
uncrustify -c /home/jepler/src/circuitpython/tools/uncrustify.cfg -lC --no-backup extmod/virtpin.c ports/raspberrypi/background.h ports/raspberrypi/common-hal/pulseio/PulseIn.c
black --fast --line-length=99 -v tests/thread/thread_exit1.py
```
recursiveloop and int_small are excluded, while PulseIn, virtpin,
and background are included.

Testing running from a subdirectory (not _specifically_ supported though):
```
(cd ports && python3 ../tools/codeformat.py -v --dry-run raspberrypi/common-hal/pulseio/PulseIn.c ../extmod/virtpin.c)
../tools/codeformat.py -v --dry-run raspberrypi/common-hal/pulseio/PulseIn.c ../extmod/virtpin.c
uncrustify -c /home/jepler/src/circuitpython/tools/uncrustify.cfg -lC --no-backup ../extmod/virtpin.c raspberrypi/common-hal/pulseio/PulseIn.
```

As a side-effect, a bunch more files are re-formatted now. :-P
2021-04-30 10:48:08 -05:00
Lucian Copeland
07b86fcb76 fix sleepmemory object redefine error 2021-04-29 17:28:06 -04:00
Lucian Copeland
bab5a22f0c Fix build issues
H7 compatibility problems in port.c and peripherals/exti
NRF build failures due to new use of const for PinAlarm pin objects
Isolated board flash overage on blackpill_with_flash, remove audio modules
2021-04-29 14:48:16 -04:00
Dan Halbert
f06d54524d merge from adafruit 2021-04-28 23:48:26 -04:00
Lucian Copeland
9fe8d61656 Fix broken MP macros from 1.11 merge 2021-04-28 18:26:52 -04:00
Lucian Copeland
9feef41c82 Merge remote-tracking branch 'upstream/main' into stm-alarm 2021-04-28 15:10:55 -04:00
Scott Shawcroft
17fcd499b2
Merge pull request #4649 from tannewt/merge_1.11_2
Merge MicroPython v1.11 into CircuitPython
2021-04-27 11:02:02 -07:00
Scott Shawcroft
76033d5115
Merge MicroPython v1.11 into CircuitPython 2021-04-26 15:47:41 -07:00
Dan Halbert
9d1fcc3b14 merge from main 2021-04-25 10:27:52 -04:00
Artyom Skrobov
4e3c1d4a4c [build] Allow USB to be set to 0
Unify USB-related makefile var and C def as CIRCUITPY_USB.

Always define it as 0 or 1, same as all other settings.

USB_AVAILABLE was conditionally defined in supervisor.mk,
but never actually used to #ifdef USB-related code.

Loosely related to #4546
2021-04-23 11:13:34 -04:00
Dan Halbert
64e0958916 wip: descriptor building 2021-04-21 23:25:36 -04:00
Lucian Copeland
8ce89860e6 Pass pre-commit formatting 2021-04-21 17:34:13 -04:00
Lucian Copeland
e0024c70de Merge remote-tracking branch 'upstream/main' into stm-alarm 2021-04-15 16:32:30 -04:00
Artyom Skrobov
92d7f31046 [synthio] disable in stm32f411ce_blackpill_with_flash
region `FLASH_FIRMWARE' overflowed by 228 bytes
2021-04-13 03:01:55 -04:00
Kevin Lutzer
4fb3139273 switch orders the flash memory is listed 2021-04-08 21:56:25 -06:00
Kevin Lutzer
c672b33770 add W25Q64JVxQ as a supported flash for stm32f411 black pill 2021-04-08 21:53:38 -06:00
Artyom Skrobov
4ee781227f [meowbit] change board.BUZZ type to PWMAudioOut,
as advised in #4257
2021-04-03 13:35:19 -04:00
Lucian Copeland
8a2143f161 Clean up comments and debugging pins 2021-04-02 17:40:40 -04:00
Lucian Copeland
9240146b22 Make light sleep store true alarm object to global map 2021-04-02 16:58:42 -04:00
Lucian Copeland
66a1583183 Implement fake and true deep sleep alarm differentiation 2021-04-02 15:13:10 -04:00
Lucian Copeland
17585e1e07 Clean up API 2021-04-02 14:08:48 -04:00
Lucian Copeland
91e530d36c Resolve wake alarm crash 2021-04-02 13:42:22 -04:00
Lucian Copeland
4f52554eb3 Fix to RTC reset 2021-04-01 20:53:25 -04:00
Lucian Copeland
d35a307ffa Merge branch 'sleep-api-update' into stm-alarm 2021-03-29 12:27:25 -04:00
Lucian Copeland
529fb52309 Style changes and wakeup detection 2021-03-27 13:16:12 -04:00
Artyom Skrobov
b40d072648 [stm] implementation of audiopwmio
Based on nrf PWMAudioOut by @jepler and stm PulseOut by @hierophect

Tested on a Meowbit
2021-03-26 13:18:01 -04:00
Scott Shawcroft
aec0ef3cbf
Switch devices.h to nvm.toml data 2021-03-25 09:57:18 -07:00
Lucian Copeland
d8a2d69e10 Working deep sleep via RTC reset, with debug pins 2021-03-21 13:15:44 -04:00
Dan Halbert
d7a2ae9df7 fix stm compiler error 2021-03-19 11:04:46 -04:00
Dan Halbert
b2d913412f merge from upstream 2021-03-18 23:14:43 -04:00
gamblor21
0890b54cd9 More formatting 2021-03-16 08:29:04 -05:00
gamblor21
fb437d8280 Formatting fixes 2021-03-16 08:22:02 -05:00
Mark
e326d7ca80
Merge branch 'main' into rp_dp_parallel 2021-03-15 20:00:13 -05:00
microDev
a52eb88031
run code formatting script 2021-03-15 19:27:36 +05:30
gamblor21
56a219911f Add frequency support to parallel bus 2021-03-11 19:32:43 -06:00
Lucian Copeland
6b2c9985ff Extract RTC, implement fake RTC deepsleep 2021-03-11 17:50:05 -05:00
Scott Shawcroft
0e451a1681
Merge pull request #4383 from hierophect/stm32-uart-dereserve
STM32: Fix UART deinit
2021-03-11 10:48:01 -08:00
Lucian Copeland
0b73c7a212 Update F407 to match F405 2021-03-11 11:27:17 -05:00
Lucian Copeland
1ebbd14d0f Fix UART deinit 2021-03-11 11:02:13 -05:00
Dan Halbert
08c5dbb003 use return values in STM PWMOut constructor, not exceptions 2021-03-11 08:52:47 -05:00
Jeff Epler
cdb0fda72a Merge remote-tracking branch 'origin/main' into count-flash-devices 2021-03-07 20:26:04 -06:00
Jeff Epler
f1ada8e880 Automatically count EXTERNAL_FLASH_DEVICES 2021-03-07 11:48:39 -06:00
jerryneedell
a23129bc49 add GD25Q16C flash to BlackPill 2021-03-07 17:23:39 +00:00
Artyom Skrobov
4720dc179a
[stm] curr_pulseout can be STATIC
Not used outside of PulseOut.c
2021-03-05 12:52:13 +02:00
Jeff Epler
efc2667b5f
Merge pull request #4186 from jepler/update-protomatter-rp2
Enable protomatter on RP2040 builds
2021-03-02 19:01:37 -06:00
Lucian Copeland
f1792c8474 Extract EXTI, create base sleep framework 2021-03-02 11:41:53 -05:00
Jeff Epler
1d1ff5f308 Merge remote-tracking branch 'origin/main' into update-protomatter-rp2 2021-02-26 09:56:35 -06:00
Kevin Matocha
a7a4f93ff8 Updated build configs to turn off BITMAPTOOLS for smaller builds 2021-02-25 15:44:32 -06:00
Dan Halbert
67406488d1 merge from upstream; re-alphabetize 2021-02-19 14:22:50 -05:00