Example #1
0
static int __wind_kernel_timeslice(struct pt_regs *regs)
{
	int ticks = __xn_reg_arg1(regs);

	kernelTimeSlice(ticks);	/* Always ok. */

	return 0;
}
bhs_MutexRobot::bhs_MutexRobot()
	: m_robot()
	, m_disabledInitialized(false)
	, m_autonomousInitialized(false)
	, m_teleopInitialized(false)
	, m_period(k_defaultPeriod)
{
	// configure for round-robin scheduling
	kernelTimeSlice(sysClkRateGet() / 100); // 1/100th of a second - what each task gets for time slice
	//taskDelay(sysClkRateGet() / 2);

	// create mutex for sync
	m_startSem = semBCreate(SEM_Q_FIFO, SEM_EMPTY);
	m_periodSem = semBCreate(SEM_Q_FIFO, SEM_EMPTY);

	// start timer tasks
	taskSpawn("BHS_Timer_Task", 0, 0, 20000, (FUNCPTR) bhs_MutexRobot::timerTask, (int) this, 0, 0, 0, 0, 0, 0, 0, 0, 0);
}