Skip to content

Commit

Permalink
hold th epower on for 2 sec
Browse files Browse the repository at this point in the history
  • Loading branch information
Nir-Az committed May 21, 2024
1 parent c71b3d3 commit 6becc51
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/uvc-sensor.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,12 @@ class uvc_sensor : public raw_sensor_base

void power_for_duration( std::chrono::steady_clock::duration timeout = std::chrono::milliseconds( 500 ) )
{
acquire_power();
std::weak_ptr< uvc_sensor > weak = std::dynamic_pointer_cast< uvc_sensor >( shared_from_this() );
if( auto strong = weak.lock() )
{
strong->acquire_power();
}

std::thread release_power_thread( [weak, timeout]()
{
std::this_thread::sleep_for( timeout );
Expand Down
4 changes: 4 additions & 0 deletions unit-tests/live/d400/test-hdr-long.py
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,10 @@ def check_sequence_id(pipe):
if test.check(at_least_one_frame_supported_seq_id):
test.check(first_series_last_merged_ts != -1)
test.check(depth_sensor.get_option(rs.option.hdr_enabled) == 1)
print("cfg1 = ", cfg)
cfg = rs.config()
cfg.enable_stream(rs.stream.depth)
print("cfg2 = ", cfg)
pipe.start(cfg)

for i in range(0, 10):
Expand Down

0 comments on commit 6becc51

Please sign in to comment.