mirror of
https://github.com/polhenarejos/pico-keys-sdk
synced 2026-05-28 17:11:23 +02:00
Added support for APPEND_CR.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
@@ -147,6 +147,7 @@ typedef struct {
|
|||||||
#define CTAP1_ERR_OTHER 0x7f // Other unspecified error
|
#define CTAP1_ERR_OTHER 0x7f // Other unspecified error
|
||||||
|
|
||||||
extern void add_keyboard_buffer(const uint8_t *, size_t, bool);
|
extern void add_keyboard_buffer(const uint8_t *, size_t, bool);
|
||||||
|
extern void append_keyboard_buffer(const uint8_t *data, size_t data_len);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -169,6 +169,13 @@ void add_keyboard_buffer(const uint8_t *data, size_t data_len, bool encode) {
|
|||||||
keyboard_encode = encode;
|
keyboard_encode = encode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void append_keyboard_buffer(const uint8_t *data, size_t data_len) {
|
||||||
|
if (keyboard_buffer_len < sizeof(keyboard_buffer)) {
|
||||||
|
memcpy(keyboard_buffer + keyboard_buffer_len, data, MIN(sizeof(keyboard_buffer) - keyboard_buffer_len, data_len));
|
||||||
|
keyboard_buffer_len += MIN(sizeof(keyboard_buffer) - keyboard_buffer_len, data_len);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void send_hid_report(uint8_t report_id) {
|
static void send_hid_report(uint8_t report_id) {
|
||||||
if (!tud_hid_ready()) {
|
if (!tud_hid_ready()) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user