diff options
| author | hathach <[email protected]> | 2020-03-23 15:21:22 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2020-03-23 15:21:22 +0700 |
| commit | 76a27cf49a16adade29abd94a7f64a374c96219f (patch) | |
| tree | 73bb9b5a71a2300427963ca640c8ba9d12e9ce0a /examples | |
| parent | 00eabbac3533b2b33020c477b9cc07af491fd626 (diff) | |
fix rndis response to get mac address
- remove cflags -fshort-enums
- clean up webserver descriptor
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/device/net_lwip_webserver/src/usb_descriptors.c | 8 | ||||
| -rw-r--r-- | examples/rules.mk | 2 |
2 files changed, 6 insertions, 4 deletions
diff --git a/examples/device/net_lwip_webserver/src/usb_descriptors.c b/examples/device/net_lwip_webserver/src/usb_descriptors.c index 26f8aeba6..93d8e1335 100644 --- a/examples/device/net_lwip_webserver/src/usb_descriptors.c +++ b/examples/device/net_lwip_webserver/src/usb_descriptors.c @@ -155,15 +155,16 @@ static uint16_t _desc_str[32]; // 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 langid) { - (void)langid; + (void) langid; - unsigned chr_count = 0; + uint8_t chr_count = 0; if (STR_LANGID == index) { memcpy(&_desc_str[1], string_desc_arr[0], 2); chr_count = 1; } +#if CFG_TUD_NET == OPT_NET_ECM else if (STR_MAC == index) { // Convert MAC address into UTF-16 @@ -174,6 +175,7 @@ uint16_t const* tud_descriptor_string_cb(uint8_t index, uint16_t langid) _desc_str[1+chr_count++] = "0123456789ABCDEF"[(tud_network_mac_address[i] >> 0) & 0xf]; } } +#endif else { // Convert ASCII string into UTF-16 @@ -186,7 +188,7 @@ uint16_t const* tud_descriptor_string_cb(uint8_t index, uint16_t langid) chr_count = strlen(str); if ( chr_count > (TU_ARRAY_SIZE(_desc_str) - 1)) chr_count = TU_ARRAY_SIZE(_desc_str) - 1; - for (unsigned i=0; i<chr_count; i++) + for (uint8_t i=0; i<chr_count; i++) { _desc_str[1+i] = str[i]; } diff --git a/examples/rules.mk b/examples/rules.mk index e51703aa7..137063343 100644 --- a/examples/rules.mk +++ b/examples/rules.mk @@ -30,7 +30,7 @@ INC += $(TOP)/src # CFLAGS += $(addprefix -I,$(INC)) -LDFLAGS += $(CFLAGS) -fshort-enums -Wl,-T,$(TOP)/$(LD_FILE) -Wl,[email protected] -Wl,-cref -Wl,-gc-sections -specs=nosys.specs -specs=nano.specs +LDFLAGS += $(CFLAGS) -Wl,-T,$(TOP)/$(LD_FILE) -Wl,[email protected] -Wl,-cref -Wl,-gc-sections -specs=nosys.specs -specs=nano.specs ASFLAGS += $(CFLAGS) # Assembly files can be name with upper case .S, convert it to .s |
