diff options
Diffstat (limited to 'firmware/mp3_playback.c')
-rw-r--r-- | firmware/mp3_playback.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/firmware/mp3_playback.c b/firmware/mp3_playback.c index 234dc6a20f..a7284aeff0 100644 --- a/firmware/mp3_playback.c +++ b/firmware/mp3_playback.c | |||
@@ -335,19 +335,12 @@ static const unsigned int prescale_table[] = | |||
335 | bool dma_on; /* The DMA is active */ | 335 | bool dma_on; /* The DMA is active */ |
336 | 336 | ||
337 | #if CONFIG_HWCODEC == MAS3507D | 337 | #if CONFIG_HWCODEC == MAS3507D |
338 | static void mas_poll_start(int interval_in_ms) | 338 | static void mas_poll_start(void) |
339 | { | 339 | { |
340 | unsigned int count; | 340 | unsigned int count; |
341 | 341 | ||
342 | count = (FREQ * interval_in_ms) / 1000 / 8; | 342 | count = 9 * FREQ / 10000 / 8; /* 0.9 ms */ |
343 | 343 | ||
344 | if(count > 0xffff) | ||
345 | { | ||
346 | panicf("Error! The MAS poll interval is too long (%d ms)\n", | ||
347 | interval_in_ms); | ||
348 | return; | ||
349 | } | ||
350 | |||
351 | /* We are using timer 1 */ | 344 | /* We are using timer 1 */ |
352 | 345 | ||
353 | TSTR &= ~0x02; /* Stop the timer */ | 346 | TSTR &= ~0x02; /* Stop the timer */ |
@@ -371,7 +364,7 @@ static void postpone_dma_tick(void) | |||
371 | { | 364 | { |
372 | unsigned int count; | 365 | unsigned int count; |
373 | 366 | ||
374 | count = FREQ / 2000 / 8; | 367 | count = 8 * FREQ / 10000 / 8; /* 0.8 ms */ |
375 | 368 | ||
376 | /* We are using timer 1 */ | 369 | /* We are using timer 1 */ |
377 | 370 | ||
@@ -1014,7 +1007,7 @@ void mp3_init(int volume, int bass, int treble, int balance, int loudness, | |||
1014 | #endif | 1007 | #endif |
1015 | 1008 | ||
1016 | #if CONFIG_HWCODEC == MAS3507D | 1009 | #if CONFIG_HWCODEC == MAS3507D |
1017 | mas_poll_start(1); | 1010 | mas_poll_start(); |
1018 | 1011 | ||
1019 | mas_writereg(MAS_REG_KPRESCALE, 0xe9400); | 1012 | mas_writereg(MAS_REG_KPRESCALE, 0xe9400); |
1020 | dac_enable(true); | 1013 | dac_enable(true); |