From 5e09de3703b0170caf98fa1f3a3502450a17fc7f Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 22 Feb 2017 06:35:20 -0600 Subject: [PATCH] drivers/tone.c: 50% duty needs to be expressed a a fixed precision number --- drivers/audio/tone.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/audio/tone.c b/drivers/audio/tone.c index 972de358b2..f9b5393f73 100644 --- a/drivers/audio/tone.c +++ b/drivers/audio/tone.c @@ -309,9 +309,9 @@ static void start_note(FAR struct tone_upperhalf_s *upper, uint8_t note) upper->tone.frequency = g_notes_freq[note - 1]; #ifdef CONFIG_PWM_MULTICHAN upper->tone.channels[0].channel = upper->channel; - upper->tone.channels[0].duty = 50; + upper->tone.channels[0].duty = b16HALF; #else - upper->tone.duty = 50; + upper->tone.duty = b16HALF; #endif /* REVISIT: Should check the return value */