add aditional else if for MR_GREEN_1 state

This commit is contained in:
Imants Pulkstenis
2020-02-23 19:18:36 +02:00
parent e6cbc865aa
commit c42e0654da
+5 -1
View File
@@ -105,10 +105,14 @@ always@(posedge clk) begin
r_cnt = 0;
r_next = MR_GREEN_1;
end
else if (r_cnt >= MR_GREEN_TIME) & (MR_cars != 0) begin
else if (r_cnt >= MR_GREEN_TIME) & (MR_cars < PARAMETER) begin
r_cnt = 0;
r_next = MR_GREEN_2;
end
else if (r_cnt >= MR_GREEN_TIME) & (MR_cars >= PARAMETER) begin
r_cnt = 0;
r_next = MR_YELLOW;
end
end
MR_GREEN_2: begin
r_MR_ctl = 'b11;