Skip to content

Commit 731f0d1

Browse files
authored
Merge pull request #643 from schollz/schollz/issue642
ectocore: fix bank+sample scrolling
2 parents b45b7ea + 68982a6 commit 731f0d1

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

ectocore_compile_definitions.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ target_compile_definitions(${PROJECT_NAME} PRIVATE
5656
# PRINT_MEMORY_USAGE=1
5757
# PRINT_SDCARD_TIMING=1
5858
# PRINT_AUDIOBLOCKDROPS=1
59+
# PRINT_SDCARD_OPEN_TIMING=1
5960

6061
# turn off gpio for leds
6162
LEDS_NO_GPIO=1

lib/audio_callback.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -410,8 +410,10 @@ void i2s_callback_func() {
410410

411411
if (head == 0 && do_open_file) {
412412
// setup the next
413-
sel_sample_cur = sel_sample_next;
414413
sel_bank_cur = sel_bank_next;
414+
sel_sample_cur = sel_sample_next % banks[sel_bank_cur]->num_samples;
415+
// printf("[audio_callback] switch bank/sample %d/%d\n", sel_bank_cur,
416+
// sel_sample_cur);
415417

416418
FRESULT fr;
417419
t0 = time_us_32();
@@ -424,7 +426,7 @@ void i2s_callback_func() {
424426
fr = f_open(&fil_current, fil_current_name, FA_READ);
425427
t1 = time_us_32();
426428
sd_card_total_time += (t1 - t0);
427-
#ifdef PRINT_SDCARD_TIMING
429+
#ifdef PRINT_SDCARD_OPEN_TIMING
428430
if (do_open_file) {
429431
MessageSync_printf(messagesync,
430432
"[audio_callback] do_open_file f_close+f_open: %d\n",
@@ -467,7 +469,7 @@ void i2s_callback_func() {
467469
return;
468470
}
469471
t1 = time_us_32();
470-
#ifdef PRINT_SDCARD_TIMING
472+
#ifdef PRINT_SDCARD_OPEN_TIMING
471473
if (do_open_file) {
472474
MessageSync_printf(messagesync,
473475
"[audio_callback] do_open_file f_lseek: %d\n",

lib/file_list.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ SampleList *list_files(const char *dir) {
7777
}
7878
filelist_count++;
7979
} else {
80-
printf("[list_files] %s: %s\n", fname, FRESULT_str(fr));
80+
// printf("[list_files] %s: %s\n", fname, FRESULT_str(fr));
8181
}
8282
}
8383

0 commit comments

Comments
 (0)