summaryrefslogtreecommitdiff
path: root/lib/Kratos/DFADriver.pm
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2017-04-20 09:04:28 +0200
committerDaniel Friesel <derf@finalrewind.org>2017-04-20 09:04:28 +0200
commitd0e6b9602d516e9d6310803e9c273cc74006fe39 (patch)
tree8839477d7a2de3027e64ab90bca41f61423bba2d /lib/Kratos/DFADriver.pm
parentebca0359b68fd7f82590d3334a5239bbc8c7d46f (diff)
support both logTransition (with trace logging) and passTransition (accounting only)
Diffstat (limited to 'lib/Kratos/DFADriver.pm')
-rw-r--r--lib/Kratos/DFADriver.pm7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/Kratos/DFADriver.pm b/lib/Kratos/DFADriver.pm
index 83a572f..432d0e5 100644
--- a/lib/Kratos/DFADriver.pm
+++ b/lib/Kratos/DFADriver.pm
@@ -670,6 +670,7 @@ sub to_ah {
my $ignore_nested = q{};
my $adv_type = 'execution';
+ my $pass_function = $self->{logging} ? 'logTransition' : 'passTransition';
if ( $self->{ignore_nested} ) {
$adv_type = 'call';
@@ -686,8 +687,6 @@ sub to_ah {
#include "drivers/eUSCI_A/uart/prototype_uart.h"
#include "${class_header}"
-pointcut InnerTransition() = execution("% ${class_name}::%(...)");
-
EOF
if ( defined $trigger_port and defined $trigger_pin ) {
@@ -752,7 +751,7 @@ EOF
$ah_buf .= <<"EOF";
advice ${adv_type}("% ${class_name}::$transition->{name}(...)") ${ignore_nested} : after() {
- tjp->target()->passTransition(${class_name}::statepower[tjp->target()->state],
+ tjp->target()->${pass_function}(${class_name}::statepower[tjp->target()->state],
$transition->{rel_energy_prev}{static}, $transition->{id},
${dest_state_id});
};
@@ -763,7 +762,7 @@ EOF
$ah_buf .= <<"EOF";
advice execution("% ${class_name}::$transition->{name}(...)") : after() {
- tjp->target()->passTransition(${class_name}::statepower[tjp->target()->state],
+ tjp->target()->${pass_function}(${class_name}::statepower[tjp->target()->state],
$transition->{rel_energy_prev}{static}, $transition->{id},
${dest_state_id});
};