some fixes from dfu branch
This commit is contained in:
parent
f7b1f465cc
commit
508ab7c94b
2
Makefile
2
Makefile
@ -50,7 +50,7 @@ all: $(BUILD)/$(TARGET).elf
|
|||||||
$(BUILD)/$(TARGET).elf: $(patsubst %,$(BUILD)/%,$(AS_SRC:.s=.o) $(SRC:.c=.o))
|
$(BUILD)/$(TARGET).elf: $(patsubst %,$(BUILD)/%,$(AS_SRC:.s=.o) $(SRC:.c=.o))
|
||||||
@echo " Linking file: $@"
|
@echo " Linking file: $@"
|
||||||
@$(shell mkdir -p $(BUILD)/$(*D))
|
@$(shell mkdir -p $(BUILD)/$(*D))
|
||||||
@$(CC) $(CFLAGS) $^ -o $@ $(LDFLAGS)
|
@$(CC) $(CFLAGS) $^ -o $@ $(LDFLAGS) > /dev/null
|
||||||
@$(OBJCOPY) -O binary $@ $@.bin
|
@$(OBJCOPY) -O binary $@ $@.bin
|
||||||
@$(OBJCOPY) -O ihex $@ $@.hex
|
@$(OBJCOPY) -O ihex $@ $@.hex
|
||||||
@$(OBJDUMP) -h -S -C $@ > $@.lss
|
@$(OBJDUMP) -h -S -C $@ > $@.lss
|
||||||
|
@ -9,6 +9,7 @@
|
|||||||
* with minor modifications:
|
* with minor modifications:
|
||||||
* - type conversion (e.g. __u8 -> uint8_t)
|
* - type conversion (e.g. __u8 -> uint8_t)
|
||||||
* - usb_endpoint_descriptor: removed last 2 bytes
|
* - usb_endpoint_descriptor: removed last 2 bytes
|
||||||
|
* - usb_string_descriptor: wData has no size
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*-------------------------------------------------------------------------*/
|
/*-------------------------------------------------------------------------*/
|
||||||
@ -258,7 +259,7 @@ struct usb_string_descriptor {
|
|||||||
uint8_t bLength;
|
uint8_t bLength;
|
||||||
uint8_t bDescriptorType;
|
uint8_t bDescriptorType;
|
||||||
|
|
||||||
uint16_t wData[1]; /* UTF-16LE encoded */
|
uint16_t wData[]; /* UTF-16LE encoded */
|
||||||
} __attribute__ ((packed));
|
} __attribute__ ((packed));
|
||||||
|
|
||||||
/* note that "string" zero is special, it holds language codes that
|
/* note that "string" zero is special, it holds language codes that
|
||||||
|
@ -311,7 +311,7 @@ static void udp_handle_ctrlrequest(struct usb_ctrlrequest *req)
|
|||||||
// TODO: follow current_interface
|
// TODO: follow current_interface
|
||||||
switch (req->bRequest) {
|
switch (req->bRequest) {
|
||||||
case USB_REQ_SET_INTERFACE: /* 0x0b */
|
case USB_REQ_SET_INTERFACE: /* 0x0b */
|
||||||
current_interface = req->wIndex;
|
current_interface = req->wValue;
|
||||||
udp_send_data(&ep_transfer[0], NULL, 0, udp_txcb_setinterface);
|
udp_send_data(&ep_transfer[0], NULL, 0, udp_txcb_setinterface);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -335,7 +335,6 @@ static void udp_handle_ctrlrequest(struct usb_ctrlrequest *req)
|
|||||||
|
|
||||||
case USB_CDC_REQ_SET_LINE_CODING: /* 0x20 */
|
case USB_CDC_REQ_SET_LINE_CODING: /* 0x20 */
|
||||||
// TODO: read 7 data bytes
|
// TODO: read 7 data bytes
|
||||||
udp_send_data(&ep_transfer[0], NULL, 0, NULL);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case USB_CDC_REQ_SET_CONTROL_LINE_STATE: /* 0x22 */
|
case USB_CDC_REQ_SET_CONTROL_LINE_STATE: /* 0x22 */
|
||||||
|
Loading…
Reference in New Issue
Block a user