Skip to content

Commit

Permalink
Only reset count when Just is received
Browse files Browse the repository at this point in the history
  • Loading branch information
jvnknvlgl committed Aug 26, 2024
1 parent 1346c87 commit 228b7a6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions clash-cores/src/Clash/Cores/Sgmii/RateAdapt.hs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ rateAdaptRxT ::
(LinkSpeed, Maybe a) ->
-- | New state and output value
(Index 100, Maybe a)
rateAdaptRxT n (linkSpeed, a)
| n == 0 = (n', a)
rateAdaptRxT n (_, Nothing) = (n, Nothing)
rateAdaptRxT n (linkSpeed, Just a)
| n == 0 = (n', Just a)
| otherwise = (n', Nothing)
where
n' = if n == repeatN then 0 else n + 1
Expand Down

0 comments on commit 228b7a6

Please sign in to comment.