forked from Archive/PX4-Autopilot
POSIX: added tone_alarm simulator
The tone_alarm simulator was added to rc.S and the warning output for a hrt_timer with a 0 expiry times was disabled. Signed-off-by: Mark Charlebois <charlebm@gmail.com>
This commit is contained in:
parent
9ef7db6a36
commit
527b97e8b4
|
@ -5,6 +5,7 @@ barosim start
|
|||
adcsim start
|
||||
accelsim start
|
||||
gyrosim start
|
||||
tone_alarm start
|
||||
param set CAL_GYRO0_ID 2293760
|
||||
param set CAL_ACC0_ID 1310720
|
||||
param set CAL_ACC1_ID 1376256
|
||||
|
|
|
@ -350,7 +350,7 @@ ToneAlarm::start_note(unsigned note)
|
|||
|
||||
// Silence warning of unused var
|
||||
do_something(period);
|
||||
PX4_DEBUG("ToneAlarm::start_note %u", period);
|
||||
PX4_INFO("ToneAlarm::start_note %u", period);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -361,6 +361,7 @@ ToneAlarm::stop_note()
|
|||
void
|
||||
ToneAlarm::start_tune(const char *tune)
|
||||
{
|
||||
PX4_INFO("ToneAlarm::start_tune");
|
||||
// kill any current playback
|
||||
hrt_cancel(&_note_call);
|
||||
|
||||
|
@ -533,7 +534,7 @@ ToneAlarm::next_note()
|
|||
|
||||
// tune looks bad (unexpected EOF, bad character, etc.)
|
||||
tune_error:
|
||||
printf("tune error\n");
|
||||
PX4_ERR("tune error\n");
|
||||
_repeat = false; // don't loop on error
|
||||
|
||||
// stop (and potentially restart) the tune
|
||||
|
@ -605,7 +606,7 @@ ToneAlarm::ioctl(device::file_t *filp, int cmd, unsigned long arg)
|
|||
/* decide whether to increase the alarm level to cmd or leave it alone */
|
||||
switch (cmd) {
|
||||
case TONE_SET_ALARM:
|
||||
debug("TONE_SET_ALARM %u", arg);
|
||||
PX4_INFO("TONE_SET_ALARM %lu", arg);
|
||||
|
||||
if (arg < TONE_NUMBER_OF_TUNES) {
|
||||
if (arg == TONE_STOP_TUNE) {
|
||||
|
|
|
@ -301,9 +301,12 @@ hrt_call_internal(struct hrt_call *entry, hrt_abstime deadline, hrt_abstime inte
|
|||
if (entry->deadline != 0)
|
||||
sq_rem(&entry->link, &callout_queue);
|
||||
|
||||
#if 0
|
||||
// Use this to debug busy CPU that keeps rescheduling with 0 period time
|
||||
if (interval < HRT_INTERVAL_MIN) {
|
||||
PX4_ERR("hrt_call_internal interval too short: %" PRIu64, interval);
|
||||
}
|
||||
#endif
|
||||
entry->deadline = deadline;
|
||||
entry->period = interval;
|
||||
entry->callout = callout;
|
||||
|
|
Loading…
Reference in New Issue