Skip to content

Merge latest changes from 7.1.x #5789

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Dec 28, 2021
2 changes: 1 addition & 1 deletion frozen/Adafruit_CircuitPython_BLE
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ LONGINT_IMPL = NONE
CIRCUITPY_BUSDEVICE = 1
CIRCUITPY_DISPLAYIO = 0
CIRCUITPY_KEYPAD = 0
CIRCUITPY_ONEWIREIO = 0

# Include these Python libraries in firmware.
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_CircuitPlayground
Expand Down
5 changes: 4 additions & 1 deletion ports/espressif/boards/adafruit_feather_esp32s2/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include "supervisor/board.h"
#include "mpconfigboard.h"
#include "shared-bindings/microcontroller/Pin.h"
#include "components/driver/include/driver/gpio.h"

void board_init(void) {
// USB
Expand All @@ -39,7 +40,9 @@ bool board_requests_safe_mode(void) {
}

void reset_board(void) {

// Turn on I2C power by default.
gpio_set_direction(7, GPIO_MODE_DEF_OUTPUT);
gpio_set_level(7, false);
}

void board_deinit(void) {
Expand Down
2 changes: 1 addition & 1 deletion ports/espressif/boards/adafruit_feather_esp32s2/pins.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = {
{ MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO5) },
{ MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO6) },

{ MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_GPIO7) },
{ MP_ROM_QSTR(MP_QSTR_I2C_POWER_INVERTED), MP_ROM_PTR(&pin_GPIO7) },
{ MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_GPIO7) },

{ MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_GPIO8) },
{ MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_GPIO8) },
Expand Down
5 changes: 5 additions & 0 deletions ports/raspberrypi/common-hal/rgbmatrix/RGBMatrix.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include "shared-module/rgbmatrix/RGBMatrix.h"

#include "src/rp2_common/hardware_pwm/include/hardware/pwm.h"
#include "src/rp2_common/hardware_irq/include/hardware/irq.h"

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

void common_hal_rgbmatrix_timer_free(void *ptr) {
intptr_t value = (intptr_t)ptr;
uint8_t slice = value & 0xff;
uint8_t channel = value >> 8;
pwm_set_enabled(slice, false);
irq_set_enabled(PWM_IRQ_WRAP, false);
pwm_clear_irq(slice);
pwmout_free(slice, channel);
return;
}