···5252static bool paused; /* playback is paused */
5353static bool playing; /* We are playing an MP3 stream */
54545555-/* for measuring the play time */
5656-static long playstart_tick;
5757-static long cumulative_ticks;
5858-5955/* the registered callback function to ask for more mp3 data */
6056static void (*callback_for_more)(unsigned char**, size_t*);
6157···461457462458/* new functions, to be exported to plugin API */
463459460460+#if CONFIG_CODEC == MAS3587F
464461void mp3_play_init(void)
465462{
466463#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
···469466 playing = false;
470467 paused = true;
471468 callback_for_more = NULL;
472472- mp3_reset_playtime();
473469}
470470+#endif
474471475472void mp3_play_data(const unsigned char* start, int size,
476473 void (*get_more)(unsigned char** start, size_t* size) /* callback fn */
···503500 { /* resume playback */
504501 SCR0 |= 0x80;
505502 paused = false;
506506- playstart_tick = current_tick;
507503 }
508504 else if (!paused && !play)
509505 { /* stop playback */
510506 SCR0 &= 0x7f;
511507 paused = true;
512512- cumulative_ticks += current_tick - playstart_tick;
513508 }
514509}
515510···534529#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
535530 demand_irq_enable(false);
536531#endif
537537-}
538538-539539-long mp3_get_playtime(void)
540540-{
541541- if (paused)
542542- return cumulative_ticks;
543543- else
544544- return cumulative_ticks + current_tick - playstart_tick;
545545-}
546546-547547-void mp3_reset_playtime(void)
548548-{
549549- cumulative_ticks = 0;
550550- playstart_tick = current_tick;
551532}
552533553534bool mp3_is_playing(void)
+2
firmware/target/sh/archos/i2c-archos.c
···234234 return x;
235235}
236236237237+#if 0 /* Currently unused, left for reference and future use */
237238int i2c_read(int address, unsigned char* buf, int count )
238239{
239240 int i,x=0;
···250251 i2c_stop();
251252 return x;
252253}
254254+#endif
+6
firmware/target/sh/archos/mascodec-archos.c
···30303131static int mas_devread(unsigned long *dest, int len);
32323333+#if 0 /* Currently unused, left for reference and future use */
3334int mas_default_read(unsigned short *buf)
3435{
3536 unsigned char *dest = (unsigned char *)buf;
···6263 i2c_end();
6364 return ret;
6465}
6666+#endif
65676868+#if CONFIG_CODEC == MAS3507D
6669int mas_run(unsigned short address)
6770{
6871 int ret = 0;
···8386 i2c_end();
8487 return ret;
8588}
8989+#endif
86908791/* note: 'len' is number of 32-bit words, not number of bytes! */
8892int mas_readmem(int bank, int addr, unsigned long* dest, int len)
···307311}
308312309313#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
314314+#if 0 /* Currently unused, left for reference and future use */
310315int mas_direct_config_read(unsigned char reg)
311316{
312317 int ret = 0;
···340345 i2c_end();
341346 return ret;
342347}
348348+#endif
343349344350int mas_direct_config_write(unsigned char reg, unsigned int val)
345351{