drivers/tone.c: 50% duty needs to be expressed a a fixed precision number

This commit is contained in:
Gregory Nutt 2017-02-22 06:35:20 -06:00
parent ae86d7a8c8
commit 5e09de3703
1 changed files with 2 additions and 2 deletions

View File

@ -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]; upper->tone.frequency = g_notes_freq[note - 1];
#ifdef CONFIG_PWM_MULTICHAN #ifdef CONFIG_PWM_MULTICHAN
upper->tone.channels[0].channel = upper->channel; upper->tone.channels[0].channel = upper->channel;
upper->tone.channels[0].duty = 50; upper->tone.channels[0].duty = b16HALF;
#else #else
upper->tone.duty = 50; upper->tone.duty = b16HALF;
#endif #endif
/* REVISIT: Should check the return value */ /* REVISIT: Should check the return value */