Skip to content

Commit

Permalink
main: remove unused code in the while(1) main loop
Browse files Browse the repository at this point in the history
  • Loading branch information
amurzeau committed Aug 25, 2024
1 parent 9ffa048 commit bf924dc
Showing 1 changed file with 0 additions and 38 deletions.
38 changes: 0 additions & 38 deletions Core/Src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,44 +154,6 @@ int main(void)
/* USER CODE END WHILE */

/* USER CODE BEGIN 3 */
if(usb_new_frame_flag && 0) {
usb_new_frame_flag = 0;

size_t nframes = usb_audio_endpoint_out_data[0].nominal_packet_size / USBD_AUDIO_BYTES_PER_SAMPLE / USBD_AUDIO_CHANNELS;

USBD_AUDIO_LoopbackDataTypeDef* data_out[2] = {
&usb_audio_endpoint_out_data[0],
&usb_audio_endpoint_out_data[1],
};
USBD_AUDIO_LoopbackDataTypeDef* data_in[1] = {
&usb_audio_endpoint_in_data[0]
};

uint8_t* endpoint_out_buffer[2];
uint8_t* endpoint_in_buffer[1];

for(size_t i = 0; i < sizeof(data_out)/sizeof(data_out[0]); i++) {
endpoint_out_buffer[i] = USBD_AUDIO_GetBufferFromApp(data_out[i]);
}
for(size_t i = 0; i < sizeof(data_in)/sizeof(data_in[0]); i++) {
endpoint_in_buffer[i] = USBD_AUDIO_GetBufferFromApp(data_in[i]);
}

DAMC_processAudioInterleaved(
(const int16_t**)endpoint_out_buffer,
sizeof(data_out)/sizeof(data_out[0]),
(int16_t**)endpoint_in_buffer,
sizeof(data_in)/sizeof(data_in[0]),
nframes);

for(size_t i = 0; i < sizeof(data_out)/sizeof(data_out[0]); i++) {
USBD_AUDIO_ReleaseBufferFromApp(data_out[i]);
}
for(size_t i = 0; i < sizeof(data_in)/sizeof(data_in[0]); i++) {
USBD_AUDIO_ReleaseBufferFromApp(data_in[i]);
}
}

DAMC_mainLoop();
}
/* USER CODE END 3 */
Expand Down

0 comments on commit bf924dc

Please sign in to comment.