コード例 #1
0
/**********************************
* Function : void Command_Setting(void)
* The command list was listed in below.
	* CMD_READY = 0x00,
	* CMD_PCR_RUN,
	* CMD_PCR_STOP,
	* CMD_REQUEST_LINE,
	* CMD_BOOTLOADER = 0x55
 - The 'CMD_READY' command is common operation.
 - The 'CMD_PCR_RUN' command is used to run the PCR, but, the pid value must exist.
 - The 'CMD_PCR_STOP' command is used to stop the PCR.
 - The 'CMD_REQUEST_LINE' command is not used.
 - The 'CMD_BOOTLOADER' command is not working that maybe the board is different.

All of command is checking the pc command flow for assert.
**********************************/
void Command_Setting(void)
{
	int i = 0;

	switch( rxBuffer.cmd )
	{
		case CMD_READY:
			if( currentState == STATE_RUNNING )
				Run_Task();
			break;
		case CMD_PCR_RUN:
			if( currentState == STATE_READY )
			{
				currentState = STATE_RUNNING;
				lastIntegral = 0;
				lastError = 0;
				prevTargetTemp = currentTargetTemp = 25;

				compensation = COMPENSATION_DEFAULT - (rxBuffer.compensation * COMPENSATION_UNIT);

				Init_PWM_MODE();

				Run_Task();
			}
			else if( currentState == STATE_RUNNING )
			{
				Run_Task();
			}
			else
				currentError = ERROR_ASSERT;
			break;
		case CMD_PCR_STOP:
			Stop_Task();
			break;
		case CMD_FAN_ON:
				Fan_ON();
			break;
		case CMD_FAN_OFF:
				Fan_OFF();
			break;
	}
}
コード例 #2
0
ファイル: gd_system.c プロジェクト: tomyqg/stm32fxdtu
void gd_start_tasks() 
{
	struct user_task *ptask = NULL;

	if(gd_system.work_mode == GD_CONFIG_MODE)
	{
		Run_Task(&user_tasks[GD_TASK_CONFIG_ID]);
		Run_Task(&user_tasks[GD_TASK_LED_ID]);	
	}
	else if(gd_system.work_mode == GD_TRANS_MODE)
	{
		ptask = &user_tasks[2];
		
		for (; ptask->TaskName != NULL; ptask++) 
		{
			if (ptask->autorun) 
			{
				Run_Task(ptask);
			}
		}
	}

	return;
}
コード例 #3
0
ファイル: gd_system.c プロジェクト: tomyqg/stm32fxdtu
void gd_start_init_task()
{
	Run_Task(&user_tasks[GD_TASK_INIT_ID]);	

}