Changeset 4 in pacpussensors for trunk/CanGateway/Win32CanInterface.cpp


Ignore:
Timestamp:
Jun 7, 2013, 12:10:00 AM (11 years ago)
Author:
guyardro
Message:

add igep can driver for CanGateway and add support for igep compilation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/CanGateway/Win32CanInterface.cpp

    r2 r4  
    109109    peakLoop();
    110110    break;
     111  case igepCard:
     112    igepLoop();
     113    break;
    111114  case XLVectorCard:
    112115    vectorXlLoop();
     
    200203
    201204/************************************************************************/
     205/// The loop used for waiting CAN data from igep card
     206void Win32CanInterface::igepLoop()
     207{
     208  std::cout << "In igep loop" << std::endl;
     209
     210  while(continue_)
     211  {
     212    // Wait incoming data from the CAN bus
     213    if ( canDriver_->receiveFrame(frame_) == 0 ) {
     214      receivedFrames_[counter_].time = road_time();
     215      receivedFrames_[counter_].timerange = 0;
     216      memcpy(&(receivedFrames_[counter_].frame), &frame_, sizeof(CanFrame) );
     217      semaphore_->release();
     218      counter_++;
     219      counter_ = counter_ % receivedFramesArraySize_;
     220    }
     221  }
     222}
     223/************************************************************************/
    202224/// Stops the thread
    203225void Win32CanInterface::stop()
Note: See TracChangeset for help on using the changeset viewer.