Commit Graph

137 Commits

Author SHA1 Message Date
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
42f4065c8a
Merge remote-tracking branch 'adafruit/main' into merge_1.13 2021-05-06 11:17:53 -07:00
Dan Halbert
579cdf30f1 fix more build errors 2021-05-05 16:49:29 -04:00
Scott Shawcroft
f0bb26d70f
Merge MicroPython 1.13 into CircuitPython 2021-05-04 18:06:33 -07:00
Dan Halbert
f06d54524d merge from adafruit 2021-04-28 23:48:26 -04:00
Dan Halbert
f98a54628b wip: compiles 2021-04-27 14:37:36 -04:00
Scott Shawcroft
76033d5115
Merge MicroPython v1.11 into CircuitPython 2021-04-26 15:47:41 -07:00
Dan Halbert
64e0958916 wip: descriptor building 2021-04-21 23:25:36 -04:00
Jeff Epler
bc690d4070
Merge pull request #4415 from jepler/pre-commit-no-run-if-empty
pre-commit: code formatter fixes
2021-03-16 09:54:12 -05:00
Scott Shawcroft
9cb8ce67ed
Merge pull request #4412 from kamtom480/spi_and_i2c
spresense: minor changes for i2c, spi and uart
2021-03-15 17:35:06 -07:00
Jeff Epler
d3bf1fe15d modifications by pre-commit 2021-03-15 18:11:00 -05:00
Kamil Tomaszewski
ed3f636be5 spresense: empty rx uart fifo after initialization 2021-03-15 16:14:16 +01:00
Kamil Tomaszewski
22ed0abf6c spresens: configure pin mode for i2c and spi 2021-03-15 16:14:16 +01:00
microDev
a52eb88031
run code formatting script 2021-03-15 19:27:36 +05:30
Kamil Tomaszewski
18668f6e28 spresense: fix spi to work with only one data pin 2021-03-11 18:06:49 +01:00
Kamil Tomaszewski
76d0870fba spresense: return error as positive value for i2c 2021-03-11 18:04:01 +01:00
Kamil Tomaszewski
7c921b808b spresense: Define LONGINT_IMPL as MPZ 2021-03-02 14:25:22 +01:00
Kamil Tomaszewski
f9d21637a3 spresense: return valid reference voltage 2021-03-02 14:25:22 +01:00
Scott Shawcroft
d0eab5c561
Merge pull request #4256 from kmatch98/bt_cleanup
Add `bitmaptools` module
2021-03-01 18:24:12 -08:00
Kamil Tomaszewski
d68fdf3a3d spresense: return the correct value for Analog In 2021-03-01 15:45:10 +01:00
Kevin Matocha
a7a4f93ff8 Updated build configs to turn off BITMAPTOOLS for smaller builds 2021-02-25 15:44:32 -06:00
Kamil Tomaszewski
e369473794 spresense: change RX and TX buffer size for CDC 2021-02-24 18:19:18 +01:00
Dan Halbert
e344c6d684 fix some builds 2021-02-18 14:24:58 -05:00
Dan Halbert
c26de0136a works! no timeouts 2021-02-16 17:39:36 -05:00
Dan Halbert
f0564b4986 merge from upstream; complicated webusb merge 2021-02-11 18:50:02 -05:00
Kamil Tomaszewski
c5992a3101 spresense: update Spresense SDK to 2.0.2 2021-01-25 18:40:14 +01:00
iot49
1a82555803
Merge branch 'main' into msgpack 2021-01-05 11:19:11 -08:00
Dan Halbert
8f9cd7075e
Merge pull request #3752 from jepler/gcc10
build: Update to gcc10
2020-12-17 11:03:40 -05:00
Dan Halbert
fb33c4e1c0 -ftree-vrp better diagnostics on -Os builds; -fno-inline-functions for -O2; fix struct init in HCI bleio 2020-12-15 12:23:56 -05:00
Scott Shawcroft
344d3c59cb
Merge branch 'main' into msgpack 2020-12-11 11:10:30 -08:00
Scott Shawcroft
40118bcf57
Add board_deinit for use with sleep
This changes lots of files to unify `board.h` across ports. It adds
`board_deinit` when CIRCUITPY_ALARM is set. `main.c` uses it to
deinit the board before deep sleeping (even when pretending.)

Deep sleep is now a two step process for the port. First, the
port should prepare to deep sleep based on the given alarms. It
should set alarms for both deep and pretend sleep. In particular,
the pretend versions should be set immediately so that we don't
miss an alarm as we shutdown. These alarms should also wake from
`port_idle_until_interrupt` which is used when pretending to deep
sleep.

Second, when real deep sleeping, `alarm_enter_deep_sleep` is called.
The port should set any alarms it didn't during prepare based on
data it saved internally during prepare.

ESP32-S2 sleep is a bit reorganized to locate more logic with
TimeAlarm. This will help it scale to more alarm types.

