Editing BoostC Forum Extracts 2007
Jump to navigation
Jump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 16: | Line 16: | ||
I am not an expert, but I think I have seen compilers that have pragma's that give hints to compiler about these things. | I am not an expert, but I think I have seen compilers that have pragma's that give hints to compiler about these things. | ||
− | + | ---------- | |
− | |||
* From: http://forum.sourceboost.com/index.php?showtopic=3430&pid=12890&mode=threaded&start=#entry12890 | * From: http://forum.sourceboost.com/index.php?showtopic=3430&pid=12890&mode=threaded&start=#entry12890 | ||
Line 31: | Line 30: | ||
"0123456789", quuuux | "0123456789", quuuux | ||
}; | }; | ||
+ | |||
I can create a two dimensional array of strings and initialize them or a array of enums and initialize them but not an array of structs. | I can create a two dimensional array of strings and initialize them or a array of enums and initialize them but not an array of structs. | ||
Line 68: | Line 68: | ||
Found the thread - http://forum.sourceboost.com/index.php?showtopic=3404 | Found the thread - http://forum.sourceboost.com/index.php?showtopic=3404 | ||
− | + | ---------- | |
− | |||
* From: http://forum.sourceboost.com/index.php?showtopic=3440&pid=12882&mode=threaded&start=#entry12882 | * From: http://forum.sourceboost.com/index.php?showtopic=3440&pid=12882&mode=threaded&start=#entry12882 | ||
Line 77: | Line 76: | ||
Prototypes are required if you do a forward reference to a function. If you are in the habit of using them, then always use them. I do. | Prototypes are required if you do a forward reference to a function. If you are in the habit of using them, then always use them. I do. | ||
− | |||
− | |||
** Question 2: | ** Question 2: | ||
Line 89: | Line 86: | ||
If you go to Settings - Options and enable All warnings the compiler will warn you if you exceed 255 for a delay. | If you go to Settings - Options and enable All warnings the compiler will warn you if you exceed 255 for a delay. | ||
− | |||
− | |||
** Question 3: | ** Question 3: | ||
Line 106: | Line 101: | ||
− | |||
------------- | ------------- | ||
* From: http://forum.sourceboost.com/index.php?showtopic=3427&pid=12856&mode=threaded&start=#entry12856 | * From: http://forum.sourceboost.com/index.php?showtopic=3427&pid=12856&mode=threaded&start=#entry12856 | ||
Line 113: | Line 107: | ||
read the post for some info an location of variables in memory, bank switching ..... size and speed. | read the post for some info an location of variables in memory, bank switching ..... size and speed. | ||
− | |||
------------- | ------------- | ||
Line 128: | Line 121: | ||
delay_us(0) results in 0.01ms + (255 * 0.001ms) = 265us | delay_us(0) results in 0.01ms + (255 * 0.001ms) = 265us | ||
− | |||
------------- | ------------- | ||
Line 197: | Line 189: | ||
Russ | Russ | ||
− | |||
+ | ----- | ||
*From: http://forum.sourceboost.com/index.php?showtopic=3404&pid=12741&mode=threaded&start=#entry12741 | *From: http://forum.sourceboost.com/index.php?showtopic=3404&pid=12741&mode=threaded&start=#entry12741 | ||
Line 223: | Line 215: | ||
− | + | ------------- | |
*From: http://forum.sourceboost.com/index.php?showtopic=3403&pid=12735&mode=threaded&start=#entry12735 | *From: http://forum.sourceboost.com/index.php?showtopic=3403&pid=12735&mode=threaded&start=#entry12735 | ||
Line 235: | Line 227: | ||
If you are sure you are handling this situation correctly you can ignore this warning, your code looks like it maybe ok, but this kind of code can be tricky to understand. | If you are sure you are handling this situation correctly you can ignore this warning, your code looks like it maybe ok, but this kind of code can be tricky to understand. | ||
− | + | -------- | |
− | |||
*From: http://forum.sourceboost.com/index.php?showtopic=3269&pid=12715&mode=threaded&start=#entry12715 | *From: http://forum.sourceboost.com/index.php?showtopic=3269&pid=12715&mode=threaded&start=#entry12715 | ||
Yes, this one bit me too! I wrote the following routine that you can use for any ms value from 1 to 65535. I timed it at 60,000 and it seems to be pretty much on the money. | Yes, this one bit me too! I wrote the following routine that you can use for any ms value from 1 to 65535. I timed it at 60,000 and it seems to be pretty much on the money. | ||
− | + | void delayMs(unsigned int ms){ | |
− | + | char i; | |
− | + | char high = ms >> 8; | |
− | + | char low = ms & 0x00ff; | |
− | + | for(i = 0; i < high; i++){ | |
− | + | delay_ms(255); | |
− | + | } | |
− | + | delay_ms(low); | |
− | + | } | |
You might think that it needs another delay_ms(1) in the loop but I got the most accurate time without it. | You might think that it needs another delay_ms(1) in the loop but I got the most accurate time without it. | ||
Line 263: | Line 254: | ||
+ | Use | ||
+ | CODE | ||
+ | ... | ||
+ | lcd_datamode(); | ||
+ | char c, i; | ||
+ | for( i = 0; i < 16; i++ ) | ||
+ | { | ||
+ | c = buffer[i]; | ||
+ | if( c == 0 ) | ||
+ | break; | ||
+ | lcd_write( c ); | ||
+ | } | ||
+ | ... | ||
− | + | Regards | |
− | + | Dave | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
------------- | ------------- | ||
− | * From: http://forum.sourceboost.com/index.php?showtopic=3367&pid=12653&mode=threaded&start=#entry12653 | + | *From: http://forum.sourceboost.com/index.php?showtopic=3367&pid=12653&mode=threaded&start=#entry12653 |
+ | @Pavel: | ||
That's it. Adding -d DEBUG to the compiler options does exactly what I want. | That's it. Adding -d DEBUG to the compiler options does exactly what I want. | ||
Line 290: | Line 285: | ||
------- | ------- | ||
+ | === stop at === | ||
− | + | Counting Optimization (decfsz) | |
− | + | 1 Thompson 409 18th November 2007 - 07:22 PM | |
− | + | Last post by: Pavel | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | ( | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− |