c_tips_and_tricks_for_pic_programming
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
c_tips_and_tricks_for_pic_programming [2008/02/11 13:40] – Bitfields >8bit work! stryd_one | c_tips_and_tricks_for_pic_programming [2008/05/02 16:40] – Updated stryd_one | ||
---|---|---|---|
Line 13: | Line 13: | ||
* The [[http:// | * The [[http:// | ||
* If this is not enough, you could search for ASM optimized custom functions. You'll find some in code examples of TK, the [[ACSensorizer]] and a lot of PIC-Specialized Webpages – or of course the forum. | * If this is not enough, you could search for ASM optimized custom functions. You'll find some in code examples of TK, the [[ACSensorizer]] and a lot of PIC-Specialized Webpages – or of course the forum. | ||
- | * If that still is not enough or you have no time and a lot of processing power / space available on your PIC, you can include the **libsdcc library**: | + | \\ |
- | | + | \\ |
- | >> //if multiplications, | + | |
+ | ==== MIOS LIBSDCC Library ==== | ||
+ | |||
+ | If that still is not enough or you have no time and a lot of processing power / space available on your PIC, you can include the **libsdcc library**. Using the new MIOS GPUtils structure, this will be included automatically as required. | ||
+ | |||
+ | When using the library, sometimes the compiler will optimise multiplications to bitshifts (as demonstrated above) automatically. You can check the output files to see if this has occurred, but it is recommended to code the bitshifts manually, to be sure. | ||
\\ | \\ | ||
- | ====== Bitfields, Unions & Structs | + | |
+ | ==== Bitfields, Unions & Structs ==== | ||
* Avoid using huge int- or char-arrays when you just need to store some ON/OFF values. Use a bitfield instead | * Avoid using huge int- or char-arrays when you just need to store some ON/OFF values. Use a bitfield instead | ||
Line 51: | Line 57: | ||
\\ | \\ | ||
+ | |||
====== C Functions ====== | ====== C Functions ====== | ||
c_tips_and_tricks_for_pic_programming.txt · Last modified: 2011/09/15 07:14 by ichaljhe