Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
Marshall Brown
10/25/11 02:23
Read: 535 times
Hamilton
New Zealand


 
#184353 - thanks - implemented.
Responding to: Per Westermark's previous message
Implemented - it does look nicer. Thanks for the feedback.

Some questions.
1/ I'm unsure of the advantage of having it compiled or preprocessed (who cares?)

2/ Why would I limit the #define use to mapping macros, functions etc?
this would seem perfectly legit.

#define NUM_OF_RULES_PER_RECIPE 10


I explicitly init'd the enums as I personally find it easier to remember then, and also if I change the start index, it still looks clear.

typedef enum {
    actionEmpty = 0,
    actionOn,
    actionOff,
    actionRegulate,
    actionPulse
} recipe_action;

typedef enum {
    startEmpty = 0,
    startAbsolute,
    startPriorRule,
    startAnyRule
} recipe_start;

typedef enum {
    feedbackEmpty = 0, 
    feedbackExternalIO,
    feedbackTimeOn, 
    feedbackTimeOff 
} recipe_feedback;

typedef enum {
    progressNotStarted = 0,
    progressInProgress,
    progressCompleted
} recipe_progress;


struct strct_rules{
    unsigned char out_point;
    recipe_action action;
    recipe_start start_condition;
    unsigned char start_time;
    unsigned char stop_time;
    recipe_feedback feedback_rule;
    unsigned char feedback_point;
};




 

Regards
Marshall

List of 23 messages in thread
TopicAuthorDate
User entered recipes ???      Marshall Brown      10/24/11 13:35      
   Just create array of regular rules      Per Westermark      10/24/11 15:30      
      Thanks - that's great      Marshall Brown      10/24/11 17:35      
         programming language      Jan Waclawek      10/25/11 00:55      
            programming language - not really      Marshall Brown      10/25/11 01:21      
               consider enum        Per Westermark      10/25/11 01:48      
                  thanks - implemented.      Marshall Brown      10/25/11 02:23      
                     Intelligence      Per Westermark      10/25/11 02:34      
                        I must have a stupid compiler      Marshall Brown      10/25/11 03:05      
                           Not all compilers are as good at generate warnings      Per Westermark      10/25/11 03:28      
                              no warning/error on the compiler      Marshall Brown      10/25/11 03:55      
                                 response from Raisonance      Marshall Brown      10/27/11 09:51      
                  enumerations on 8051      Andy Peters      10/25/11 12:14      
                     enums are 8bit by default on Raisonance      Marshall Brown      10/25/11 12:42      
                        NULL      Jan Waclawek      10/26/11 04:08      
                           Could you show me the code      Marshall Brown      10/26/11 13:49      
                              compatibility et al      Jan Waclawek      10/27/11 04:15      
                                 why change pointer to CODE?      Marshall Brown      10/27/11 10:21      
                                    enum advantage      Michael Karas      10/27/11 11:18      
                                    user page does not work (at least for me)      Jan Waclawek      10/28/11 15:26      
                                       try it now      Marshall Brown      10/30/11 17:08      
                     re: enumerations on 8051      Andy Peters      11/01/11 15:22      
   Article on Hierarchical Menu Structure      Aubrey Kagan      11/02/11 09:42      

Back to Subject List