1
µTasker general / General Comments
« on: December 20, 2008, 08:05:44 PM »
Hi Mark,
I want to thank you for your previous and continuing support. I think uTasker is very promising. I had a few comments about the code that I hope you find useful. I've implemented or will be implementing them in my version of your code:
1) I've added the following to my header files so that I can mix C and C++ code. In addition, I make sure a header file is not included more than once in uTasker:
#ifndef __<HEADER FILE NAME>__
#define __<HEADER FILE NAME>__
#ifdef __cplusplus
extern "C"
{
#endif
<HEADER FILE CODE>
#ifdef __cplusplus
}
#endif
#endif // #ifndef __<HEADER FILE NAME>__
2) uTasker has many many #ifdef directives or its cousins in the code. I found this rather confusing in trying to read the code. Especially in the SAM7X.c file. I've decided to break up files such as the SAM7X.c file into various files. Each of these files will contain one specific part of the system. For example, I am pulling out anything related to the timer peripheral into a file called, tc.cpp; anything related to the PWM controller to another file called, pwmc.cpp (similar to the ATMEL library files - AT91lib). This can be extended to higher level functions in uTasker. Yes, this will create many more files than you have now, but I believe it will eliminate many of the #ifdef directives. A file with a descriptive name is more visible that these directives. Also, instead of commenting in or commenting out a definition for a specific feature of uTasker, you can simply include or not include a file with this feature in a project build.
3) I've added the debug serial port DBGU to my code by modifying uTasker a bit. I can make this available to you if you wish.
4) I've been hoping to see a new service pack for the SAM7 that includes USB support. I plan to write this code if necessary. I can make this available to you as well.
Again, I find uTasker to be a wonderful project and I hope you continue your good work. I just want to be helpful in making it better.
Happy Holidays,
Johnas
I want to thank you for your previous and continuing support. I think uTasker is very promising. I had a few comments about the code that I hope you find useful. I've implemented or will be implementing them in my version of your code:
1) I've added the following to my header files so that I can mix C and C++ code. In addition, I make sure a header file is not included more than once in uTasker:
#ifndef __<HEADER FILE NAME>__
#define __<HEADER FILE NAME>__
#ifdef __cplusplus
extern "C"
{
#endif
<HEADER FILE CODE>
#ifdef __cplusplus
}
#endif
#endif // #ifndef __<HEADER FILE NAME>__
2) uTasker has many many #ifdef directives or its cousins in the code. I found this rather confusing in trying to read the code. Especially in the SAM7X.c file. I've decided to break up files such as the SAM7X.c file into various files. Each of these files will contain one specific part of the system. For example, I am pulling out anything related to the timer peripheral into a file called, tc.cpp; anything related to the PWM controller to another file called, pwmc.cpp (similar to the ATMEL library files - AT91lib). This can be extended to higher level functions in uTasker. Yes, this will create many more files than you have now, but I believe it will eliminate many of the #ifdef directives. A file with a descriptive name is more visible that these directives. Also, instead of commenting in or commenting out a definition for a specific feature of uTasker, you can simply include or not include a file with this feature in a project build.
3) I've added the debug serial port DBGU to my code by modifying uTasker a bit. I can make this available to you if you wish.
4) I've been hoping to see a new service pack for the SAM7 that includes USB support. I plan to write this code if necessary. I can make this available to you as well.
Again, I find uTasker to be a wonderful project and I hope you continue your good work. I just want to be helpful in making it better.
Happy Holidays,
Johnas