Skip to content

Commit b9063dd

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents 9d4c95d + e3638ff commit b9063dd

File tree

49 files changed

+576
-104
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+576
-104
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ jobs:
7575
board:
7676
- "arduino_mkr1300"
7777
- "arduino_mkrzero"
78+
- "arduino_nano_33_ble"
7879
- "arduino_zero"
7980
- "bast_pro_mini_m0"
8081
- "capablerobot_usbhub"
@@ -109,6 +110,7 @@ jobs:
109110
- "hallowing_m4_express"
110111
- "itsybitsy_m0_express"
111112
- "itsybitsy_m4_express"
113+
- "itsybitsy_nrf52840_express"
112114
- "kicksat-sprite"
113115
- "makerdiary_nrf52840_mdk"
114116
- "makerdiary_nrf52840_mdk_usb_dongle"

locale/de_DE.po

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -737,7 +737,7 @@ msgstr ""
737737

738738
#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c
739739
msgid "Frequency captured is above capability. Capture Paused."
740-
msgstr ""
740+
msgstr "Die aufgezeichnete Frequenz liegt über der Leistungsgrenze. Aufnahme angehalten."
741741

742742
#: shared-bindings/bitbangio/I2C.c shared-bindings/bitbangio/SPI.c
743743
#: shared-bindings/busio/I2C.c shared-bindings/busio/SPI.c

ports/atmel-samd/boards/pyportal_titano/board.c

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -74,24 +74,21 @@ uint8_t display_init_sequence[] = {
7474
0x11, 0x1d, 0x23, 0x35, 0x41, 0x4b, 0x4b, 0x42, 0x3A,
7575
0x27, 0x1B, 0x08, 0x09, 0x03, 0x00, 0x01,
7676
0x3a, 1, 0x55,
77-
0x36, 1, 0x00,
77+
0x36, 1, 0x60,
7878
0x11, DELAY, 150/5, // Exit Sleep, then delay 150 ms
7979
0x29, DELAY, 50/5
8080
};
8181

8282
void board_init(void) {
83-
busio_spi_obj_t* spi = &displays[0].fourwire_bus.inline_bus;
84-
common_hal_busio_spi_construct(spi, &pin_PA13, &pin_PA12, &pin_PA14);
85-
common_hal_busio_spi_never_reset(spi);
86-
87-
displayio_fourwire_obj_t* bus = &displays[0].fourwire_bus;
88-
bus->base.type = &displayio_fourwire_type;
89-
common_hal_displayio_fourwire_construct(bus,
90-
spi,
91-
&pin_PB05, // TFT_DC Command or data
92-
&pin_PB06, // TFT_CS Chip select
93-
&pin_PA00, // TFT_RST Reset
94-
24000000);
83+
displayio_parallelbus_obj_t* bus = &displays[0].parallel_bus;
84+
bus->base.type = &displayio_parallelbus_type;
85+
common_hal_displayio_parallelbus_construct(bus,
86+
&pin_PA16, // Data0
87+
&pin_PB05, // Command or data
88+
&pin_PB06, // Chip select
89+
&pin_PB09, // Write
90+
&pin_PB04, // Read
91+
&pin_PA00); // Reset
9592

9693
displayio_display_obj_t* display = &displays[0].display;
9794
display->base.type = &displayio_display_type;
@@ -101,7 +98,7 @@ void board_init(void) {
10198
320, // Height
10299
0, // column start
103100
0, // row start
104-
270, // rotation
101+
0, // rotation
105102
16, // Color depth
106103
false, // grayscale
107104
false, // pixels_in_byte_share_row (unused for depths > 8)

ports/atmel-samd/boards/pyportal_titano/mpconfigboard.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
#define CIRCUITPY_MCU_FAMILY samd51
55

6-
76
#define MICROPY_HW_LED_STATUS (&pin_PA27)
87

98
#define MICROPY_HW_NEOPIXEL (&pin_PB22)

ports/atmel-samd/boards/pyportal_titano/pins.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -80,15 +80,6 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = {
8080
{ MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) },
8181
{ MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) },
8282

83-
// TFT control pins
84-
{MP_OBJ_NEW_QSTR(MP_QSTR_TFT_LITE), MP_ROM_PTR(&pin_PB31)},
85-
{MP_OBJ_NEW_QSTR(MP_QSTR_TFT_MOSI), MP_ROM_PTR(&pin_PA12)},
86-
{MP_OBJ_NEW_QSTR(MP_QSTR_TFT_SCK), MP_ROM_PTR(&pin_PA13)},
87-
{MP_OBJ_NEW_QSTR(MP_QSTR_TFT_MISO), MP_ROM_PTR(&pin_PA14)},
88-
{MP_OBJ_NEW_QSTR(MP_QSTR_TFT_RST), MP_ROM_PTR(&pin_PA00)},
89-
{MP_ROM_QSTR(MP_QSTR_TFT_CS), MP_ROM_PTR(&pin_PB06)},
90-
{MP_ROM_QSTR(MP_QSTR_TFT_DC), MP_ROM_PTR(&pin_PB05)},
91-
9283
{ MP_ROM_QSTR(MP_QSTR_DISPLAY), MP_ROM_PTR(&displays[0].display) },
9384
};
9485
MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table);

