Skip to content

Commit

Permalink
Fix comment, don't preserve bad value
Browse files Browse the repository at this point in the history
  • Loading branch information
AlyoshaVasilieva authored and mciantyre committed Nov 17, 2020
1 parent 7470642 commit c697e69
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion imxrt-hal/src/trng.rs
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ impl TRNG {
let retry_count = read_reg!(trng, self.reg, SCMISC, RTY_CT);
let mut unclocked = Unclocked::new(self.reg);
unclocked.sample_mode = SampleMode::try_from_reg(sample_mode).unwrap_or_default();
unclocked.retry_count = retry_count; // RTY_CT is 4 bits, all values valid
unclocked.retry_count = retry_count.max(1); // RTY_CT is 4 bits, 0 is invalid
modify_reg!(ral::ccm, ccm, CCGR6, CG6: 0); // disable trng clock
unclocked
}
Expand Down

0 comments on commit c697e69

Please sign in to comment.