Fixes #3786
2020-12-08 10:52:25 -08:00
Scott Shawcroft
608c98501b
Merge remote-tracking branch 'adafruit/main' into msgpack 2020-12-02 13:10:39 -08:00
Scott Shawcroft
d7ba641ff6
Merge pull request #3767 from dhalbert/sleep
Initial alarm and sleep PR: time alarms with light and deep sleep; PinAlarms not yet implemented
2020-12-02 12:51:43 -08:00
Bernhard Boser
546b15bf1a
add trailing newline 2020-12-01 18:42:07 -08:00
Bernhard Boser
87d4184dd5
exclude spresense 2020-12-01 18:42:06 -08:00
Bernhard Boser
582a47d71a
rename read, write to read_bytes, write_bytes 2020-12-01 18:41:11 -08:00
Bernhard Boser
59c3e25168
disable on boards tight on memory. add stddef.h to imports (not actually needed). 2020-12-01 18:39:24 -08:00
Dan Halbert
8b7c23c1ee address review comments 2020-12-01 20:01:14 -05:00
Christian Walther
c7404a3ff8 Add movable allocation system.
This allows calls to `allocate_memory()` while the VM is running, it will then allocate from the GC heap (unless there is a suitable hole among the supervisor allocations), and when the VM exits and the GC heap is freed, the allocation will be moved to the bottom of the former GC heap and transformed into a proper supervisor allocation. Existing movable allocations will also be moved to defragment the supervisor heap and ensure that the next VM run gets as much memory as possible for the GC heap.

By itself this breaks terminalio because it violates the assumption that supervisor_display_move_memory() still has access to an undisturbed heap to copy the tilegrid from. It will work in many cases, but if you're unlucky you will get garbled terminal contents after exiting from the vm run that created the display. This will be fixed in the following commit, which is separate to simplify review.
2020-11-28 17:50:23 +01:00
Dan Halbert
104a089677 deep sleep working; deep sleep delay when connected 2020-11-26 22:06:37 -05:00
Dan Halbert
a0f1ec3c4a wip 2020-11-22 19:10:09 -05:00
Dan Halbert
75559f35cc wip: ResetReason to microcontroller.cpu 2020-11-21 23:29:52 -05:00
Dan Halbert
cd436bad1a Merge remote-tracking branch 'adafruit/main' into sleep 2020-11-19 15:43:49 -05:00
Kamil Tomaszewski
76d4824728 spresense: Return fixed stack 2020-11-19 15:04:52 +01:00
microDev
930cf14dce
Add check for invalid io, function to disable all alarms 2020-10-27 16:17:26 -07:00
microDev
e35938971a
Add description of alarm modules 2020-10-27 16:16:55 -07:00
Dan Halbert
f51e75c1d2 cxd56 needed more precise include for __packed; needed SRC_C += on some ports 2020-10-15 15:24:24 -04:00
Jeff Epler
726dcdb60a Add some NORETURN attributes
I have a function where it should be impossible to reach the end, so I put in a safe-mode reset at the bottom:
```
int find_unused_slot(void) {
    // precondition: you already verified that a slot was available
    for (int i=0; i<NUM_SLOTS; i++) {
        if( slot_free(i)) {
            return i;
        }
    }
    safe_mode_reset(MICROPY_FATAL_ERROR);
}
```
However, the compiler still gave a diagnostic, because safe_mode_reset was not declared NORETURN.

So I started by teaching the compiler that reset_into_safe_mode never returned.  This leads at least one level deeper due to reset_cpu needing to be a NORETURN function.  Each port is a little different in this area.  I also marked reset_to_bootloader as NORETURN.
Additional notes:

 * stm32's reset_to_bootloader was not implemented, but now does a bare reset.  Most stm32s are not fitted with uf2 bootloaders anyway.
 * ditto cxd56
 * esp32s2 did not implement reset_cpu at all.  I used esp_restart().  (not tested)
 * litex did not implement reset_cpu at all.  I used reboot_ctrl_write.  But notably this is what reset_to_bootloader already did, so one or the other must be incorrect (not tested).  reboot_ctrl_write cannot be declared NORETURN, as it returns unless the special value 0xac is written), so a new unreachable forever-loop is added.
 * cxd56's reset is via a boardctl() call which can't generically be declared NORETURN, so a new unreacahble "for(;;)" forever-loop is added.
 * In several places, NVIC_SystemReset is redeclared with NORETURN applied.  This is accepted just fine by gcc.  I chose this as preferable to editing the multiple copies of CMSIS headers where it is normally declared.
 * the stub safe_mode reset simply aborts.  This is used in mpy-cross.
2020-09-28 18:55:56 -05:00
Kamil Tomaszewski
61687c81d8 camera: Pass width and height to take_picture() 2020-09-16 13:55:57 +02:00
Kamil Tomaszewski
ce7ee58e92 camera: Update camera module 2020-09-14 13:12:20 +02:00