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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
Oliver Sedlacek
10/04/12 02:05
Read: 642 times

#188569 - Too much for a '51?
Responding to: Marshall Brown's previous message
I would avoid functions with variable arguements. Although it can be done in C, the overhead is huge. Have a look at the library source for printf for an example.

I would recommend forcing all functions to take a pointer as an arguemnt allowing you to pass a pointer to anything you like. Casts will be required, so for example the funcion prototypes can all specify void * as their arguement, as in your example.

Re-coding a function that takes no parameters to take a dummy pointer is simple enough.

As this all looks like the underpinnings of RTOS like features, I would look at things like message queues to store the complicated data structures.

List of 13 messages in thread
Timers - Function Pointers      Marshall Brown      10/03/12 21:08      
   Too much for a '51?      Oliver Sedlacek      10/04/12 02:05      
      I Agree      Marshall Brown      10/04/12 03:27      
   Function Pointers...      Andy Neil      10/04/12 05:50      
   you are violating KISS      Erik Malund      10/04/12 08:41      
   Various Timer Functions        Michael Karas      10/06/12 01:14      
      Thanks Michael      Marshall Brown      10/06/12 23:34      
         regardless, you are violating KISS        Erik Malund      10/09/12 07:44      
            even on ARM      Stefan KAnev      10/09/12 13:40      
            The timer simply increments      Marshall Brown      10/11/12 15:58      
               bug      Marshall Brown      10/11/12 16:08      
                  more bugs      Maarten Brock      10/13/12 14:30      
                     thanks      Marshall Brown      10/14/12 13:31      

Back to Subject List