Fix kasli_soc-demo compilation error with cfg #250
|
@ -310,6 +310,7 @@ class GenericMaster(SoCCore):
|
|||
self.add_csr_group("grabber", self.grabber_csr_group)
|
||||
|
||||
|
||||
self.rustc_cfg["has_virtual_leds"] = None
|
||||
self.submodules.virtual_leds = virtual_leds.VirtualLeds()
|
||||
self.csr_devices.append("virtual_leds")
|
||||
|
||||
|
@ -482,6 +483,7 @@ class GenericSatellite(SoCCore):
|
|||
self.add_csr_group("grabber", self.grabber_csr_group)
|
||||
# no RTIO CRG here
|
||||
|
||||
self.rustc_cfg["has_virtual_leds"] = None
|
||||
self.submodules.virtual_leds = virtual_leds.VirtualLeds()
|
||||
self.csr_devices.append("virtual_leds")
|
||||
|
||||
|
|
|
@ -152,6 +152,7 @@ impl IoExpander {
|
|||
}
|
||||
|
||||
pub fn service(&mut self, i2c: &mut i2c::I2c) -> Result<(), &'static str> {
|
||||
#[cfg(has_virtual_leds)]
|
||||
for (led, port, bit) in self.virtual_led_mapping.iter() {
|
||||
let level = unsafe { csr::virtual_leds::status_read() >> led & 1 };
|
||||
self.set(*port, *bit, level != 0);
|
||||
|
|
Loading…
Reference in New Issue