View unanswered posts | View active topics It is currently Sat Apr 19, 2014 10:15 pm






Reply to topic  [ 7 posts ] 
`void TaskID` data type 
Author Message
Professor
User avatar

Joined: Sat May 18, 2013 1:24 pm
Posts: 272
Location: Olympia, WA
Post `void TaskID` data type
What does "void" mean as a data type? I know what a "void" function is, but what does it mean when used as the name for a task? Is it just a string? :? Or is it a "void pointer", in which case I can treat it as a string?
http://www.robotc.net/wiki/NXT_Function ... #StartTask

On a slightly related note, is there a way to "fetch" the current task's ID? Line 274* of RobotCIntrinsics.c defines an `nCurrentTask`. Is this what I was looking for? Can I cast it to a "void" and pass it to the task-related functions?

*: I'm using RobotC 3.60 due to some weird bugs, so this might not be correct. It's in the section "Read only operating system parameters".

_________________
FTC Team 6424, the 'Oly Cow - Chief programmer.
FRC Team 4450, Olympia Robotics Federation (ORF).

and also quadrotors. Quadrotors!


Last edited by Ernest3.14 on Thu Aug 01, 2013 6:59 pm, edited 1 time in total.



Thu Aug 01, 2013 6:40 pm
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3105
Location: Rotterdam, The Netherlands
Post Re: `void TaskID` data type
void means nothing. A void pointer is a pointer to a memory location of an unspecified type. A function with a void return type, returns nothing.

= Xander

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]


Fri Aug 02, 2013 4:23 am
Profile WWW
Professor
User avatar

Joined: Sat May 18, 2013 1:24 pm
Posts: 272
Location: Olympia, WA
Post Re: `void TaskID` data type
But, but... What does "void StartTask(void TaskID, const short nTaskPriority)" mean? :?
http://www.robotc.net/wiki/NXT_Function ... #StartTask

_________________
FTC Team 6424, the 'Oly Cow - Chief programmer.
FRC Team 4450, Olympia Robotics Federation (ORF).

and also quadrotors. Quadrotors!


Fri Aug 02, 2013 4:00 pm
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3105
Location: Rotterdam, The Netherlands
Post Re: `void TaskID` data type
"void taskID" is the name of the task that you specified in your program:
Code:
task foo()
{
  // do something
}

task main()
{
  // Start task "foo"
  StartTask(foo);
}


= Xander

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]


Sat Aug 03, 2013 2:02 am
Profile WWW
Professor
User avatar

Joined: Sat May 18, 2013 1:24 pm
Posts: 272
Location: Olympia, WA
Post Re: `void TaskID` data type
So it's a string? Function pointer? Doohickey?

_________________
FTC Team 6424, the 'Oly Cow - Chief programmer.
FRC Team 4450, Olympia Robotics Federation (ORF).

and also quadrotors. Quadrotors!


Sat Aug 03, 2013 4:06 pm
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3105
Location: Rotterdam, The Netherlands
Post Re: `void TaskID` data type
Yes

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]


Sat Aug 03, 2013 4:42 pm
Profile WWW
Professor
User avatar

Joined: Sat May 18, 2013 1:24 pm
Posts: 272
Location: Olympia, WA
Post Re: `void TaskID` data type
Ok. Just making sure.

_________________
FTC Team 6424, the 'Oly Cow - Chief programmer.
FRC Team 4450, Olympia Robotics Federation (ORF).

and also quadrotors. Quadrotors!


Sat Aug 03, 2013 8:23 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 7 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.