[refactor][examples] add case success message

This commit is contained in:
jzlv 2021-07-01 19:31:37 +08:00
parent 72e16855d6
commit d0b959f99d
62 changed files with 643433 additions and 376 deletions

View file

@ -468,22 +468,27 @@ int main(void)
if (play_status == 1) {
if (music_tx_flag == 0) {
musci_size = sizeof(music);
frame_count = musci_size / AUDIO_IN_PACKET;
last_frame_size = musci_size % AUDIO_IN_PACKET;
frame_count = musci_size / 4064;
last_frame_size = musci_size % 4064;
frame_cnt = 0;
//MSG("frame_count:%d,last_frame_size:%d\r\n",frame_count,last_frame_size);
audio_pos = 0;
if (last_frame_size % AUDIO_IN_PACKET) {
MSG("data len is not AUDIO_IN_PACKET multiple\r\n");
while (1) {
}
}
MSG("frame_count:%d,last_frame_size:%d\r\n", frame_count, last_frame_size);
music_tx_flag = 1;
}
if (!device_control(dma_ch2, DMA_CHANNEL_GET_STATUS, NULL)) {
if (frame_cnt < frame_count) {
device_write(usb_fs, AUDIO_IN_EP, &music[audio_pos], AUDIO_IN_PACKET);
device_write(usb_fs, AUDIO_IN_EP, &music[audio_pos], 4064);
frame_cnt++;
audio_pos += AUDIO_IN_PACKET;
audio_pos += 4064;
} else {
device_write(usb_fs, AUDIO_IN_EP, &music[audio_pos], last_frame_size);
frame_cnt = 0;
audio_pos = 0;
music_tx_flag = 0;
}
}

View file

@ -1,4 +1,4 @@
const unsigned char music[1984961] = {
const unsigned char music[1984960] = {
0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xFF, 0x00, 0x00,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF,
0xFE, 0xFF, 0x00, 0x00, 0x00, 0x00, 0xFE, 0xFF, 0xFC, 0xFF, 0xFC, 0xFF, 0xFE, 0xFF, 0xFE, 0xFF,
@ -124059,5 +124059,4 @@ const unsigned char music[1984961] = {
0xC1, 0xFB, 0x52, 0x01, 0x4C, 0x03, 0x70, 0x02, 0x9F, 0x04, 0x11, 0x02, 0xBF, 0x04, 0xF9, 0x04,
0x9C, 0x03, 0x00, 0x08, 0xEA, 0x05, 0x88, 0x04, 0x16, 0x05, 0x4E, 0x07, 0xC3, 0x05, 0x36, 0x07,
0xAF, 0x06, 0x4D, 0x04, 0x5C, 0x0B, 0xEE, 0x0C, 0x38, 0x0C, 0x2F, 0x0B, 0x7F, 0x10, 0x86, 0x10,
0x8E
};