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:
Mark Charlebois
2015-06-11 19:00:49 -07:00
parent 9ef7db6a36
commit 527b97e8b4
3 changed files with 8 additions and 3 deletions
+1
View File
@@ -5,6 +5,7 @@ barosim start
adcsim start adcsim start
accelsim start accelsim start
gyrosim start gyrosim start
tone_alarm start
param set CAL_GYRO0_ID 2293760 param set CAL_GYRO0_ID 2293760
param set CAL_ACC0_ID 1310720 param set CAL_ACC0_ID 1310720
param set CAL_ACC1_ID 1376256 param set CAL_ACC1_ID 1376256
@@ -350,7 +350,7 @@ ToneAlarm::start_note(unsigned note)
// Silence warning of unused var // Silence warning of unused var
do_something(period); do_something(period);
PX4_DEBUG("ToneAlarm::start_note %u", period); PX4_INFO("ToneAlarm::start_note %u", period);
} }
void void
@@ -361,6 +361,7 @@ ToneAlarm::stop_note()
void void
ToneAlarm::start_tune(const char *tune) ToneAlarm::start_tune(const char *tune)
{ {
PX4_INFO("ToneAlarm::start_tune");
// kill any current playback // kill any current playback
hrt_cancel(&_note_call); hrt_cancel(&_note_call);
@@ -533,7 +534,7 @@ ToneAlarm::next_note()
// tune looks bad (unexpected EOF, bad character, etc.) // tune looks bad (unexpected EOF, bad character, etc.)
tune_error: tune_error:
printf("tune error\n"); PX4_ERR("tune error\n");
_repeat = false; // don't loop on error _repeat = false; // don't loop on error
// stop (and potentially restart) the tune // 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 */ /* decide whether to increase the alarm level to cmd or leave it alone */
switch (cmd) { switch (cmd) {
case TONE_SET_ALARM: 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_NUMBER_OF_TUNES) {
if (arg == TONE_STOP_TUNE) { if (arg == TONE_STOP_TUNE) {
+3
View File
@@ -301,9 +301,12 @@ hrt_call_internal(struct hrt_call *entry, hrt_abstime deadline, hrt_abstime inte
if (entry->deadline != 0) if (entry->deadline != 0)
sq_rem(&entry->link, &callout_queue); 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) { if (interval < HRT_INTERVAL_MIN) {
PX4_ERR("hrt_call_internal interval too short: %" PRIu64, interval); PX4_ERR("hrt_call_internal interval too short: %" PRIu64, interval);
} }
#endif
entry->deadline = deadline; entry->deadline = deadline;
entry->period = interval; entry->period = interval;
entry->callout = callout; entry->callout = callout;