From 0f6a39917ea24fcf5cf12e01b7e4b466c91fd30e Mon Sep 17 00:00:00 2001 From: "Jan N. Bader" Date: Fri, 28 Jul 2023 15:54:08 +0200 Subject: [PATCH] corrected typos and missing import specifications --- moku_pattern_gen.pl | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/moku_pattern_gen.pl b/moku_pattern_gen.pl index 21166da..e90d94d 100644 --- a/moku_pattern_gen.pl +++ b/moku_pattern_gen.pl @@ -2,8 +2,8 @@ use strict; use warnings; #use Cwd; -use Math::Round; # for round() -use List::Util; # for max @list +use Math::Round; # for round() +use List::Util qw(max); # for max @list ### configure the pattern here ### my $divider = 1; # configured freq divieder @@ -15,12 +15,12 @@ my $recovery_time = 100; # safety buffer between Rx and pulse in [ns] ################################## ### these are given or computed parameters ### -my $base_freq = 125 000 000; # sample freq of moku:GO -my $base_cliq = 8; # sample periode in ns -my $max_cliqs = 32764; # max sample length +my $base_freq = 125000000; # sample freq of moku:GO +my $base_cliq = 8; # sample periode in ns +my $max_cliqs = 32764; # max sample length my @pins = (1,2,3,4,5,6); -my @pin_names = ("LS1", "LS2", "HS", "SS", "LSS", "Rx") +my @pin_names = ("LS1", "LS2", "HS", "SS", "LSS", "Rx"); $base_cliq *= $divider; my $baudrate = round($base_freq/$divider); @@ -37,7 +37,7 @@ sub remainder { ############################################################ ### create outfile in output directory sorted by sampling frequency ### -my $dirname = 'CODE-AFE_pattern'.sprintf("%.0f", $baud_rate).'MHz'; +my $dirname = 'CODE-AFE_pattern'.sprintf("%.0f", $baudrate).'MHz'; my $filename = 'CODE-AFE_pattern'.sprintf("%.0f", $sig_freq).'MHz.csv'; mkdir($dirname, 0777); open(MYOUTFILE, '>>./'.$dirname.'/'.$filename); @@ -47,7 +47,7 @@ open(MYOUTFILE, '>>./'.$dirname.'/'.$filename); foreach my $iterator (@pins) { print MYOUTFILE "Pin "; print MYOUTFILE $iterator; - if ($iterator != max @pins) { + if ($iterator != max(@pins)) { print MYOUTFILE '; '; } }