Ejemplo n.º 1
0
void CDLgBarH::OnButtonStartStop() 
{
	KRS_running = !KRS_running;
	if (!KRS_running)
	{
		StartTimeOut(m_MapParamDefault);
		if (KRS_project_flag & KRS_PRJ_FLAG_STAGES)
			StartTimeOut(m_MapParamCM_additional_only);
		KRS_SendTOsToDB();
	}
	CButton* b = (CButton*)GetDlgItem(IDC_BUTTON_START_STOP);
	b->SetIcon(KRS_app.LoadIcon(KRS_running?IDI_ICON_STOP:IDI_ICON_START));
}
Ejemplo n.º 2
0
/**
 *	@brief  This function polls 95HF chip until a response is ready or
 *				  the counter of the timeout overflows
 *  @retval PCD_POLLING_TIMEOUT : The time out was reached 
 *  @retval PCD_SUCCESS_CODE : A response is available
 */
static int8_t drv95HF_SPIPollingCommand( void )
{
	uint8_t Polling_Status = 0;

	StartTimeOut(1000);		

	if (drv95HFConfig.uSpiMode == RFTRANS_95HF_SPI_POLLING)
	{
		
		do{
			/* in case of an HID interuption during the process that can desactivate the timeout */
			/* Enable the Time out timer */
			TIM_Cmd(TIMER_TIMEOUT, ENABLE);
			
			RFTRANS_95HF_NSS_LOW();
			/*  poll the 95HF transceiver until he's ready ! */
			Polling_Status  = SPI_SendReceiveByte(RFTRANS_95HF_SPI, RFTRANS_95HF_COMMAND_POLLING);
			Polling_Status &= RFTRANS_95HF_FLAG_DATA_READY_MASK;
			/* Pulse on NSS  */
			RFTRANS_95HF_NSS_HIGH();		
	
		}	while( Polling_Status 	!= RFTRANS_95HF_FLAG_DATA_READY && uTimeOut != true );
		
	}	
	else if (drv95HFConfig.uSpiMode == RFTRANS_95HF_SPI_INTERRUPT)
	{
		/* Wait a low level on the IRQ pin or the timeout  */
		while( (uDataReady == false) & (uTimeOut == false) )
		{	}		
	}

	StopTimeOut( );

	if ( uTimeOut == true )
		return RFTRANS_95HF_POLLING_TIMEOUT;

	return RFTRANS_95HF_SUCCESS_CODE;	
}