Skip to content

Commit

Permalink
pongoOS 2.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
woachk committed Oct 31, 2020
1 parent 602f59a commit 01aa3c9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ ifeq ($(HOST_OS),Linux)
endif
endif

PONGO_VERSION := 2.3.0-$(shell git log -1 --pretty=format:"%H" | cut -c1-8)
PONGO_VERSION := 2.3.1-$(shell git log -1 --pretty=format:"%H" | cut -c1-8)
ROOT := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
SRC := $(ROOT)/src
AUX := $(ROOT)/tools
Expand Down
4 changes: 1 addition & 3 deletions scripts/upload_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,5 @@
dev.set_configuration()

dev.ctrl_transfer(0x21, 2, 0, 0, 0)
dev.ctrl_transfer(0x21, 5, 0, 0, struct.pack('I', len(data)))
dev.ctrl_transfer(0x21, 2, 0, 0, 0)
dev.ctrl_transfer(0x21, 1, 0, 0, 0)
dev.ctrl_transfer(0x21, 1, 0, 0, struct.pack('I', len(data)))
dev.write(2,data,1000000)
11 changes: 9 additions & 2 deletions src/shell/usbloader.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,21 @@ bool reallocate_loader_xfer_data(const void* data, uint32_t size) {
if (size != 4) panic("reallocate_loader_xfer_data");

uint32_t newsz = *(uint32_t*)data;
newsz += 0x1ff;
newsz &= ~0x1ff;
if (newsz > UPLOADSZ_MAX) return false;
loader_xfer_recv_count = 0;
usbloader_is_waiting_xfer = 1;
resize_loader_xfer_data(newsz);
loader_xfer_size = newsz;

usb_out_transfer_dma(2, loader_xfer_recv_data, vatophys((uint64_t)loader_xfer_recv_data), loader_xfer_size, usbloader_xfer_done_cb); // should resolve the VA rather than doing this, but oh well.

return true;
}

void usbloader_init() {
loader_xfer_recv_data = alloc_contig(UPLOADSZ);
loader_xfer_size = UPLOADSZ;
loader_xfer_recv_size = UPLOADSZ;
loader_xfer_recv_count = 0;
} // fetch_stdoutbuf
Expand Down Expand Up @@ -130,7 +136,8 @@ bool ep0_device_request(struct setup_packet *setup) {
return true;
}
}
if (setup->bRequest == 5 && setup->wLength == 4) { // request upload buffer size change
if (setup->bRequest == 1 && setup->wLength == 4) { // request upload buffer size change
if (usbloader_is_waiting_xfer) return false;
ep0_begin_data_out_stage(reallocate_loader_xfer_data);
return true;
}
Expand Down

0 comments on commit 01aa3c9

Please sign in to comment.