diff options
-rwxr-xr-x | bin/dfatool | 2 | ||||
-rw-r--r-- | lib/Kratos/DFADriver.pm | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/bin/dfatool b/bin/dfatool index 58f59d6..ce9224e 100755 --- a/bin/dfatool +++ b/bin/dfatool @@ -16,6 +16,7 @@ my %opt; GetOptions( \%opt, qw{ + baudrate=i class=s exclude-states=s@ ignore-nested-calls @@ -51,6 +52,7 @@ if ( @ARGV < 2 ) { my ( $command, $model_file, @data_files ) = @ARGV; my $driver = Kratos::DFADriver->new( + baud_rate => $opt{baudrate} // 115200, cache => $opt{'no-cache'} ? 0 : 1, class_name => $opt{class}, data_file => $data_files[0], diff --git a/lib/Kratos/DFADriver.pm b/lib/Kratos/DFADriver.pm index dfabef8..07f478c 100644 --- a/lib/Kratos/DFADriver.pm +++ b/lib/Kratos/DFADriver.pm @@ -1138,7 +1138,7 @@ sub launchpad_connect { $self->{port} = Device::SerialPort->new( $self->{port_file} ) or croak("Error openig serial port $self->{port_file}"); - $self->{port}->baudrate(115200); + $self->{port}->baudrate($self->{baud_rate} // 115200); $self->{port}->databits(8); $self->{port}->parity('none'); $self->{port}->read_const_time(500); |