ROBOTC.net forums
http://www.robotc.net/forums/

Developer Packages
http://www.robotc.net/forums/viewtopic.php?f=1&t=6485
Page 2 of 2

Author:  roboRed [ Tue Aug 06, 2013 10:24 pm ]
Post subject:  Re: Developer Packages

Nice, and the Libraries folder is the one you're referring too, right? And when do you think it will be complete? :-) :D :o

Author:  Ernest3.14 [ Tue Aug 06, 2013 11:28 pm ]
Post subject:  Re: Developer Packages

You can never finish anything :) It'll be reasonably complete before kickoff, Sept. 7th.

Author:  MHTS [ Wed Aug 07, 2013 3:55 am ]
Post subject:  Re: Developer Packages

Ernest3.14 wrote:

That was 2012's code. 2013 code is here:

http://proj.titanrobotics.net/hg/Ftc/20 ... 6218f40e81

Author:  MHTS [ Wed Aug 07, 2013 4:12 am ]
Post subject:  Re: Developer Packages

Ernest3.14 wrote:
You can never finish anything :) It'll be reasonably complete before kickoff, Sept. 7th.

May I make a suggestion? Most of the functions in your library are renaming RobotC intrinsic functions. For those you may consider using macros instead. For example:
Code:
void Time_Wait(int milliseconds) {
   wait1Msec(milliseconds);
}
void Time_Sleep(int milliseconds) {
   Sleep(milliseconds);
}

// You may want to define macros instead:
#define Time_Wait(ms)    wait1Msec(ms)
#define Time_Sleep(ms)   Sleep(ms)

You may not realize, RobotC has a limit on the number of functions. The limit on the new version is fairly big but it can still run out. But wrapping a lot of intrinsic functions with different names will waste a lot of slots in the function table. Besides, calling a function that in turns calling an intrinsic function is very inefficient. You can achieve the same effect with the above macros.

Author:  Ernest3.14 [ Wed Aug 07, 2013 1:50 pm ]
Post subject:  Re: Developer Packages

MHTS wrote:
May I make a suggestion? Most of the functions in your library are renaming RobotC intrinsic functions. For those you may consider using macros instead.

-snip-

You may not realize, RobotC has a limit on the number of functions. The limit on the new version is fairly big but it can still run out. But wrapping a lot of intrinsic functions with different names will waste a lot of slots in the function table. Besides, calling a function that in turns calling an intrinsic function is very inefficient. You can achieve the same effect with the above macros.


Heh, I was using `inline`, until I noticed RobotC doesn't support that. Thanks for the heads up about function limits and macros. The C++ programmer in me is complaining about type checking though :shock:

Author:  MHTS [ Wed Aug 07, 2013 2:37 pm ]
Post subject:  Re: Developer Packages

Ernest3.14 wrote:
Heh, I was using `inline`, until I noticed RobotC doesn't support that. Thanks for the heads up about function limits and macros. The C++ programmer in me is complaining about type checking though :shock:

Since the macros will be expanded to the corresponding RobotC Intrinsic functions, you still get type checking through the intrinsic function prototypes.

Author:  Ernest3.14 [ Wed Aug 07, 2013 2:38 pm ]
Post subject:  Re: Developer Packages

Ok. Thanks! Do you know what the limit on the number of functions is? I don't want to rewrite stuff if I don't have to ;)

Author:  MHTS [ Wed Aug 07, 2013 2:45 pm ]
Post subject:  Re: Developer Packages

Ernest3.14 wrote:
Ok. Thanks! Do you know what the limit on the number of functions is? I don't want to rewrite stuff if I don't have to ;)

I don't remember. I exceeded their limit a few years back with our library. So they increased it and I forgot how much they increased it. I think it is at least a couple hundreds.

Author:  mightor [ Wed Aug 07, 2013 4:13 pm ]
Post subject:  Re: Developer Packages

I just asked and it's around 256 or so.

= Xander

Author:  roboRed [ Wed Aug 07, 2013 7:18 pm ]
Post subject:  Re: Developer Packages

MHTS wrote:
Ernest3.14 wrote:

That was 2012's code. 2013 code is here:

http://proj.titanrobotics.net/hg/Ftc/20 ... 6218f40e81


THanks a lot! :) :)

Page 2 of 2 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/