#!/bin/perl

$minpulse = $ARGV[0];
$maxpulse = $ARGV[1];
printf STDERR "minimum pulse duration = %.3f milliseconds\n",$minpulse;
printf STDERR "maximum pulse duration = %.3f milliseconds\n",$maxpulse;

$timercycles = 192;
$i=0;
printf "\t\tDATA\t";
printf "%05Xh",0;

while($i<127)
{
	$i++;
	if (int($i/8) == $i/8)
	{
		printf ";\r\n\t\tDATA\t";
	}
	else
	{
		printf ",";
	}
	$t=$minpulse + ($maxpulse-$minpulse)*($i-1.0)/126.0;
	$v=$t * 10000 / $timercycles;
	$f=int($v);
	printf STDERR "$i \t $f \t %05Xh \t %.2f\n",$f,$t;
	printf "%05Xh",$f;
}
printf ";\r\n";