mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
Added/moved namespaces in events module
This commit is contained in:
parent
c684275018
commit
1982957bef
@ -47,6 +47,11 @@
|
||||
|
||||
#include <uORB/topics/tune_control.h>
|
||||
|
||||
namespace events
|
||||
{
|
||||
namespace rc_loss
|
||||
{
|
||||
|
||||
RC_Loss_Alarm::RC_Loss_Alarm(const events::SubscriberHandler &subscriber_handler)
|
||||
: _subscriber_handler(subscriber_handler)
|
||||
{
|
||||
@ -101,3 +106,6 @@ void RC_Loss_Alarm::play_tune()
|
||||
orb_publish(ORB_ID(tune_control), _tune_control_pub, &tune_control);
|
||||
}
|
||||
}
|
||||
|
||||
} /* namespace rc_loss */
|
||||
} /* namespace events */
|
||||
|
||||
@ -44,6 +44,11 @@
|
||||
#include <uORB/uORB.h>
|
||||
#include <uORB/topics/vehicle_status.h>
|
||||
|
||||
namespace events
|
||||
{
|
||||
namespace rc_loss
|
||||
{
|
||||
|
||||
class RC_Loss_Alarm
|
||||
{
|
||||
public:
|
||||
@ -73,3 +78,6 @@ private:
|
||||
orb_advert_t _tune_control_pub = nullptr;
|
||||
const events::SubscriberHandler &_subscriber_handler;
|
||||
};
|
||||
|
||||
} /* namespace rc_loss */
|
||||
} /* namespace events */
|
||||
|
||||
@ -38,6 +38,9 @@
|
||||
#include <px4_log.h>
|
||||
#include <drivers/drv_hrt.h>
|
||||
|
||||
namespace events
|
||||
{
|
||||
|
||||
struct work_s SendEvent::_work = {};
|
||||
|
||||
// Run it at 30 Hz.
|
||||
@ -283,3 +286,5 @@ int SendEvent::custom_command(int argc, char *argv[])
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
} /* namespace events */
|
||||
|
||||
@ -42,6 +42,9 @@
|
||||
#include <uORB/topics/vehicle_command.h>
|
||||
#include <uORB/topics/vehicle_command_ack.h>
|
||||
|
||||
namespace events
|
||||
{
|
||||
|
||||
extern "C" __EXPORT int send_event_main(int argc, char *argv[]);
|
||||
|
||||
class SendEvent : public ModuleBase<SendEvent>
|
||||
@ -83,8 +86,10 @@ private:
|
||||
void answer_command(const vehicle_command_s &cmd, unsigned result);
|
||||
|
||||
static struct work_s _work;
|
||||
events::SubscriberHandler _subscriber_handler;
|
||||
SubscriberHandler _subscriber_handler;
|
||||
status::StatusDisplay _status_display;
|
||||
RC_Loss_Alarm _rc_loss_alarm;
|
||||
rc_loss::RC_Loss_Alarm _rc_loss_alarm;
|
||||
orb_advert_t _command_ack_pub = nullptr;
|
||||
};
|
||||
|
||||
} /* namespace events */
|
||||
|
||||
@ -40,9 +40,15 @@
|
||||
|
||||
#include "status_display.h"
|
||||
|
||||
using namespace status;
|
||||
namespace events
|
||||
{
|
||||
namespace status
|
||||
{
|
||||
|
||||
void StatusDisplay::set_leds()
|
||||
{
|
||||
// Put your LED handling here
|
||||
}
|
||||
|
||||
} /* namespace status */
|
||||
} /* namespace events */
|
||||
|
||||
@ -43,7 +43,10 @@
|
||||
#include "status_display.h"
|
||||
#include <drivers/drv_led.h>
|
||||
|
||||
using namespace status;
|
||||
namespace events
|
||||
{
|
||||
namespace status
|
||||
{
|
||||
|
||||
StatusDisplay::StatusDisplay(const events::SubscriberHandler &subscriber_handler)
|
||||
: _subscriber_handler(subscriber_handler)
|
||||
@ -106,3 +109,6 @@ void StatusDisplay::publish()
|
||||
_led_control_pub = orb_advertise_queue(ORB_ID(led_control), &_led_control, LED_UORB_QUEUE_LENGTH);
|
||||
}
|
||||
}
|
||||
|
||||
} /* namespace status */
|
||||
} /* namespace events */
|
||||
|
||||
@ -51,6 +51,8 @@
|
||||
#include <uORB/topics/vehicle_status.h>
|
||||
#include <uORB/topics/vehicle_status_flags.h>
|
||||
|
||||
namespace events
|
||||
{
|
||||
namespace status
|
||||
{
|
||||
|
||||
@ -98,4 +100,5 @@ private:
|
||||
const events::SubscriberHandler &_subscriber_handler;
|
||||
};
|
||||
|
||||
} /* status */
|
||||
} /* namespace status */
|
||||
} /* namespace events */
|
||||
|
||||
@ -3,7 +3,8 @@
|
||||
|
||||
#include <px4_log.h>
|
||||
|
||||
using namespace events;
|
||||
namespace events
|
||||
{
|
||||
|
||||
void SubscriberHandler::subscribe()
|
||||
{
|
||||
@ -97,3 +98,5 @@ void SubscriberHandler::check_for_updates()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
} /* namespace events */
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user