merged heads sync
authorKrista 'DarthMama' Bennett <krista@pep.foundation>
Tue, 09 Jul 2019 12:54:10 +0200
branchsync
changeset 3922a2ebf83845c9
parent 3921 f8d3301d3c5e
parent 3913 4868b1702198
child 3923 75bd39e465af
child 3924 a361d47fe7be
child 3929 408594db81f1
merged heads
     1.1 --- a/sync/gen_statemachine.ysl2	Tue Jul 09 12:53:33 2019 +0200
     1.2 +++ b/sync/gen_statemachine.ysl2	Tue Jul 09 12:54:10 2019 +0200
     1.3 @@ -1046,8 +1046,10 @@
     1.4  
     1.5          // state machine
     1.6  
     1.7 +        #ifndef NDEBUG
     1.8          const char *«@name»_state_name(int state);
     1.9          const char *«@name»_event_name(int event);
    1.10 +        #endif
    1.11  
    1.12          // the state machine function is returning the next state in case of a
    1.13          // transition or None for staying
    1.14 @@ -1073,6 +1075,9 @@
    1.15          #include "«@name»_fsm.h"
    1.16          #include <stdlib.h>
    1.17  
    1.18 +        #ifdef NDEBUG
    1.19 +        static
    1.20 +        #endif
    1.21          const char *«@name»_state_name(int state)
    1.22          {
    1.23              switch (state) {
    1.24 @@ -1093,6 +1098,9 @@
    1.25              }
    1.26          }
    1.27  
    1.28 +        #ifdef NDEBUG
    1.29 +        static
    1.30 +        #endif
    1.31          const char *«@name»_event_name(int event)
    1.32          {
    1.33              switch (event) {
    1.34 @@ -1158,7 +1166,7 @@
    1.35              switch (state) {
    1.36                  `` apply "state", 2, mode=fsm
    1.37                  default:
    1.38 -                    «@name»_ERR_LOG_INT("invalid state", state);
    1.39 +                    «@name»_ERR_LOG("invalid state", «@name»_state_name(state));
    1.40                      return invalid_state;
    1.41              }
    1.42