Skip to content

Commit

Permalink
Disable global time on RPi
Browse files Browse the repository at this point in the history
  • Loading branch information
dorodnic committed Mar 26, 2020
1 parent 9c25ae8 commit 43294e9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions CMake/unix_config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ macro(os_set_flags)
if(${MACHINE} MATCHES "arm-linux-gnueabihf")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mfpu=neon -mfloat-abi=hard -ftree-vectorize -latomic")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mfpu=neon -mfloat-abi=hard -ftree-vectorize -latomic")
add_definitions(-DRASPBERRY_PI)
elseif(${MACHINE} MATCHES "aarch64-linux-gnu")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mstrict-align -ftree-vectorize")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mstrict-align -ftree-vectorize")
Expand Down
8 changes: 7 additions & 1 deletion src/ds5/ds5-device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -901,7 +901,12 @@ namespace librealsense
//{
// throw not_implemented_exception("device time not supported for backend.");
//}


#ifdef RASPBERRY_PI
// TODO: This is temporary work-around since global timestamp seems to compromise RPi stability
using namespace std::chrono;
return duration_cast<milliseconds>(system_clock::now().time_since_epoch()).count();
#else
if (!_hw_monitor)
throw wrong_api_call_sequence_exception("_hw_monitor is not initialized yet");

Expand All @@ -916,6 +921,7 @@ namespace librealsense
uint32_t dt = *(uint32_t*)res.data();
double ts = dt * TIMESTAMP_USEC_TO_MSEC;
return ts;
#endif
}

std::shared_ptr<synthetic_sensor> ds5u_device::create_ds5u_depth_device(std::shared_ptr<context> ctx,
Expand Down

0 comments on commit 43294e9

Please sign in to comment.