Exemplo n.º 1
0
void usleep(u32 time)
{
u32 message;

	os_message_queue_send(timer1_queuehandle, 0x555, 0);
	os_restart_timer(timer1_id, time);
    while(1)
		{
		os_message_queue_receive(timer1_queuehandle,(void *) &message, 0);
		if(message==0x555) break;
		}
	os_message_queue_receive(timer1_queuehandle,(void *) &message, 0);
	os_stop_timer(timer1_id);

}
Exemplo n.º 2
0
void Timer_Sleep(u32 time)
{
	u32 message;

	/* Restart timer */
	os_restart_timer(timerId, 0, time);

	while (1) {
		/* Wait to receive message */
		os_message_queue_receive(queuehandle, (void *)&message, 0);

		/* Message received */
		if (message == 0x666)
			break;
	}

	/* Stop timer */
	os_stop_timer(timerId);
}
Exemplo n.º 3
0
void Timer_Sleep(u32 time)
{
	u32 message;

	/* Send message */
	os_message_queue_send(queuehandle, 0x555, 0);

	/* Restart timer */
	os_restart_timer(timerId, time);

	while (1) {
		os_message_queue_receive(queuehandle, (void *)&message, 0);

		/* Message received */
		if (message == 0x555)
			break;
	}

	
	os_message_queue_receive(queuehandle, (void *)&message, 0);

	/* Stop timer */
	os_stop_timer(timerId);
}