From 0c9428113eb08caff8821e4ac4b89c10d912c624 Mon Sep 17 00:00:00 2001 From: Jan Michel Date: Fri, 19 Jul 2013 17:20:15 +0200 Subject: [PATCH] writeram via libtrbnet for debugging --- soft/toolbox/jtag_atomic/ui_writeram.pl | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/soft/toolbox/jtag_atomic/ui_writeram.pl b/soft/toolbox/jtag_atomic/ui_writeram.pl index dfde2dc..180bd91 100755 --- a/soft/toolbox/jtag_atomic/ui_writeram.pl +++ b/soft/toolbox/jtag_atomic/ui_writeram.pl @@ -67,7 +67,17 @@ my $string = " \t Hello world! "; #print trim($string)."\n"; #print ltrim($string)."\n"; #print rtrim($string)."\n"; - +sub any2dec { # converts numeric expressions 0x, 0b or decimal to decimal + + my $argument = $_[0]; + #print "any2dec input argument $argument\n"; + + if ( $argument =~ m/0[bxBX]/) { + return oct $argument; + } else { + return $argument; + } +} # Perl trim function to remove whitespace from the start and end of the string sub trim($) { -- 2.43.0