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   18939 use strict;
  31         43  
  31         852  
3 31     31   112 use warnings;
  31         45  
  31         1398  
4             our $VERSION = '0.29';
5             $VERSION = eval $VERSION;
6 31     31   108 use Moo::Role;
  31         43  
  31         217  
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 466 my $self = shift;
12 84         216 my $conf = $self->chip_config;
13 84 50 33     504 return "\n" unless (defined $conf and ref $conf eq 'HASH');
14 84   50     272 my $onoff = $conf->{on_off} || {};
15 84   50     225 my $clkout = $conf->{f_osc} || {};
16 84 50       365 if ($self->pcl_size == 13) {
    0          
17 84         151 my @flags = ();
18 84         341 foreach (keys %$onoff) {
19 588 100       1237 push @flags, "_$_" . ($onoff->{$_} ? '_ON' : '_OFF');
20             }
21 84         234 foreach (keys %$clkout) {
22 84 50       322 push @flags, "_$_" . ($clkout->{$_} ? '_NOCLKOUT' : '_CLKOUT');
23             }
24 84 50       929 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__