Merge pull request #286 from chang196700/feature-langid
Add feature: langid Support
This commit is contained in:
@@ -130,8 +130,10 @@ static uint16_t _desc_str[32];
|
|||||||
|
|
||||||
// Invoked when received GET STRING DESCRIPTOR request
|
// Invoked when received GET STRING DESCRIPTOR request
|
||||||
// Application return pointer to descriptor, whose contents must exist long enough for transfer to complete
|
// Application return pointer to descriptor, whose contents must exist long enough for transfer to complete
|
||||||
uint16_t const* tud_descriptor_string_cb(uint8_t index)
|
uint16_t const* tud_descriptor_string_cb(uint8_t index, uint16_t langid)
|
||||||
{
|
{
|
||||||
|
(void) langid;
|
||||||
|
|
||||||
uint8_t chr_count;
|
uint8_t chr_count;
|
||||||
|
|
||||||
if ( index == 0)
|
if ( index == 0)
|
||||||
|
@@ -155,8 +155,10 @@ static uint16_t _desc_str[32];
|
|||||||
|
|
||||||
// Invoked when received GET STRING DESCRIPTOR request
|
// Invoked when received GET STRING DESCRIPTOR request
|
||||||
// Application return pointer to descriptor, whose contents must exist long enough for transfer to complete
|
// Application return pointer to descriptor, whose contents must exist long enough for transfer to complete
|
||||||
uint16_t const* tud_descriptor_string_cb(uint8_t index)
|
uint16_t const* tud_descriptor_string_cb(uint8_t index, uint16_t langid)
|
||||||
{
|
{
|
||||||
|
(void) langid;
|
||||||
|
|
||||||
uint8_t chr_count;
|
uint8_t chr_count;
|
||||||
|
|
||||||
if ( index == 0)
|
if ( index == 0)
|
||||||
|
@@ -184,8 +184,10 @@ static uint16_t _desc_str[32];
|
|||||||
|
|
||||||
// Invoked when received GET STRING DESCRIPTOR request
|
// Invoked when received GET STRING DESCRIPTOR request
|
||||||
// Application return pointer to descriptor, whose contents must exist long enough for transfer to complete
|
// Application return pointer to descriptor, whose contents must exist long enough for transfer to complete
|
||||||
uint16_t const* tud_descriptor_string_cb(uint8_t index)
|
uint16_t const* tud_descriptor_string_cb(uint8_t index, uint16_t langid)
|
||||||
{
|
{
|
||||||
|
(void) langid;
|
||||||
|
|
||||||
uint8_t chr_count;
|
uint8_t chr_count;
|
||||||
|
|
||||||
if ( index == 0)
|
if ( index == 0)
|
||||||
|
@@ -193,8 +193,10 @@ static uint16_t _desc_str[32];
|
|||||||
|
|
||||||
// Invoked when received GET STRING DESCRIPTOR request
|
// Invoked when received GET STRING DESCRIPTOR request
|
||||||
// Application return pointer to descriptor, whose contents must exist long enough for transfer to complete
|
// Application return pointer to descriptor, whose contents must exist long enough for transfer to complete
|
||||||
uint16_t const* tud_descriptor_string_cb(uint8_t index)
|
uint16_t const* tud_descriptor_string_cb(uint8_t index, uint16_t langid)
|
||||||
{
|
{
|
||||||
|
(void) langid;
|
||||||
|
|
||||||
size_t chr_count;
|
size_t chr_count;
|
||||||
|
|
||||||
if ( index == 0)
|
if ( index == 0)
|
||||||
|
@@ -134,8 +134,10 @@ static uint16_t _desc_str[32];
|
|||||||
|
|
||||||
// Invoked when received GET STRING DESCRIPTOR request
|
// Invoked when received GET STRING DESCRIPTOR request
|
||||||
// Application return pointer to descriptor, whose contents must exist long enough for transfer to complete
|
// Application return pointer to descriptor, whose contents must exist long enough for transfer to complete
|
||||||
uint16_t const* tud_descriptor_string_cb(uint8_t index)
|
uint16_t const* tud_descriptor_string_cb(uint8_t index, uint16_t langid)
|
||||||
{
|
{
|
||||||
|
(void) langid;
|
||||||
|
|
||||||
uint8_t chr_count;
|
uint8_t chr_count;
|
||||||
|
|
||||||
if ( index == 0)
|
if ( index == 0)
|
||||||
|
@@ -132,8 +132,10 @@ static uint16_t _desc_str[32];
|
|||||||
|
|
||||||
// Invoked when received GET STRING DESCRIPTOR request
|
// Invoked when received GET STRING DESCRIPTOR request
|
||||||
// Application return pointer to descriptor, whose contents must exist long enough for transfer to complete
|
// Application return pointer to descriptor, whose contents must exist long enough for transfer to complete
|
||||||
uint16_t const* tud_descriptor_string_cb(uint8_t index)
|
uint16_t const* tud_descriptor_string_cb(uint8_t index, uint16_t langid)
|
||||||
{
|
{
|
||||||
|
(void) langid;
|
||||||
|
|
||||||
uint8_t chr_count;
|
uint8_t chr_count;
|
||||||
|
|
||||||
if ( index == 0)
|
if ( index == 0)
|
||||||
|
@@ -123,8 +123,10 @@ static uint16_t _desc_str[32];
|
|||||||
|
|
||||||
// Invoked when received GET STRING DESCRIPTOR request
|
// Invoked when received GET STRING DESCRIPTOR request
|
||||||
// Application return pointer to descriptor, whose contents must exist long enough for transfer to complete
|
// Application return pointer to descriptor, whose contents must exist long enough for transfer to complete
|
||||||
uint16_t const* tud_descriptor_string_cb(uint8_t index)
|
uint16_t const* tud_descriptor_string_cb(uint8_t index, uint16_t langid)
|
||||||
{
|
{
|
||||||
|
(void) langid;
|
||||||
|
|
||||||
uint8_t chr_count;
|
uint8_t chr_count;
|
||||||
|
|
||||||
if ( index == 0)
|
if ( index == 0)
|
||||||
|
@@ -121,8 +121,10 @@ static uint16_t _desc_str[32];
|
|||||||
|
|
||||||
// Invoked when received GET STRING DESCRIPTOR request
|
// Invoked when received GET STRING DESCRIPTOR request
|
||||||
// Application return pointer to descriptor, whose contents must exist long enough for transfer to complete
|
// Application return pointer to descriptor, whose contents must exist long enough for transfer to complete
|
||||||
uint16_t const* tud_descriptor_string_cb(uint8_t index)
|
uint16_t const* tud_descriptor_string_cb(uint8_t index, uint16_t langid)
|
||||||
{
|
{
|
||||||
|
(void) langid;
|
||||||
|
|
||||||
uint8_t chr_count;
|
uint8_t chr_count;
|
||||||
|
|
||||||
if ( index == 0)
|
if ( index == 0)
|
||||||
|
@@ -216,8 +216,10 @@ static uint16_t _desc_str[32];
|
|||||||
|
|
||||||
// Invoked when received GET STRING DESCRIPTOR request
|
// Invoked when received GET STRING DESCRIPTOR request
|
||||||
// Application return pointer to descriptor, whose contents must exist long enough for transfer to complete
|
// Application return pointer to descriptor, whose contents must exist long enough for transfer to complete
|
||||||
uint16_t const* tud_descriptor_string_cb(uint8_t index)
|
uint16_t const* tud_descriptor_string_cb(uint8_t index, uint16_t langid)
|
||||||
{
|
{
|
||||||
|
(void) langid;
|
||||||
|
|
||||||
size_t chr_count;
|
size_t chr_count;
|
||||||
|
|
||||||
if ( index == 0)
|
if ( index == 0)
|
||||||
|
@@ -204,8 +204,10 @@ static uint16_t _desc_str[32];
|
|||||||
|
|
||||||
// Invoked when received GET STRING DESCRIPTOR request
|
// Invoked when received GET STRING DESCRIPTOR request
|
||||||
// Application return pointer to descriptor, whose contents must exist long enough for transfer to complete
|
// Application return pointer to descriptor, whose contents must exist long enough for transfer to complete
|
||||||
uint16_t const* tud_descriptor_string_cb(uint8_t index)
|
uint16_t const* tud_descriptor_string_cb(uint8_t index, uint16_t langid)
|
||||||
{
|
{
|
||||||
|
(void) langid;
|
||||||
|
|
||||||
uint8_t chr_count;
|
uint8_t chr_count;
|
||||||
|
|
||||||
if ( index == 0)
|
if ( index == 0)
|
||||||
|
@@ -809,7 +809,7 @@ static bool process_get_descriptor(uint8_t rhport, tusb_control_request_t const
|
|||||||
return false;
|
return false;
|
||||||
}else
|
}else
|
||||||
{
|
{
|
||||||
uint8_t const* desc_str = (uint8_t const*) tud_descriptor_string_cb(desc_index);
|
uint8_t const* desc_str = (uint8_t const*) tud_descriptor_string_cb(desc_index, p_request->wIndex);
|
||||||
TU_ASSERT(desc_str);
|
TU_ASSERT(desc_str);
|
||||||
|
|
||||||
// first byte of descriptor is its size
|
// first byte of descriptor is its size
|
||||||
|
@@ -91,7 +91,7 @@ uint8_t const * tud_descriptor_configuration_cb(uint8_t index);
|
|||||||
|
|
||||||
// Invoked when received GET STRING DESCRIPTOR request
|
// Invoked when received GET STRING DESCRIPTOR request
|
||||||
// Application return pointer to descriptor, whose contents must exist long enough for transfer to complete
|
// Application return pointer to descriptor, whose contents must exist long enough for transfer to complete
|
||||||
uint16_t const* tud_descriptor_string_cb(uint8_t index);
|
uint16_t const* tud_descriptor_string_cb(uint8_t index, uint16_t langid);
|
||||||
|
|
||||||
// Invoked when device is mounted (configured)
|
// Invoked when device is mounted (configured)
|
||||||
TU_ATTR_WEAK void tud_mount_cb(void);
|
TU_ATTR_WEAK void tud_mount_cb(void);
|
||||||
|
@@ -184,8 +184,10 @@ uint8_t const * tud_descriptor_configuration_cb(uint8_t index)
|
|||||||
return desc_configuration;
|
return desc_configuration;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint16_t const* tud_descriptor_string_cb(uint8_t index)
|
uint16_t const* tud_descriptor_string_cb(uint8_t index, uint16_t langid)
|
||||||
{
|
{
|
||||||
|
(void) langid;
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -111,8 +111,10 @@ uint8_t const * tud_descriptor_configuration_cb(uint8_t index)
|
|||||||
return desc_configuration;
|
return desc_configuration;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint16_t const* tud_descriptor_string_cb(uint8_t index)
|
uint16_t const* tud_descriptor_string_cb(uint8_t index, uint16_t langid)
|
||||||
{
|
{
|
||||||
|
(void) langid;
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user