ports/atmel-samd/common-hal/busio/I2C.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ void common_hal_busio_i2c_construct(busio_i2c_obj_t *self,
116116
if (i2c_m_sync_set_baudrate(&self->i2c_desc, 0, frequency / 1000) != ERR_NONE) {
117117
reset_pin_number(sda->number);
118118
reset_pin_number(scl->number);
119+
common_hal_busio_i2c_deinit(self);
119120
mp_raise_ValueError(translate("Unsupported baudrate"));
120121
}
121122

ports/atmel-samd/common-hal/pulseio/PWMOut.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ pwmout_result_t common_hal_pulseio_pwmout_construct(pulseio_pwmout_obj_t* self,
135135
bool variable_frequency) {
136136
self->pin = pin;
137137
self->variable_frequency = variable_frequency;
138+
self->duty_cycle = duty;
138139

139140
if (pin->timer[0].index >= TC_INST_NUM &&
140141
pin->timer[1].index >= TCC_INST_NUM
@@ -322,6 +323,13 @@ void common_hal_pulseio_pwmout_deinit(pulseio_pwmout_obj_t* self) {
322323
}
323324

324325
extern void common_hal_pulseio_pwmout_set_duty_cycle(pulseio_pwmout_obj_t* self, uint16_t duty) {
326+
// Store the unadjusted duty cycle. It turns out the the process of adjusting and calculating
327+
// the duty cycle here and reading it back is lossy - the value will decay over time.
328+
// Track it here so that if frequency is changed we can use this value to recalculate the
329+
// proper duty cycle.
330+
// See https://github.com/adafruit/circuitpython/issues/2086 for more details
331+
self->duty_cycle = duty;
332+
325333
const pin_timer_t* t = self->timer;
326334
if (t->is_tc) {
327335
uint16_t adjusted_duty = tc_periods[t->index] * duty / 0xffff;
@@ -415,7 +423,6 @@ void common_hal_pulseio_pwmout_set_frequency(pulseio_pwmout_obj_t* self,
415423
break;
416424
}
417425
}
418-
uint16_t old_duty = common_hal_pulseio_pwmout_get_duty_cycle(self);
419426
if (t->is_tc) {
420427
Tc* tc = tc_insts[t->index];
421428
uint8_t old_divisor = tc->COUNT16.CTRLA.bit.PRESCALER;
@@ -450,7 +457,7 @@ void common_hal_pulseio_pwmout_set_frequency(pulseio_pwmout_obj_t* self,
450457
#endif
451458
}
452459

453-
common_hal_pulseio_pwmout_set_duty_cycle(self, old_duty);
460+
common_hal_pulseio_pwmout_set_duty_cycle(self, self->duty_cycle);
454461
}
455462

456463
uint32_t common_hal_pulseio_pwmout_get_frequency(pulseio_pwmout_obj_t* self) {

ports/atmel-samd/common-hal/pulseio/PWMOut.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ typedef struct {
3636
const mcu_pin_obj_t *pin;
3737
const pin_timer_t* timer;
3838
bool variable_frequency;
39+
uint16_t duty_cycle;
3940
} pulseio_pwmout_obj_t;
4041

4142
void pwmout_reset(void);

ports/cxd56/boards/spresense/mpconfigboard.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626

2727
#define MICROPY_HW_BOARD_NAME "SPRESENSE"
2828
#define MICROPY_HW_MCU_NAME "CXD5602"
29-
#define MICROPY_PY_SYS_PLATFORM "SPRESENSE"
3029

3130
#define DEFAULT_I2C_BUS_SCL (&pin_I2C0_BCK)
3231
#define DEFAULT_I2C_BUS_SDA (&pin_I2C0_BDT)

ports/cxd56/mpconfigport.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
#ifndef __INCLUDED_MPCONFIGPORT_H
2828
#define __INCLUDED_MPCONFIGPORT_H
2929

30+
#define MICROPY_PY_SYS_PLATFORM "CXD56"
31+
3032
// 64kiB stack
3133
#define CIRCUITPY_DEFAULT_STACK_SIZE 0x10000
3234

0 commit comments

Comments
 (0)