mirror of
https://github.com/oliverschmidt/contiki.git
synced 2024-12-22 10:30:13 +00:00
add scripts to help load a bunch of econotags
This commit is contained in:
parent
8b2ef2675d
commit
9f7d860e9c
17
cpu/mc1322x/tools/test-grid/erase-all.pl
Executable file
17
cpu/mc1322x/tools/test-grid/erase-all.pl
Executable file
@ -0,0 +1,17 @@
|
||||
#!/usr/bin/perl
|
||||
use strict;
|
||||
|
||||
my $terms = shift;
|
||||
|
||||
if (! $terms) {
|
||||
print "Usage: num-devices\n";
|
||||
die;
|
||||
}
|
||||
|
||||
for (my $t=0; $t<$terms; $t++) {
|
||||
my $dev_num = 2 * $t + 1;
|
||||
my $ftdi_num = $terms - $t - 1;
|
||||
my $cmd = "bbmc -l redbee-econotag -i $ftdi_num erase &";
|
||||
print "$cmd\n";
|
||||
system($cmd);
|
||||
}
|
18
cpu/mc1322x/tools/test-grid/load-all.pl
Executable file
18
cpu/mc1322x/tools/test-grid/load-all.pl
Executable file
@ -0,0 +1,18 @@
|
||||
#!/usr/bin/perl
|
||||
use strict;
|
||||
|
||||
my $bin = shift;
|
||||
my $terms = shift;
|
||||
|
||||
if (! $terms) {
|
||||
print "Usage: $0 file.bin num-devices\n";
|
||||
die;
|
||||
}
|
||||
|
||||
for (my $t=0; $t<$terms; $t++) {
|
||||
my $dev_num = 2 * $t + 1;
|
||||
my $ftdi_num = $terms - $t - 1;
|
||||
my $cmd = "mc1322x-load.pl -e -f $bin -t /dev/ttyUSB$dev_num -c 'bbmc -l redbee-econotag -i $ftdi_num reset' &";
|
||||
print "$cmd\n";
|
||||
system($cmd);
|
||||
}
|
49
cpu/mc1322x/tools/test-grid/open-terms.pl
Executable file
49
cpu/mc1322x/tools/test-grid/open-terms.pl
Executable file
@ -0,0 +1,49 @@
|
||||
#!/usr/bin/perl
|
||||
|
||||
use strict;
|
||||
use integer;
|
||||
|
||||
my $start = shift;
|
||||
my $end = shift;
|
||||
|
||||
if (! $end) {
|
||||
print "Usage: $0 first-term-num last-term-num\n";
|
||||
die;
|
||||
}
|
||||
|
||||
my $COLS = 4;
|
||||
|
||||
my $index = 0;
|
||||
|
||||
for (my $n=$start; $n <= $end; $n += 2) {
|
||||
#print "$n\n";
|
||||
|
||||
open(OUT, ">/tmp/USB$n.ini");
|
||||
my $dev = "/dev/ttyUSB$n";
|
||||
print OUT <<end
|
||||
set line $dev
|
||||
if failure { exit 1 "Unable top open $dev" }
|
||||
set carrier-watch off
|
||||
set flow-control none
|
||||
set speed 115200
|
||||
set serial 8n1
|
||||
set key \\127 \\8
|
||||
connect
|
||||
quit
|
||||
end
|
||||
;
|
||||
close(OUT);
|
||||
my ($row, $col);
|
||||
$row = $index / $COLS;
|
||||
$col = $index % $COLS;
|
||||
my ($offx, $offy);
|
||||
$offx = $col * 300;
|
||||
$offy = $row * 300;
|
||||
#my $cmd = "xterm -geometry 40x20+$offx+$offy -e 'kermit /tmp/USB$n.ini'&";
|
||||
my $cmd = "xterm -geometry 40x20+$offx+$offy -e 'stty -F /dev/ttyUSB$n 115200 && cat /dev/ttyUSB$n'&";
|
||||
# my $cmd = "xterm -e 'stty -F /dev/ttyUSB$n 115200 && cat /dev/ttyUSB$n'&";
|
||||
print "$cmd\n";
|
||||
system($cmd);
|
||||
|
||||
$index++;
|
||||
}
|
17
cpu/mc1322x/tools/test-grid/reset-all.pl
Executable file
17
cpu/mc1322x/tools/test-grid/reset-all.pl
Executable file
@ -0,0 +1,17 @@
|
||||
#!/usr/bin/perl
|
||||
use strict;
|
||||
|
||||
my $terms = shift;
|
||||
|
||||
if (! $terms) {
|
||||
print "Usage: num-devices\n";
|
||||
die;
|
||||
}
|
||||
|
||||
for (my $t=0; $t<$terms; $t++) {
|
||||
my $dev_num = 2 * $t + 1;
|
||||
my $ftdi_num = $terms - $t - 1;
|
||||
my $cmd = "bbmc -l redbee-econotag -i $ftdi_num reset &";
|
||||
print "$cmd\n";
|
||||
system($cmd);
|
||||
}
|
Loading…
Reference in New Issue
Block a user