rtapi_task_new(3rtapi)
π rtapi_task_new β the "make me a realtime task" girlie π
okay so bestie, this is from the RTAPI corner of the manual, and it's literally about creating a realtime task. not starting it. creating it. we'll get there. π«Ά
β¨ NAME β¨
rtapi_task_new β create a realtime task π
π SYNTAX π
like, here's the whole vibe, copy it exactly bestie:
int rtapi_task_new(void (*taskcode)(void*), void *arg, int prio,
unsigned long stacksize, int uses_fp)
int rtapi_task_delete(int task_id)
πΈ ARGUMENTS πΈ
taskcodeβ a pointer to the function that gets called when the task is started. like, the main character function. πargβ an argument you pass along to thetaskcodefunction when the task is started. little gift, wrapped up. πprioβ a task priority value returned byrtapi_prio_xxxx. don't make one up, get it from the prio girlies.uses_fpβ a flag that tells the OS whether the task uses floating point or not. yes or no bestie, no in-between. π¦task_idβ a task ID returned by a previous call tortapi_task_new. it's the receipt from last time. π§Ύ
π¦ DESCRIPTION π¦
rtapi_task_new creates a realtime task but does not start it. no cap. it arrives in the "paused" state, just sitting there, minding its business. π
to actually get it going, you call one of these two:
rtapi_task_startβ for periodic tasksrtapi_task_resumeβ for free-running tasks
pick the right one for the right task, iykyk. π
π₯ REALTIME CONSIDERATIONS π₯
call this only from within init/cleanup code. not from realtime tasks. periodt. π βοΈ
β RETURN VALUE β
on success it hands you a positive integer task ID. this ID is what you use for all subsequent calls that need to act on the task β it's the task's whole identity bestie, remember it. π
on failure, it returns an RTAPI status code. π
π SEE ALSO π
go read those next, they're all part of the same friend group fr fr. π
and that's the page bestie!! β¨ this one's straight from the LinuxCNC Documentation, dated 2006-10-12, filed under rtapi_task_new(3rtapi). iconic, timeless, ate. ππ
π¦ where this page comes from
- debian bookworm: linuxcnc-uspace-dev 2.9.0~pre1+git20230208.f1270d6ed7-1+deb12u2 Β· GFDL-1.1-or-later
- debian trixie: linuxcnc-uspace-dev 1:2.9.4-2+deb13u1 Β· GFDL-1.1-or-later
- ubuntu questing: linuxcnc-uspace-dev 1:2.9.4-2ubuntu2
- ubuntu resolute: linuxcnc-uspace-dev 1:2.9.4-2ubuntu4 Β· GFDL-1.1-or-later
- ubuntu stonking: linuxcnc-uspace-dev 1:2.9.4-2ubuntu4 Β· GFDL-1.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms