hextiming.pl

来自「web51的开发库」· PL 代码 · 共 47 行

PL
47
字号
#! /usr/bin/perl##  Insert to .HEX file CPU timing#$verinfo = "1.00";$freqinsert = 0;$freq = -1;sub usage {  print STDERR "usage: $ego -freq VALUE\n";  exit 1;}sub version {  print STDERR "$ego version $verinfo\n";  exit 1;}$ego = $0;$ego =~ s/.*[\/\\]//;while ($ARGV[0] =~ /^-/ && $ARGV[0] ne '-') {    $opt = shift;    if ($opt eq '-freq') {        $opt = shift;        $freq = $opt;    } elsif ($opt eq '-f') {        $opt = shift;        $freq = $opt;    } elsif ($opt eq '-version') {        &version;    } elsif ($opt eq '-help') {        &usage;    } else {        &usage;    }}if ($freq eq -1) { &usage; }while (<>) {  if (/:[0-9A-Fa-f]{6}20.*/)   { if ($freqinsert eq 0) { printf (":01000002%02X%02X\n", $freq, (253 - $freq)); $freqinsert = 1; } }  print;}

⌨️ 快捷键说明

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