fix blinky example to use cmp_eq instead of ==
This commit is contained in:
parent
5707ede2ae
commit
79031ccf88
|
@ -2,7 +2,7 @@ use clap::Parser;
|
|||
use fayalite::{
|
||||
clock::{Clock, ClockDomain},
|
||||
hdl_module,
|
||||
int::{DynUInt, DynUIntType, IntTypeTrait, UInt},
|
||||
int::{DynUInt, DynUIntType, IntCmp, IntTypeTrait, UInt},
|
||||
reset::{SyncReset, ToReset},
|
||||
};
|
||||
|
||||
|
@ -24,8 +24,8 @@ fn blinky(clock_frequency: u64) {
|
|||
#[hdl]
|
||||
let output_reg: UInt<1> = m.reg_builder().clock_domain(cd).reset_default();
|
||||
#[hdl]
|
||||
if counter == int_ty.literal(max_value) {
|
||||
m.connect(counter, int_ty.literal(0));
|
||||
if counter.cmp_eq(max_value) {
|
||||
m.connect_any(counter, 0u8);
|
||||
m.connect(output_reg, !output_reg);
|
||||
} else {
|
||||
m.connect_any(counter, counter + 1_hdl_u1);
|
||||
|
|
Loading…
Reference in a new issue