File Coverage

blib/lib/VIC/PIC/Functions/Chip.pm
Criterion Covered Total %
statement 21 22 95.4
branch 6 12 50.0
condition 3 7 42.8
subroutine 4 4 100.0
pod 0 1 0.0
total 34 46 73.9


line stmt bran cond sub pod time code
1             package VIC::PIC::Functions::Chip;
2 31     31   19228 use strict;
  31         54  
  31         876  
3 31     31   127 use warnings;
  31         43  
  31         1525  
4             our $VERSION = '0.31';
5             $VERSION = eval $VERSION;
6 31     31   125 use Moo::Role;
  31         47  
  31         221  
7              
8             ##allow adjusting of this based on user input. for now fixed to this
9             #string
10             sub get_chip_config {
11 84     84 0 479 my $self = shift;
12 84         223 my $conf = $self->chip_config;
13 84 50 33     498 return "\n" unless (defined $conf and ref $conf eq 'HASH');
14 84   50     275 my $onoff = $conf->{on_off} || {};
15 84   50     208 my $clkout = $conf->{f_osc} || {};
16 84 50       355 if ($self->pcl_size == 13) {
    0          
17 84         142 my @flags = ();
18 84         336 foreach (keys %$onoff) {
19 588 100       1166 push @flags, "_$_" . ($onoff->{$_} ? '_ON' : '_OFF');
20             }
21 84         226 foreach (keys %$clkout) {
22 84 50       333 push @flags, "_$_" . ($clkout->{$_} ? '_NOCLKOUT' : '_CLKOUT');
23             }
24 84 50       922 return "\t__config (" . join(' & ', sort @flags) . ")\n" if @flags;
25             } elsif ($self->pcl_size == 21) {
26             } else {
27             }
28 0           return "\n";
29             }
30              
31             1;
32             __END__