camera_feedback: move to WQ callback and uORB::Subscription

This commit is contained in:
Daniel Agar
2019-11-30 15:49:55 -05:00
parent 0420a4386d
commit e951531b12
20 changed files with 234 additions and 358 deletions
@@ -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;