Skip to content

Commit 471053c

Browse files
committed
Merge remote-tracking branch 'adafruit/main' into c3_short_send
2 parents 0b098f5 + d645e9c commit 471053c

File tree

9 files changed

+47
-22
lines changed

9 files changed

+47
-22
lines changed

ports/espressif/bindings/esp32_camera/Camera.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
//| pixel_format: PixelFormat=PixelFormat.RGB565,
5858
//| frame_size: FrameSize=FrameSize.QQVGA,
5959
//| jpeg_quality: int=15,
60-
//| double_buffered: bool = True,
60+
//| framebuffer_count: int = 1,
6161
//| grab_mode: GrabMode = GrabMode.WHEN_EMPTY,
6262
//| ) -> None:
6363
//| """

shared-bindings/onewireio/OneWire.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,6 @@
4242
//|
4343
//| :param ~microcontroller.Pin pin: Pin connected to the OneWire bus
4444
//|
45-
//| .. note:: The OneWire class is available on `busio` and `bitbangio` in CircuitPython
46-
//| 7.x for backwards compatibility but will be removed in CircuitPython 8.0.0.
47-
//|
4845
//| Read a short series of pulses::
4946
//|
5047
//| import onewireio

shared-bindings/pulseio/PulseOut.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,6 @@
4848
//| :param int frequency: Carrier signal frequency in Hertz
4949
//| :param int duty_cycle: 16-bit duty cycle of carrier frequency (0 - 65536)
5050
//|
51-
//| For backwards compatibility, ``pin`` may be a PWMOut object used as the carrier. This
52-
//| compatibility will be removed in CircuitPython 8.0.0.
53-
//|
5451
//| Send a short series of pulses::
5552
//|
5653
//| import array
@@ -82,14 +79,6 @@ STATIC mp_obj_t pulseio_pulseout_make_new(const mp_obj_type_t *type, size_t n_ar
8279
const mcu_pin_obj_t *pin = args[ARG_pin].u_obj;
8380
mp_int_t frequency = args[ARG_frequency].u_int;
8481
mp_int_t duty_cycle = args[ARG_duty_cycle].u_int;
85-
if (mp_obj_is_type(args[ARG_pin].u_obj, &pwmio_pwmout_type)) {
86-
pwmio_pwmout_obj_t *pwmout = args[ARG_pin].u_obj;
87-
duty_cycle = common_hal_pwmio_pwmout_get_duty_cycle(pwmout);
88-
frequency = common_hal_pwmio_pwmout_get_frequency(pwmout);
89-
pin = common_hal_pwmio_pwmout_get_pin(pwmout);
90-
// Deinit the pin so we can use it.
91-
common_hal_pwmio_pwmout_deinit(pwmout);
92-
}
9382
validate_obj_is_free_pin(MP_OBJ_FROM_PTR(pin));
9483
pulseio_pulseout_obj_t *self = m_new_obj(pulseio_pulseout_obj_t);
9584
self->base.type = &pulseio_pulseout_type;

shared-bindings/qrio/PixelPolicy.c

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,28 @@
3434
//| """The input buffer to `QRDecoder.decode` consists of greyscale values in every byte"""
3535
//|
3636
//| EVEN_BYTES: PixelPolicy
37-
//| """The input buffer to `QRDecoder.decode` consists of greyscale values in positions 0, 2, …, and ignored bytes in positions 1, 3, …. This can decode directly from YUV images where the even bytes hold the Y (luminance) data."""
37+
//| """The input buffer to `QRDecoder.decode` consists of greyscale values in positions 0, 2, …, and ignored bytes in positions 1, 3, …. This can decode directly from YUV images where the even bytes hold the Y (luminance) data."""
3838
//|
3939
//| ODD_BYTES: PixelPolicy
40-
//| """The input buffer to `QRDecoder.decode` consists of greyscale values in positions 1, 3, …, and ignored bytes in positions 0, 2, …. This can decode directly from YUV images where the odd bytes hold the Y (luminance) data"""
40+
//| """The input buffer to `QRDecoder.decode` consists of greyscale values in positions 1, 3, …, and ignored bytes in positions 0, 2, …. This can decode directly from YUV images where the odd bytes hold the Y (luminance) data"""
41+
//|
42+
//| RGB565_SWAPPED: PixelPolicy
43+
//| """The input buffer to `QRDecoder.decode` consists of RGB565 values in byte-swapped order. Most cameras produce data in byte-swapped order. The green component is used."""
44+
//|
45+
//| RGB565: PixelPolicy
46+
//| """The input buffer to `QRDecoder.decode` consists of RGB565 values in native order. The green component is used."""
4147
//|
4248

4349
MAKE_ENUM_VALUE(qrio_pixel_policy_type, qrio_pixel_policy, EVERY_BYTE, QRIO_EVERY_BYTE);
50+
MAKE_ENUM_VALUE(qrio_pixel_policy_type, qrio_pixel_policy, RGB565, QRIO_RGB565);
51+
MAKE_ENUM_VALUE(qrio_pixel_policy_type, qrio_pixel_policy, RGB565_SWAPPED, QRIO_RGB565_SWAPPED);
4452
MAKE_ENUM_VALUE(qrio_pixel_policy_type, qrio_pixel_policy, EVEN_BYTES, QRIO_EVEN_BYTES);
4553
MAKE_ENUM_VALUE(qrio_pixel_policy_type, qrio_pixel_policy, ODD_BYTES, QRIO_EVEN_BYTES);
4654

4755
MAKE_ENUM_MAP(qrio_pixel_policy) {
4856
MAKE_ENUM_MAP_ENTRY(qrio_pixel_policy, EVERY_BYTE),
57+
MAKE_ENUM_MAP_ENTRY(qrio_pixel_policy, RGB565),
58+
MAKE_ENUM_MAP_ENTRY(qrio_pixel_policy, RGB565_SWAPPED),
4959
MAKE_ENUM_MAP_ENTRY(qrio_pixel_policy, EVEN_BYTES),
5060
MAKE_ENUM_MAP_ENTRY(qrio_pixel_policy, ODD_BYTES),
5161
};

shared-bindings/qrio/PixelPolicy.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
extern const mp_obj_type_t qrio_pixel_policy_type;
3434

3535
typedef enum {
36-
QRIO_EVERY_BYTE, QRIO_EVEN_BYTES, QRIO_ODD_BYTES
36+
QRIO_EVERY_BYTE, QRIO_EVEN_BYTES, QRIO_ODD_BYTES, QRIO_RGB565, QRIO_RGB565_SWAPPED
3737
} qrio_pixel_policy_t;
3838

3939
extern const cp_enum_obj_t qrio_pixel_policy_EVERY_BYTE_obj;

shared-module/qrio/QRDecoder.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,20 @@ mp_obj_t shared_module_qrio_qrdecoder_decode(qrdecoder_qrdecoder_obj_t *self, co
104104
uint8_t *src = bufinfo->buf;
105105

106106
switch (policy) {
107+
case QRIO_RGB565: {
108+
uint16_t *src16 = bufinfo->buf;
109+
for (int i = 0; i < width * height; i++) {
110+
framebuffer[i] = (src16[i] >> 3) & 0xfc;
111+
}
112+
break;
113+
}
114+
case QRIO_RGB565_SWAPPED: {
115+
uint16_t *src16 = bufinfo->buf;
116+
for (int i = 0; i < width * height; i++) {
117+
framebuffer[i] = (__builtin_bswap16(src16[i]) >> 3) & 0xfc;
118+
}
119+
break;
120+
}
107121
case QRIO_EVERY_BYTE:
108122
memcpy(framebuffer, src, width * height);
109123
break;
@@ -116,6 +130,7 @@ mp_obj_t shared_module_qrio_qrdecoder_decode(qrdecoder_qrdecoder_obj_t *self, co
116130
for (int i = 0; i < width * height; i++) {
117131
framebuffer[i] = src[2 * i];
118132
}
133+
break;
119134
}
120135
quirc_end(self->quirc);
121136

shared-module/touchio/TouchIn.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ void common_hal_touchio_touchin_construct(touchio_touchin_obj_t *self, const mcu
7878

7979
uint16_t raw_reading = get_raw_reading(self);
8080
if (raw_reading == TIMEOUT_TICKS) {
81+
common_hal_touchio_touchin_deinit(self);
8182
mp_raise_ValueError(translate("No pulldown on pin; 1Mohm recommended"));
8283
}
8384
self->threshold = raw_reading * 1.05 + 100;

supervisor/shared/web_workflow/static/directory.js

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,15 @@ var current_path;
66
var editable = undefined;
77

88
async function refresh_list() {
9+
10+
function compareValues(a, b) {
11+
if (a.directory == b.directory && a.name.toLowerCase() === b.name.toLowerCase()) {
12+
return 0;
13+
} else {
14+
return a.directory.toString().substring(3,4)+a.name.toLowerCase() < b.directory.toString().substring(3,4)+b.name.toLowerCase() ? -1 : 1;
15+
}
16+
}
17+
918
current_path = window.location.hash.substr(1);
1019
if (current_path == "") {
1120
current_path = "/";
@@ -56,6 +65,8 @@ async function refresh_list() {
5665
new_children.push(clone);
5766
}
5867

68+
data.sort(compareValues);
69+
5970
for (const f of data) {
6071
// Clone the new row and insert it into the table
6172
var clone = template.content.cloneNode(true);
@@ -92,9 +103,11 @@ async function refresh_list() {
92103
delete_button.disabled = !editable;
93104
delete_button.onclick = del;
94105

95-
edit_url = new URL(edit_url, url_base);
96-
let edit_link = clone.querySelector(".edit_link");
97-
edit_link.href = edit_url
106+
if (editable && !f.directory) {
107+
edit_url = new URL(edit_url, url_base);
108+
let edit_link = clone.querySelector(".edit_link");
109+
edit_link.href = edit_url
110+
}
98111

99112
new_children.push(clone);
100113
}

0 commit comments

Comments
 (0)