Commit c4f0e457 authored by 张泽仁's avatar 张泽仁

release version for attempt

parent c2eb9d23
...@@ -57,7 +57,7 @@ int xfm_Init() ...@@ -57,7 +57,7 @@ int xfm_Init()
} }
printf("/dev/ttyUSB0 Open success\r\n"); printf("/dev/ttyUSB0 Open success\r\n");
if ((fileuart = serialOpen("/dev/ttyAMA0", 115200)) < 0) if ((fileuart = serialOpen("/dev/ttyAMA0", 9600)) < 0) //changed from 115200 to 9600
{ {
printf("/dev/ttyAMA0 Open Faild\r\n"); printf("/dev/ttyAMA0 Open Faild\r\n");
return 0; return 0;
...@@ -142,6 +142,39 @@ uint16_t CrcValueCalc(const uint8_t *cpucData, uint16_t usLength) ...@@ -142,6 +142,39 @@ uint16_t CrcValueCalc(const uint8_t *cpucData, uint16_t usLength)
extern int get_audio_device_id(); extern int get_audio_device_id();
void releaseAckeachwakenwords(char* totalbuf)
{
char* p = totalbuf;
while (*p != 'k' || *(p+1) != 'e')
{
p++;
}
p += 12;
if (g_callback != NULL){
char buf[256] = {0};
snprintf(buf, 256, "cvlc --play-and-exit --aout alsa --alsa-audio-device hw:%d,0 /usr/local/bin/Videos/aaaa.mp3 &", get_audio_device_id());
//system("mpg321 /usr/local/bin/Videos/aaaa.mp3 &");
//system("cvlc --play-and-exit --aout alsa --alsa-audio-device hw:2,0 /usr/local/bin/Videos/aaaa.mp3 &");
system(buf);
g_callback(g_callback_ctx, 2);
}
switch(*p)
{
case 'x':
g_callback(g_callback_ctx, 2);
break;
case 'z':
g_callback(g_callback_ctx, 4);
break;
case 'y':
g_callback(g_callback_ctx, 3);
break;
default:
break;
}
}
void sentUart(char *buf, int fileuart) void sentUart(char *buf, int fileuart)
{ {
if (count == 9) if (count == 9)
...@@ -156,15 +189,8 @@ void sentUart(char *buf, int fileuart) ...@@ -156,15 +189,8 @@ void sentUart(char *buf, int fileuart)
write(fileuart, angleret, 2); write(fileuart, angleret, 2);
count = 1; count = 1;
memset(totalbuf, 0, 1024); memset(totalbuf, 0, 1024);
if (g_callback != NULL){
char buf[256] = {0};
snprintf(buf, 256, "cvlc --play-and-exit --aout alsa --alsa-audio-device hw:%d,0 /usr/local/bin/Videos/aaaa.mp3 &", get_audio_device_id());
//system("mpg321 /usr/local/bin/Videos/aaaa.mp3 &");
//system("cvlc --play-and-exit --aout alsa --alsa-audio-device hw:2,0 /usr/local/bin/Videos/aaaa.mp3 &");
system(buf);
g_callback(g_callback_ctx, 2);
} releaseAckeachwakenwords(totalbuf);
} }
else else
{ {
...@@ -198,6 +224,7 @@ void circleReading() ...@@ -198,6 +224,7 @@ void circleReading()
else else
{ {
sentUart(buf, fileuart); printf(" %d\n", __LINE__); sentUart(buf, fileuart); printf(" %d\n", __LINE__);
serialFlush(fileusb);
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment