embassy-rs / chiptool

Apache License 2.0
37 stars 21 forks source link

allow negative byte offset #26

Closed eZioPan closed 4 months ago

eZioPan commented 4 months ago

allow something like this:

transforms:
  - !ModifyByteOffset
    blocks: ADC_COMMON
    exclude_items: ^CDR$
    add_offset: -768 # 0x300

can output errors (when use with strict: true and do a rerun) like this:

thread 'main' panicked at src/transform/modify_byte_offset.rs:48:13:
Block: ADC_COMMON Item: CSR: byte_offset out of range after modify
Block: ADC_COMMON Item: CCR: byte_offset out of range after modify
Block: ADC_COMMON Item: HWCFGR0: byte_offset out of range after modify
Block: ADC_COMMON Item: VERR: byte_offset out of range after modify
Block: ADC_COMMON Item: IPDR: byte_offset out of range after modify
Block: ADC_COMMON Item: SIDR: byte_offset out of range after modify

note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Notice:

value range of add_offset from u32 to i32