コード例 #1
0
TFileReader::TFileReader(const char* AFileNameAndPath)
{
	FFileNameAndPath = AFileNameAndPath;
	FFileSize = 0;
	FNbBytesRead = 0;
	TheBFileReader = NULL;
	OpenR(&TheBFileReader);
}
コード例 #2
0
ファイル: os_tasks.c プロジェクト: sjlbos/DDScheduler
void runSchedulerInterface(os_task_param_t task_init_data)
{
	printf("[Scheduler Interface] Task started.\n");

	// Allow scheduler and handler time to initialize
	OSA_TimeDelay(40);

	// Create a buffer for received messages
	char inputBuffer[HANDLER_BUFFER_SIZE + 1];
	memset(inputBuffer, 0, HANDLER_BUFFER_SIZE + 1);

	// Create a queue to receive messages
	_queue_id receiveQueue = _initializeQueue(SCHEDULER_QUEUE_ID);

	// Register for reading with the serial handler
	if(!OpenR(receiveQueue)){
		printf("[Scheduler Interface] Unable to register for reading with the serial handler.\n");
		_task_block();
	}

#ifdef PEX_USE_RTOS
  while (1) {
#endif
	  // Wait for console input
	  GetLine(inputBuffer);

	  // Handle input commands
	  if(!si_handleCommand(inputBuffer)){
		  printf("[Scheduler Interface] Invalid command.\n");
	  }

	  // Clear input buffer
	  memset(inputBuffer, 0, HANDLER_BUFFER_SIZE + 1);

#ifdef PEX_USE_RTOS   
  }
#endif

	// Unregister with the serial handler
	Close();
}