⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 srecswap.pl

📁 at91的一个bootloader
💻 PL
字号:
#!/usr/bin/perl

# endian-swap S records; we need this because the JTAG tools we're using
# expect the memory image in byte-swapped format
#
# Jonathan Westhues, April 2004

if(@ARGV == 0) {
    die "usage: $0 file-to-endian-swap.s19 > out.s19\n";
}

while(<>) {
    chomp;

    if(/^S0/) {
        next;
    }
    if(/^S7/) {
        print "$_\n";
        next;
    }

    if(not /^S3(..)(........)(.*)(..)$/) {
        die "bad S record at line $.\n";
    }

    $data = $3;
    $checksum = $4;

    print "S3$1$2";
    while($data =~ m#(..)(..)(..)(..)#g) {
        print "$4$3$2$1";
    }
    print "$checksum\n";
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -