From 2a3cd5b2943206c89cfb5e98ab411b39d69553e5 Mon Sep 17 00:00:00 2001 From: Radomir Dopieralski Date: Sun, 28 Feb 2021 00:29:49 +0100 Subject: [PATCH 1/7] Use uint16 for temporary variables in displayio.TileGrid Should fix #4284 --- shared-module/displayio/TileGrid.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shared-module/displayio/TileGrid.c b/shared-module/displayio/TileGrid.c index 19ea10e552..2cd3a49488 100644 --- a/shared-module/displayio/TileGrid.c +++ b/shared-module/displayio/TileGrid.c @@ -104,7 +104,7 @@ bool displayio_tilegrid_get_previous_area(displayio_tilegrid_t *self, displayio_ } void _update_current_x(displayio_tilegrid_t *self) { - int16_t width; + uint16_t width; if (self->transpose_xy) { width = self->pixel_height; } else { @@ -130,7 +130,7 @@ void _update_current_x(displayio_tilegrid_t *self) { } void _update_current_y(displayio_tilegrid_t *self) { - int16_t height; + uint16_t height; if (self->transpose_xy) { height = self->pixel_width; } else { From eafcd7d3646dc887d403c6f0f04452f41b4649b5 Mon Sep 17 00:00:00 2001 From: microDev <70126934+microDev1@users.noreply.github.com> Date: Wed, 3 Mar 2021 11:22:33 +0530 Subject: [PATCH 2/7] add issue templates --- .github/ISSUE_TEMPLATE/bug_report.md | 40 +++++++++++++++++++++++ .github/ISSUE_TEMPLATE/config.yml | 7 ++++ .github/ISSUE_TEMPLATE/feature_request.md | 11 +++++++ 3 files changed, 58 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/config.yml create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000000..997dc54385 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,40 @@ +--- +name: Bug report +about: Create a report to help us improve +title: '' +labels: '' +assignees: '' + +--- + +Thanks! for testing out CircuitPython. Now that you have got a problem... you can +file a bug report for it. Feel free to modify the below format to better suit your issue. +Also, don't forget to remove me... :) + +**Firmware** + +```python +Adafruit CircuitPython 6.2.0-beta.2 on 2021-03-01; Raspberry Pi Pico with rp2040 +``` +**Code/REPL** + +```python +import busio, bitbangio +i2c = bitbangio.I2C(board.GP1, board.GP0) +``` +**Behavior** + +```python +Traceback (most recent call last): + File "", line 1, in +TimeoutError: Clock stretch too long +``` +**Description** _(optional)_ + +- Error while using i2c... +- Only happens when... +- might be related to #4291... + +**Additional Info** _(optional)_ + +Any other information like hardware connection, scope output etc. diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000000..138fa4c1b0 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,7 @@ +contact_links: + - name: Adafruit Forum + url: https://forums.adafruit.com/ + about: Not sure if a bug is indeed a bug... post it here. + - name: Adafruit Discord + url: https://adafru.it/discord + about: Similar to the forum but more exposure and prompt replies. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000000..c6a79ffa08 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,11 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: '' +labels: '' +assignees: '' + +--- + +We are always adding new features and enhancements to CircuitPython 🚀 +and would love ❤ to see what new challenge you have got for us... 🙂 From 7c2a291bd1e3bbed8422b80f588132aaaaac3c37 Mon Sep 17 00:00:00 2001 From: microDev <70126934+microDev1@users.noreply.github.com> Date: Wed, 3 Mar 2021 21:00:12 +0530 Subject: [PATCH 3/7] add .github to exclusions --- conf.py | 1 + 1 file changed, 1 insertion(+) diff --git a/conf.py b/conf.py index 0454ff5ec5..10bd0d9ce0 100644 --- a/conf.py +++ b/conf.py @@ -150,6 +150,7 @@ version = release = final_version # directories to ignore when looking for source files. exclude_patterns = ["**/build*", ".git", + ".github", ".env", ".venv", ".direnv", From 9aa11ec51e40b96c317ebca276b3a8ebeb928310 Mon Sep 17 00:00:00 2001 From: microDev <70126934+microDev1@users.noreply.github.com> Date: Thu, 4 Mar 2021 02:38:46 +0530 Subject: [PATCH 4/7] Apply suggestions from code review --- .github/ISSUE_TEMPLATE/bug_report.md | 30 +++++++++++++++++------ .github/ISSUE_TEMPLATE/config.yml | 4 +-- .github/ISSUE_TEMPLATE/feature_request.md | 6 ++--- 3 files changed, 28 insertions(+), 12 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 997dc54385..22365d0f41 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -2,39 +2,55 @@ name: Bug report about: Create a report to help us improve title: '' -labels: '' +labels: 'bug' assignees: '' --- -Thanks! for testing out CircuitPython. Now that you have got a problem... you can -file a bug report for it. Feel free to modify the below format to better suit your issue. -Also, don't forget to remove me... :) + **Firmware** + + ```python Adafruit CircuitPython 6.2.0-beta.2 on 2021-03-01; Raspberry Pi Pico with rp2040 ``` + **Code/REPL** + + ```python import busio, bitbangio i2c = bitbangio.I2C(board.GP1, board.GP0) ``` + **Behavior** + + ```python Traceback (most recent call last): File "", line 1, in TimeoutError: Clock stretch too long ``` -**Description** _(optional)_ + +**Description** + + - Error while using i2c... - Only happens when... - might be related to #4291... -**Additional Info** _(optional)_ +**Additional Info** -Any other information like hardware connection, scope output etc. + + +Removing [this](url) line resolves the issue. diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 138fa4c1b0..73bf24af0c 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1,7 +1,7 @@ contact_links: - name: Adafruit Forum url: https://forums.adafruit.com/ - about: Not sure if a bug is indeed a bug... post it here. + about: Official Adafruit technical support forum. Good for getting help on getting a project working. - name: Adafruit Discord url: https://adafru.it/discord - about: Similar to the forum but more exposure and prompt replies. + about: Unofficial chat with many helpful folks and normally prompt replies. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index c6a79ffa08..4f65b84145 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -2,10 +2,10 @@ name: Feature request about: Suggest an idea for this project title: '' -labels: '' +labels: 'enhancement' assignees: '' --- -We are always adding new features and enhancements to CircuitPython 🚀 -and would love ❤ to see what new challenge you have got for us... 🙂 + From 13453d35c6965b1594a3cea43ef3a9133f867297 Mon Sep 17 00:00:00 2001 From: microDev <70126934+microDev1@users.noreply.github.com> Date: Thu, 4 Mar 2021 13:23:34 +0530 Subject: [PATCH 5/7] fix watchdog deinit --- ports/esp32s2/common-hal/watchdog/WatchDogTimer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/esp32s2/common-hal/watchdog/WatchDogTimer.c b/ports/esp32s2/common-hal/watchdog/WatchDogTimer.c index b51a391b7f..79a84ef594 100644 --- a/ports/esp32s2/common-hal/watchdog/WatchDogTimer.c +++ b/ports/esp32s2/common-hal/watchdog/WatchDogTimer.c @@ -49,7 +49,7 @@ void common_hal_watchdog_feed(watchdog_watchdogtimer_obj_t *self) { } void common_hal_watchdog_deinit(watchdog_watchdogtimer_obj_t *self) { - if (esp_task_wdt_deinit() == ESP_OK) { + if (esp_task_wdt_delete(NULL) == ESP_OK && esp_task_wdt_deinit() == ESP_OK) { self->mode = WATCHDOGMODE_NONE; } } From 6f99026a648c6a78caa1a2189269db8ab7987aa9 Mon Sep 17 00:00:00 2001 From: hathach Date: Thu, 4 Mar 2021 19:02:20 +0700 Subject: [PATCH 6/7] rp2040 use normal usb_irq_handler() --- ports/raspberrypi/supervisor/usb.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/ports/raspberrypi/supervisor/usb.c b/ports/raspberrypi/supervisor/usb.c index 1d2425aed2..799ed06953 100644 --- a/ports/raspberrypi/supervisor/usb.c +++ b/ports/raspberrypi/supervisor/usb.c @@ -31,23 +31,17 @@ #include "src/rp2_common/pico_platform/include/pico/platform.h" #include "src/rp2040/hardware_regs/include/hardware/regs/intctrl.h" -static background_callback_t usb_callback; -static void usb_background_do(void* unused) { - usb_background(); -} - -static void queue_background(void) { - background_callback_add(&usb_callback, usb_background_do, NULL); -} - void init_usb_hardware(void) { } void post_usb_init(void) { + irq_set_enabled(USBCTRL_IRQ, false); + irq_handler_t usb_handler = irq_get_exclusive_handler(USBCTRL_IRQ); if (usb_handler) { irq_remove_handler(USBCTRL_IRQ, usb_handler); - irq_add_shared_handler(USBCTRL_IRQ, usb_handler, PICO_DEFAULT_IRQ_PRIORITY); } - irq_add_shared_handler(USBCTRL_IRQ, queue_background, PICO_LOWEST_IRQ_PRIORITY); + irq_set_exclusive_handler(USBCTRL_IRQ, usb_irq_handler); + + irq_set_enabled(USBCTRL_IRQ, true); } From c26120a3ac9d57f68afabf18d1e804a215f678ed Mon Sep 17 00:00:00 2001 From: hathach Date: Thu, 4 Mar 2021 21:02:32 +0700 Subject: [PATCH 7/7] update tinyusb --- lib/tinyusb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tinyusb b/lib/tinyusb index 280297bdb7..5285548c75 160000 --- a/lib/tinyusb +++ b/lib/tinyusb @@ -1 +1 @@ -Subproject commit 280297bdb7aec67adf347ec046943a48a71647df +Subproject commit 5285548c7543354ac8e13da37499019e204b1c49