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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
10/27/11 16:21
Read: times


 
#184393 - why change pointer to CODE?
Responding to: ???'s previous message
Why change the pointer to a type of CODE?
It makes my code bigger (by the sizeof the struct by the looks)




struct strct_running_recipe {
    CODE struct recipe *recipe_in_flash;
    unsigned int recipe_elapsed_time;
    unsigned int rule_elapsed_time[NUM_OF_RULES_PER_RECIPE];    //hold variable for the elapsed time in a rule
    unsigned char rule_holding_var[NUM_OF_RULES_PER_RECIPE];
    unsigned char rule_active[NUM_OF_RULES_PER_RECIPE];
};


 




I have broken my file into a seperate header and source now, as it was becoming a bit unwieldly (spelling?)

http://www.8052.com/users/marshallbrown

Also the current_recipe has become global as I need it for testing the recipe_inProgress flag in a minute_tick() elsewhere in my application the file globals.c defines this variable.

Feel free to peruse it. not sure if it got uglier or tidier with all the enums, at the moment there is absolutely no advantage in me using them over a #define as the compiler that I use does not warn on them, it does make it marginally easier to read.

Regards

Marshall

List of 23 messages in thread
TopicAuthorDate
User entered recipes ???            01/01/70 00:00      
   Just create array of regular rules            01/01/70 00:00      
      Thanks - that's great            01/01/70 00:00      
         programming language            01/01/70 00:00      
            programming language - not really            01/01/70 00:00      
               consider enum            01/01/70 00:00      
                  thanks - implemented.            01/01/70 00:00      
                     Intelligence            01/01/70 00:00      
                        I must have a stupid compiler            01/01/70 00:00      
                           Not all compilers are as good at generate warnings            01/01/70 00:00      
                              no warning/error on the compiler            01/01/70 00:00      
                                 response from Raisonance            01/01/70 00:00      
                  enumerations on 8051            01/01/70 00:00      
                     enums are 8bit by default on Raisonance            01/01/70 00:00      
                        NULL            01/01/70 00:00      
                           Could you show me the code            01/01/70 00:00      
                              compatibility et al            01/01/70 00:00      
                                 why change pointer to CODE?            01/01/70 00:00      
                                    enum advantage            01/01/70 00:00      
                                    user page does not work (at least for me)            01/01/70 00:00      
                                       try it now            01/01/70 00:00      
                     re: enumerations on 8051            01/01/70 00:00      
   Article on Hierarchical Menu Structure            01/01/70 00:00      

Back to Subject List