OSDN Git Service

Moved the junk codes to junk directory.
[kozos-expbrd/kozos_expbrd.git] / firm / junk / 09 / os / driver / driver_audio.c
1 #include "driver_audio.h"
2 #include "vs1011e.h"
3 #include "kozos.h"
4
5 #define AUDIODRV_CMD_PULSE  'p'
6
7 void audio_pulse(void)
8 {
9   char *p;
10   p = kz_kmalloc(1);
11   p[0] = AUDIODRV_CMD_PULSE;
12   kz_send(MSGBOX_ID_AUDIODRIVE, 1, p);
13 }
14
15 static int audiodrv_command(char *p)
16 {
17   int cmd = p[0];
18   volatile int i;
19   switch (cmd) {
20   case AUDIODRV_CMD_PULSE:
21     vs1011e_sinetest_init();
22     for (i = 0; i < 2000; i++) { }
23     vs1011e_sinetest_fini();
24     break;
25   default:
26     break;
27   }
28   kz_kmfree(p);
29
30   return 0;
31 }
32
33 int driver_audio(int argc, char *argv[])
34 {
35   int size;
36   char *p;
37
38   vs1011e_init();
39
40   while (1) {
41     kz_recv(MSGBOX_ID_AUDIODRIVE, &size, &p);
42     audiodrv_command(p);
43   }
44
45   return 0;
46 }