![]() |
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. |
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. |
Re: Space Limit--What is expendable?
Quote:
|
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. |
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. |
| All times are GMT -5. The time now is 19:51. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi