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

📄 rf.pl

📁 MMI层OBJ不能完全编译
💻 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 + -