Other Parts Discussed in Thread: SYSBIOS
Hi TI
Can you please help:
1. I have problem to understand the OS kernel interface using the Task_sleep.
More exactly: to understand the "nticks" in relation to the "system clock" mentioned in the description of the kernel interface.
I'm using the keystone C6657 DSP with 1GHz as input clock . What is the "system clock" in this case?
If I would like to have a Task_sleep of, let's say, 1ms: what is the correct value of "nticks"
2. Another question: for the context of task switch's how many clock cycles (or micro sec.) do SYSBIOS take to do a task switch between 2 tasks ?
Can you please help to clarify these problems.
Attached: TI's implementation of Task_sleep(UInt32 nticks)
BR
Tam Tran
******************* SYSBIOS intf. ********************
Void Task_sleep(UInt32 nticks);
ARGUMENTS
nticks — number of system clock ticks to sleep
DETAILS
Task_sleep changes the current task's mode from Mode_RUNNING to Mode_BLOCKED, and delays its execution for nticks increments of the system clock. The actual time delayed can be up to 1 system clock tick less than nticks due to granularity in system timekeeping and the time elapsed per tick is determined by Clock_tickPeriod.
After the specified period of time has elapsed, the task reverts to the Mode_READY mode and is scheduled for execution.
A task switch always occurs when calling Task_sleep if nticks > 0.
CONSTRAINTS
Task_sleep cannot be called from a Swi or Hwi, or within a disable / restore block.
Task_sleep cannot be called from the program's main() function.
Task_sleep should not be called from within an Idle function. Doing so prevents analysis tools from gathering run-time information.
nticks cannot be BIOS_WAIT_FOREVER.