From e38c37b6b77e4769cc4ead8d3f98c61581abacd8 Mon Sep 17 00:00:00 2001 From: hathach Date: Mon, 27 May 2019 20:31:22 +0700 Subject: [PATCH] clean up --- cores/nRF5/Adafruit_TinyUSB_Core/Adafruit_USBD_Device.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cores/nRF5/Adafruit_TinyUSB_Core/Adafruit_USBD_Device.cpp b/cores/nRF5/Adafruit_TinyUSB_Core/Adafruit_USBD_Device.cpp index b1b9cbe6..6910ba50 100644 --- a/cores/nRF5/Adafruit_TinyUSB_Core/Adafruit_USBD_Device.cpp +++ b/cores/nRF5/Adafruit_TinyUSB_Core/Adafruit_USBD_Device.cpp @@ -164,7 +164,8 @@ uint8_t const * tud_descriptor_configuration_cb(uint8_t index) return USBDevice._desc_cfg; } -static uint16_t _desc_str[32]; +// up to 32 unicode characters (header make it 33) +static uint16_t _desc_str[33]; // Invoked when received GET STRING DESCRIPTOR request // Application return pointer to descriptor, whose contents must exist long enough for transfer to complete @@ -187,7 +188,7 @@ uint16_t const* tud_descriptor_string_cb(uint8_t index) // cap at max char chr_count = strlen(str); - if ( chr_count > 31 ) chr_count = 31; + if ( chr_count > 32 ) chr_count = 32; for(uint8_t i=0; i