mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-20 13:43:33 +08:00
camera_feedback: move to WQ callback and uORB::Subscription
This commit is contained in:
@@ -48,6 +48,8 @@ namespace camera_capture
|
||||
CameraCapture *g_camera_capture{nullptr};
|
||||
}
|
||||
|
||||
struct work_s CameraCapture::_work_publisher;
|
||||
|
||||
CameraCapture::CameraCapture() :
|
||||
ScheduledWorkItem(MODULE_NAME, px4::wq_configurations::lp_default)
|
||||
{
|
||||
@@ -67,9 +69,7 @@ CameraCapture::CameraCapture() :
|
||||
CameraCapture::~CameraCapture()
|
||||
{
|
||||
/* free any existing reports */
|
||||
if (_trig_buffer != nullptr) {
|
||||
delete _trig_buffer;
|
||||
}
|
||||
delete _trig_buffer;
|
||||
|
||||
camera_capture::g_camera_capture = nullptr;
|
||||
}
|
||||
@@ -229,8 +229,8 @@ CameraCapture::set_capture_control(bool enabled)
|
||||
conf.edge = Both;
|
||||
}
|
||||
|
||||
conf.callback = NULL;
|
||||
conf.context = NULL;
|
||||
conf.callback = nullptr;
|
||||
conf.context = nullptr;
|
||||
|
||||
if (enabled) {
|
||||
|
||||
@@ -278,8 +278,6 @@ CameraCapture::set_capture_control(bool enabled)
|
||||
err_out:
|
||||
::close(fd);
|
||||
#endif
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
void
|
||||
@@ -328,7 +326,7 @@ CameraCapture::status()
|
||||
{
|
||||
PX4_INFO("Capture enabled : %s", _capture_enabled ? "YES" : "NO");
|
||||
PX4_INFO("Frame sequence : %u", _capture_seq);
|
||||
PX4_INFO("Last trigger timestamp : %llu", _last_trig_time);
|
||||
PX4_INFO("Last trigger timestamp : %" PRIu64 "", _last_trig_time);
|
||||
|
||||
if (_camera_capture_mode != 0) {
|
||||
PX4_INFO("Last exposure time : %0.2f ms", double(_last_exposure_time) / 1000.0);
|
||||
|
||||
@@ -149,5 +149,3 @@ private:
|
||||
static void publish_trigger_trampoline(void *arg);
|
||||
|
||||
};
|
||||
|
||||
struct work_s CameraCapture::_work_publisher;
|
||||
|
||||
Reference in New Issue
Block a user