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:
commit
8f799bb9f1
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user