VIC/PIC/Functions/Chip.pm

filter: Statementstmt 96.0% 24 / 25 Branchbran 50.0% 6 / 12 Conditioncond 42.8% 3 / 7 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 100% 4 / 4 Podpod 0.0% 0 / 1 totaltotal 69.8% 37 / 53 CC 12 SCAR 26.7
CC
12
Cov
75%
get_chip_config
17.8
BEGIN
1.0
BEGIN
1.0
CRAP 14.5
« VIC/PIC/Functions/ADC.pm ↑ Summary VIC/PIC/Functions/ECCP.pm »
1 package VIC::PIC::Functions::Chip;
2 31 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 31 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 31 our $VERSION = '0.32';
5 31 $VERSION = eval $VERSION;
6 31 ▶use Moo::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 ##allow adjusting of this based on user input. for now fixed to this
9 #string
10 84 ▶sub get_chip_config {
Subroutine get_chip_config: called CC=12 SCAR=28.8
Pod undocumented
11 84 my $self = shift;
12 84 my $conf = $self->chip_config;
13 84 ▶ return "\n" unless (defined $conf and ref $conf eq 'HASH');
Branch: 1 branch
BranchTrueFalseTotal
unless defined $conf and ref $conf eq "HASH" 0 84 84
Condition33%1/3
defined $conf and ref $conf eq "HASH"
!ll&&!rl&&r
0084
MC/DC0%0/2
defined $conf and ref $conf eq "HASH"
defined $conf ref $conf eq "HASH"
Truth table33%1/3
A and B
A= defined $confB= ref $conf eq "HASH"
ABresult
0X0
100
111
14 84 ▶ my $onoff = $conf->{on_off} || {};
Condition50%1/2
$conf->{'on_off'} || {}
l!l
840
MC/DC0%0/1
$conf->{'on_off'} || {}
$conf->{'on_off'}
Truth table50%1/2
A
A= $conf->{'on_off'}
Aresult
11
00
15 84 ▶ my $clkout = $conf->{f_osc} || {};
Condition50%1/2
$conf->{'f_osc'} || {}
l!l
840
MC/DC0%0/1
$conf->{'f_osc'} || {}
$conf->{'f_osc'}
Truth table50%1/2
A
A= $conf->{'f_osc'}
Aresult
11
00
16 84 ▶ if ($self->pcl_size == 13) {
Branch: 2 branches
BranchTrueFalseTotal
if ($self->pcl_size == 13) { } 84 0 84
elsif ($self->pcl_size == 21) { } 0 0 0
17 84 my @flags = ();
18 84 foreach (keys %$onoff) {
19 588 ▶ push @flags, "_$_" . ($onoff->{$_} ? '_ON' : '_OFF');
Branch: 1 branch
BranchTrueFalseTotal
$onoff->{$_} ? : 4 584 588
20 }
21 84 foreach (keys %$clkout) {
22 84 ▶ push @flags, "_$_" . ($clkout->{$_} ? '_NOCLKOUT' : '_CLKOUT');
Branch: 1 branch
BranchTrueFalseTotal
$clkout->{$_} ? : 0 84 84
23 }
24 84 ▶ return "\t__config (" . join(' & ', sort @flags) . ")\n" if @flags;
Branch: 1 branch
BranchTrueFalseTotal
if @flags 84 0 84
25 } elsif ($self->pcl_size == 21) {
26 } else {
27 }
28 0 return "\n";
29 }
30  
31 31 1;
32 __END__
« VIC/PIC/Functions/ADC.pm ↑ Summary VIC/PIC/Functions/ECCP.pm »