| line | stmt | bran | cond | sub | pod | time | code | 
| 1 |  |  |  |  |  |  | package VIC::PIC::Functions::Chip; | 
| 2 | 31 |  |  | 31 |  | 18911 | use strict; | 
|  | 31 |  |  |  |  | 93 |  | 
|  | 31 |  |  |  |  | 869 |  | 
| 3 | 31 |  |  | 31 |  | 165 | use warnings; | 
|  | 31 |  |  |  |  | 64 |  | 
|  | 31 |  |  |  |  | 1432 |  | 
| 4 |  |  |  |  |  |  | our $VERSION = '0.32'; | 
| 5 |  |  |  |  |  |  | $VERSION = eval $VERSION; | 
| 6 | 31 |  |  | 31 |  | 1381 | use Moo::Role; | 
|  | 31 |  |  |  |  | 62 |  | 
|  | 31 |  |  |  |  | 185 |  | 
| 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 | 448 | my $self = shift; | 
| 12 | 84 |  |  |  |  | 239 | my $conf = $self->chip_config; | 
| 13 | 84 | 50 | 33 |  |  | 438 | return "\n" unless (defined $conf and ref $conf eq 'HASH'); | 
| 14 | 84 |  | 50 |  |  | 288 | my $onoff = $conf->{on_off} || {}; | 
| 15 | 84 |  | 50 |  |  | 224 | my $clkout = $conf->{f_osc} || {}; | 
| 16 | 84 | 50 |  |  |  | 312 | if ($self->pcl_size == 13) { | 
|  |  | 0 |  |  |  |  |  | 
| 17 | 84 |  |  |  |  | 177 | my @flags = (); | 
| 18 | 84 |  |  |  |  | 366 | foreach (keys %$onoff) { | 
| 19 | 588 | 100 |  |  |  | 1429 | push @flags, "_$_" . ($onoff->{$_} ? '_ON' : '_OFF'); | 
| 20 |  |  |  |  |  |  | } | 
| 21 | 84 |  |  |  |  | 252 | foreach (keys %$clkout) { | 
| 22 | 84 | 50 |  |  |  | 299 | push @flags, "_$_" . ($clkout->{$_} ? '_NOCLKOUT' : '_CLKOUT'); | 
| 23 |  |  |  |  |  |  | } | 
| 24 | 84 | 50 |  |  |  | 1011 | 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__ |