Skip to content

Commit 3d58269

Browse files
committed
check only when in same peripheral
1 parent da15115 commit 3d58269

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/patch/device.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -297,8 +297,11 @@ impl DeviceExt for Device {
297297
} else {
298298
return Err(anyhow!("derive: incorrect syntax for {}", pname));
299299
};
300-
self.get_peripheral(pderive)
301-
.ok_or_else(|| anyhow!("peripheral {} not found", pderive))?;
300+
301+
if !pderive.contains('.') {
302+
self.get_peripheral(pderive)
303+
.ok_or_else(|| anyhow!("peripheral {} not found", pderive))?;
304+
}
302305

303306
match self.get_mut_peripheral(pname) {
304307
Some(peripheral) => peripheral.modify_from(info, VAL_LVL)?,

src/patch/peripheral.rs

+1
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,7 @@ impl PeripheralExt for Peripheral {
377377
} else {
378378
return Err(anyhow!("derive: incorrect syntax for {}", rname));
379379
};
380+
380381
self.get_register(rderive)
381382
.ok_or_else(|| anyhow!("register {} not found", rderive))?;
382383

0 commit comments

Comments
 (0)