mirror of
https://github.com/tillitis/tillitis-key1.git
synced 2024-12-29 17:36:26 -05:00
Ignore the prescaler if prescaler init value is zero
This commit is contained in:
parent
2be934ee22
commit
c3f7c5fb06
@ -159,10 +159,15 @@ module timer_core(
|
||||
ready_we = 1'h1;
|
||||
prescaler_set = 1'h1;
|
||||
timer_set = 1'h1;
|
||||
if (prescaler_init == 0) begin
|
||||
core_ctrl_new = CTRL_TIMER;
|
||||
core_ctrl_we = 1'h1;
|
||||
end else begin
|
||||
core_ctrl_new = CTRL_PRESCALER;
|
||||
core_ctrl_we = 1'h1;
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
CTRL_PRESCALER: begin
|
||||
@ -177,9 +182,7 @@ module timer_core(
|
||||
if (prescaler_reg == 0) begin
|
||||
core_ctrl_new = CTRL_TIMER;
|
||||
core_ctrl_we = 1'h1;
|
||||
end
|
||||
|
||||
else begin
|
||||
end else begin
|
||||
prescaler_dec = 1'h1;
|
||||
end
|
||||
end
|
||||
@ -203,13 +206,16 @@ module timer_core(
|
||||
end
|
||||
|
||||
else begin
|
||||
prescaler_set = 1'h1;
|
||||
timer_dec = 1'h1;
|
||||
|
||||
if (prescaler_init > 0) begin
|
||||
prescaler_set = 1'h1;
|
||||
core_ctrl_new = CTRL_PRESCALER;
|
||||
core_ctrl_we = 1'h1;
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
default: begin
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user