|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#16
|
|||
|
|||
|
Re: Space Limit--What is expendable?
Quote:
Ah, correct on that one. The reason i put -127 is it correctly centers it every time, and i have a cleaning function run that basically limits the pwm values before hand, so 254 is the max necessary. The other thing you could do would be to use INT's, which allows a large amount more of integer mathematics, another thing my team found necessary. |
|
#17
|
|||
|
|||
|
Re: Space Limit--What is expendable?
Quote:
x=(condition1 ? 1 : (condition2 ? 2 : (condition3 ? 3 : ...(condition n ? n : 0)...)) also a range of case statements cannot be used as in PBasic however the following is a way to simulate this. switch(statement) { case 1: case 2: case 3: doSomething(); break; case 4: case 5: case 6: doSomethingElse(); }break; However this would not be practical for a very large range of values. Also, if the compiler compiles the sane way as the C compiler I have studied, a switch/case statement uses up more code space than if/else statements, especially when there is a large range of skipped values such as. .. switch(statement) { case 1: doSomething(); break; case 1000000: doSomethingElse(); }break; Switch/case statements are quicker than several if/else statements though because it jumps to a calculated address rather than having to make many comparisons, but this will not be noticeable if there are only a few choices. Last edited by josh_johnson : 02-12-2003 at 17:06. Reason: fixed formatting |
|
#18
|
||||
|
||||
|
Re: Space Limit--What is expendable?
Quote:
|
|
#19
|
|||
|
|||
|
Re: Space Limit--What is expendable?
Quote:
I did a few things that helped me save a huge amount of space. 1- I reverted to completely integer mathematics, as opposed to floating point mathematics, which are horrid! 2- got rid of all unnecessary portions of the default code. That removed a large amount of the space (about 12% of our programming memory!), and left a good amount of the programming to me instead of some default setup. 3- Got rid of that printf library. It is easily the worst written print library i have seen in ages. Instead, my team is using the printword and printbyte and etc library in the utilities. You guys have been a great help, keep the good posts comming. |
|
#20
|
|||||
|
|||||
|
Re: Space Limit--What is expendable?
The IFI_Loader will also give you the space used.
Just hit return when IFI_Loader is active and you'll get a report in the bottom message bar. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| St. Louis anyone? | Jeremy_Mc | Regional Competitions | 8 | 07-02-2003 12:06 |
| Slightly humorous story about global warming & space explor. | archiver | 2001 | 3 | 24-06-2002 04:01 |
| The 'Big Picture' regarding regional space.. | archiver | 2000 | 1 | 23-06-2002 23:58 |
| KSC Results | archiver | 2000 | 2 | 23-06-2002 22:19 |
| CD forum don't have space for more pictures? | Ken Leung | General Forum | 7 | 10-04-2002 23:41 |