mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-04 20:11:36 +08:00
samv7 adc and tone_alarm move to cdev lib
This commit is contained in:
@@ -208,7 +208,7 @@
|
||||
|
||||
#define CBRK_BUZZER_KEY 782097
|
||||
|
||||
class ToneAlarm : public device::CDev
|
||||
class ToneAlarm : public cdev::CDev
|
||||
{
|
||||
public:
|
||||
ToneAlarm();
|
||||
@@ -313,7 +313,7 @@ extern "C" __EXPORT int tone_alarm_main(int argc, char *argv[]);
|
||||
|
||||
|
||||
ToneAlarm::ToneAlarm() :
|
||||
CDev("tone_alarm", TONEALARM0_DEVICE_PATH),
|
||||
CDev(TONEALARM0_DEVICE_PATH),
|
||||
_default_tune_number(0),
|
||||
_user_tune(nullptr),
|
||||
_tune(nullptr),
|
||||
@@ -393,7 +393,7 @@ ToneAlarm::init()
|
||||
/* make sure the timer is running */
|
||||
rCR1 = GTIM_CR1_CEN;
|
||||
#endif
|
||||
DEVICE_DEBUG("ready");
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
@@ -803,14 +803,14 @@ ToneAlarm::ioctl(file *filp, int cmd, unsigned long arg)
|
||||
{
|
||||
int result = OK;
|
||||
|
||||
DEVICE_DEBUG("ioctl %i %u", cmd, arg);
|
||||
PX4_DEBUG("ioctl %i %u", cmd, arg);
|
||||
|
||||
// irqstate_t flags = enter_critical_section();
|
||||
|
||||
/* decide whether to increase the alarm level to cmd or leave it alone */
|
||||
switch (cmd) {
|
||||
case TONE_SET_ALARM:
|
||||
DEVICE_DEBUG("TONE_SET_ALARM %u", arg);
|
||||
PX4_DEBUG("TONE_SET_ALARM %u", arg);
|
||||
|
||||
if (arg < TONE_NUMBER_OF_TUNES) {
|
||||
if (arg == TONE_STOP_TUNE) {
|
||||
|
||||
Reference in New Issue
Block a user