?? rf.pl
字號:
################################################################################
#
# rf.pl
#
# This script creates the file rf.cfg. It contains:
# - the RF value computed from RF_FAM, RF_PG and RF_PA
# - the macros to compute RF_FAM, RF_PG and RF_PA
# The current version of rf.cfg is updated only if there is a modification.
#
# (C) Texas Instruments 2003
#
################################################################################
$output_file = "config/rf.cfg";
$tmp_file = $output_file.".tmp";
$diff_file = "diff.tmp";
$rf_fam = $ARGV[0];
$rf_pg = $ARGV[1];
$rf_pa = $ARGV[2];
# Computation of RF
$rf = (($rf_pa << 10) | ($rf_pg << 7)) | $rf_fam;
# Add definition of RF and ANALOG in a temporary file
open (OUTPUT, ">$tmp_file") or die "Cannot open $output_file";
print OUTPUT "#ifndef __RF_CFG__\n";
print OUTPUT "#define __RF_CFG__\n";
print OUTPUT "#define RF_FAM(rf) ((rf) & 0x007F)\n";
print OUTPUT "#define RF_PG(rf) (((rf) >> 7) & 0x0007)\n";
print OUTPUT "#define RF_PA(rf) (((rf) >> 10) & 0x0007)\n";
print OUTPUT "#define RF $rf\n";
print OUTPUT "#endif /* __RF_CFG__ */\n";
close (OUTPUT);
# If the output file does not exist, the temporary file is copied.
# If the output file exists, it is compared with the temporary file. If
# there is a difference, the temporary file is copied.
if (-e $output_file) {
system ("diff $output_file $tmp_file > $diff_file");
open (INPUT, $diff_file) or die "Cannot open $diff_file";
if (!eof (INPUT)) {
unlink $output_file;
rename ($tmp_file, $output_file);
} else {
unlink $tmp_file;
}
close (INPUT);
unlink $diff_file;
} else {
rename ($tmp_file, $output_file);
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -