Skip to content

Commit 55c0404

Browse files
authored
Merge branch 'adafruit:main' into adcdma
2 parents 57c9d9c + b481411 commit 55c0404

File tree

4 files changed

+13
-6
lines changed

4 files changed

+13
-6
lines changed

ports/atmel-samd/boards/matrixportal_m4/mpconfigboard.mk

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,12 @@ CIRCUITPY_LTO_PARTITION = one
1414

1515
CIRCUITPY_AESIO = 0
1616
CIRCUITPY_FLOPPYIO = 0
17-
CIRCUITPY_GIFIO = 0
18-
CIRCUITPY_ONEWIREIO = 0
1917
CIRCUITPY_PARALLELDISPLAY = 0
20-
CIRCUITPY_SDCARDIO = 0
2118
CIRCUITPY_SHARPDISPLAY = 0
22-
CIRCUITPY_ZLIB=0
19+
CIRCUITPY_ULAB = 0
2320

2421
# Include these Python libraries in firmware.
2522
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Requests
23+
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_PortalBase
2624
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_ESP32SPI
2725
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel

shared-bindings/hashlib/Hash.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,13 @@
3939
//| digest_size: int
4040
//| """Digest size in bytes"""
4141
//|
42-
STATIC mp_obj_t hashlib_hash_get_digest_size(mp_obj_t self_in) {
42+
STATIC mp_obj_t hashlib_hash_digest_size_get(mp_obj_t self_in) {
4343
mp_check_self(mp_obj_is_type(self_in, &hashlib_hash_type));
4444
hashlib_hash_obj_t *self = MP_OBJ_TO_PTR(self_in);
4545
return MP_OBJ_NEW_SMALL_INT(common_hal_hashlib_hash_get_digest_size(self));
4646
}
47-
MP_PROPERTY_GETTER(hashlib_hash_digest_size_obj, hashlib_hash_get_digest_size);
47+
MP_DEFINE_CONST_FUN_OBJ_1(hashlib_hash_digest_size_get_obj, hashlib_hash_digest_size_get);
48+
MP_PROPERTY_GETTER(hashlib_hash_digest_size_obj, (mp_obj_t)&hashlib_hash_digest_size_get_obj);
4849

4950
//| def update(self, data: ReadableBuffer) -> None:
5051
//| """Update the hash with the given bytes.

shared-module/usb_hid/Device.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
* THE SOFTWARE.
2525
*/
2626

27+
#include <stdbool.h>
2728
#include <string.h>
2829

2930
#include "py/gc.h"
@@ -241,6 +242,10 @@ void common_hal_usb_hid_device_send_report(usb_hid_device_obj_t *self, uint8_t *
241242
mp_obj_t common_hal_usb_hid_device_get_last_received_report(usb_hid_device_obj_t *self, uint8_t report_id) {
242243
// report_id has already been validated for this device.
243244
size_t id_idx = get_report_id_idx(self, report_id);
245+
if (!self->out_report_buffers_updated[id_idx]) {
246+
return mp_const_none;
247+
}
248+
self->out_report_buffers_updated[id_idx] = false;
244249
return mp_obj_new_bytes(self->out_report_buffers[id_idx], self->out_report_lengths[id_idx]);
245250
}
246251

@@ -258,6 +263,7 @@ void usb_hid_device_create_report_buffers(usb_hid_device_obj_t *self) {
258263
? gc_alloc(self->out_report_lengths[i], false, true /*long-lived*/)
259264
: NULL;
260265
}
266+
memset(self->out_report_buffers_updated, 0, sizeof(self->out_report_buffers_updated));
261267
}
262268

263269

@@ -304,6 +310,7 @@ void tud_hid_set_report_cb(uint8_t itf, uint8_t report_id, hid_report_type_t rep
304310
hid_device->out_report_buffers[id_idx] &&
305311
hid_device->out_report_lengths[id_idx] >= bufsize) {
306312
memcpy(hid_device->out_report_buffers[id_idx], buffer, bufsize);
313+
hid_device->out_report_buffers_updated[id_idx] = true;
307314
}
308315
}
309316
}

shared-module/usb_hid/Device.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ typedef struct {
3838
const uint8_t *report_descriptor;
3939
uint8_t *in_report_buffers[CIRCUITPY_USB_HID_MAX_REPORT_IDS_PER_DESCRIPTOR];
4040
uint8_t *out_report_buffers[CIRCUITPY_USB_HID_MAX_REPORT_IDS_PER_DESCRIPTOR];
41+
uint8_t out_report_buffers_updated[CIRCUITPY_USB_HID_MAX_REPORT_IDS_PER_DESCRIPTOR];
4142
uint16_t report_descriptor_length;
4243
uint8_t report_ids[CIRCUITPY_USB_HID_MAX_REPORT_IDS_PER_DESCRIPTOR];
4344
uint8_t in_report_lengths[CIRCUITPY_USB_HID_MAX_REPORT_IDS_PER_DESCRIPTOR];

0 commit comments

Comments
 (0)