Skip to content

Commit 8aafc73

Browse files
authored
Merge pull request #5789 from adafruit/7.1.x
Merge latest changes from 7.1.x
2 parents 044dcb4 + 08d09ac commit 8aafc73

File tree

4 files changed

+11
-3
lines changed

4 files changed

+11
-3
lines changed

ports/espressif/boards/adafruit_feather_esp32s2/board.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include "supervisor/board.h"
2828
#include "mpconfigboard.h"
2929
#include "shared-bindings/microcontroller/Pin.h"
30+
#include "components/driver/include/driver/gpio.h"
3031

3132
void board_init(void) {
3233
// USB
@@ -39,7 +40,9 @@ bool board_requests_safe_mode(void) {
3940
}
4041

4142
void reset_board(void) {
42-
43+
// Turn on I2C power by default.
44+
gpio_set_direction(7, GPIO_MODE_DEF_OUTPUT);
45+
gpio_set_level(7, false);
4346
}
4447

4548
void board_deinit(void) {

ports/espressif/boards/adafruit_feather_esp32s2/pins.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = {
1414
{ MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO5) },
1515
{ MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO6) },
1616

17-
{ MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_GPIO7) },
1817
{ MP_ROM_QSTR(MP_QSTR_I2C_POWER_INVERTED), MP_ROM_PTR(&pin_GPIO7) },
18+
{ MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_GPIO7) },
1919

2020
{ MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_GPIO8) },
2121
{ MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_GPIO8) },

ports/raspberrypi/common-hal/rgbmatrix/RGBMatrix.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
#include "shared-module/rgbmatrix/RGBMatrix.h"
3434

3535
#include "src/rp2_common/hardware_pwm/include/hardware/pwm.h"
36+
#include "src/rp2_common/hardware_irq/include/hardware/irq.h"
3637

3738
void *common_hal_rgbmatrix_timer_allocate(rgbmatrix_rgbmatrix_obj_t *self) {
3839
// Choose a PWM channel based on the first RGB pin
@@ -58,13 +59,17 @@ void common_hal_rgbmatrix_timer_enable(void *ptr) {
5859
void common_hal_rgbmatrix_timer_disable(void *ptr) {
5960
int8_t slice = ((intptr_t)ptr) & 0xff;
6061
pwm_set_enabled(slice, false);
62+
irq_set_enabled(PWM_IRQ_WRAP, false);
63+
pwm_clear_irq(slice);
6164
}
6265

6366
void common_hal_rgbmatrix_timer_free(void *ptr) {
6467
intptr_t value = (intptr_t)ptr;
6568
uint8_t slice = value & 0xff;
6669
uint8_t channel = value >> 8;
6770
pwm_set_enabled(slice, false);
71+
irq_set_enabled(PWM_IRQ_WRAP, false);
72+
pwm_clear_irq(slice);
6873
pwmout_free(slice, channel);
6974
return;
7075
}

0 commit comments

Comments
 (0)