1
0
mirror of https://github.com/avakar/usbcorev.git synced 2024-10-22 02:17:39 +08:00

Merge pull request #3 from elvisfox/master

Do not generate usb_rst upon power-on reset
This commit is contained in:
Martin Vejnár 2019-12-10 11:20:19 +01:00 committed by GitHub
commit 8f799bb9f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -144,18 +144,20 @@ module usb_reset_detect(
input se0,
output usb_rst);
localparam cntr_rst_val = 19'd480000;
reg[18:0] cntr;
assign usb_rst = cntr == 1'b0;
always @(posedge clk or negedge rst_n) begin
if (!rst_n) begin
cntr <= 1'b0;
cntr <= cntr_rst_val;
end else begin
if (se0) begin
if (!usb_rst)
cntr <= cntr - 1'b1;
end else begin
cntr <= 19'd480000;
cntr <= cntr_rst_val;
end
end
end