コード例 #1
0
ファイル: RX_LCD_V02.c プロジェクト: xuxiuyao/PumpInsert
void Chk_Busy_BTE(void)
{
  unsigned char temp;
   do
   {
    temp=Read_Status();
   }
  while((temp&0x40)==0x40);	   
}	
コード例 #2
0
static void NRF_Task(void *params)
{
	
	//static uint8_t NRF_Recieve_Array[100];
	static uint8_t ArrayIn[50];
	//static uint8_t ArrayOut[50];
	uint8_t PayloadOut[5] = {'J', 'U', 'S', 'T', 'I'};
	static uint8_t XMitState = 0;	
	//static uint8_t SendNotGet = 1;
	//static uint8_t Serial_Recieve_Array[100];
	while(1)
	{
		xSemaphoreTake(display_mutex, portMAX_DELAY);
		
		
		#if 1
		if(0 == XMitState)
		{
			Set_NRF24L_Tx_Mode();
			port_pin_toggle_output_level(LED_0_PIN);
			SendNewPayload(PayloadOut, 5);
			Clear_NRF_Int_Flags();
			XMitState = 1;
		}
		else if(1 == XMitState)
		{
			Set_NRF24L_Rx_Mode();
			XMitState = 2;
		}
		else
		{
			if(0x0E == Read_Status())
			{
				//port_pin_set_output_level(LED_0_PIN, 0);
				oled1_set_led_state(&oled1, OLED1_LED3_ID, false);
			}
			else
			{
				oled1_set_led_state(&oled1, OLED1_LED3_ID, true);
				ReadPayload(ArrayIn, 5);
			}
			
			XMitState = 0;
		}
		#endif

		xSemaphoreGive(display_mutex);
		vTaskDelay(NRF_TASK_DELAY);
	}
}