??? 10/04/12 09:27 Read: times |
#188571 - I Agree Responding to: ???'s previous message |
I will make all the functions accept a void pointer
void TIMERS_test(void *thingy){ unsigned char *j_ptr; static unsigned char result; //cast the pointer into something that we know we are expecting j_ptr = (unsigned char *)thingy; result = *j_ptr; //grab the value of the pointer result ++; //add one to it *j_ptr = result; //write the result back to the thing pointed to by j_ptr. } My LED Blink was redefined as void MAIN_blink(void *not_used){ RUN_LED = !RUN_LED; } so although I get a warning about not_used being not used, that's fine, everything works. I hadn't thought of it as an RTOS, just a simple method to implement timeouts, retries, interchar timeouts for a serial protocol. Thanks for the comment. Regards Marshall |
Topic | Author | Date |
Timers - Function Pointers | 01/01/70 00:00 | |
Too much for a '51? | 01/01/70 00:00 | |
I Agree | 01/01/70 00:00 | |
Function Pointers... | 01/01/70 00:00 | |
you are violating KISS | 01/01/70 00:00 | |
Various Timer Functions | 01/01/70 00:00 | |
Thanks Michael | 01/01/70 00:00 | |
regardless, you are violating KISS | 01/01/70 00:00 | |
even on ARM | 01/01/70 00:00 | |
The timer simply increments | 01/01/70 00:00 | |
bug | 01/01/70 00:00 | |
more bugs | 01/01/70 00:00 | |
thanks | 01/01/70 00:00 |