diff --git a/src/components/activity/ActivityController.h b/src/components/activity/ActivityController.h index d7831d380f..761f509db4 100644 --- a/src/components/activity/ActivityController.h +++ b/src/components/activity/ActivityController.h @@ -39,7 +39,13 @@ #define ACTIVITY_HEADER_SIZE 30 #define ACTIVITY_PAYLOAD_SIZE (ACTIVITY_BLOCK_SIZE - ACTIVITY_HEADER_SIZE - 2) // 480 (512 - 30 bytes header - 2 bytes checksum) #define ACTIVITY_SAMPLE_SIZE 8 -#define ACTIVITY_MAX_SAMPLES (ACTIVITY_PAYLOAD_SIZE / ACTIVITY_SAMPLE_SIZE) // 60 (480 / 8) + +#ifdef CUEBAND_MAXIMUM_SAMPLES_PER_BLOCK + // Overridden for debug purposes + #define ACTIVITY_MAX_SAMPLES (((ACTIVITY_PAYLOAD_SIZE / ACTIVITY_SAMPLE_SIZE) < (CUEBAND_MAXIMUM_SAMPLES_PER_BLOCK)) ? (ACTIVITY_PAYLOAD_SIZE / ACTIVITY_SAMPLE_SIZE) : (CUEBAND_MAXIMUM_SAMPLES_PER_BLOCK)) +#else + #define ACTIVITY_MAX_SAMPLES (ACTIVITY_PAYLOAD_SIZE / ACTIVITY_SAMPLE_SIZE) // 60 (480 / 8) +#endif // If streaming resampled data, the buffer needs to hold a whole resampled FIFOs worth -- otherwise the chunks can be small #ifdef CUEBAND_STREAM_RESAMPLED diff --git a/src/cueband.h b/src/cueband.h index 27de1e2837..98b141189b 100644 --- a/src/cueband.h +++ b/src/cueband.h @@ -150,11 +150,13 @@ #define CUEBAND_POSSIBLE_FIX_FS // The value in FS.h for `size` looks incorrect? -#define CUEBAND_WRITE_TEST_FILE 2000 // If defined, create a test file of ACTIVITY_MAXIMUM_BLOCKS using this value as an offset for the logical sectors (set to a new value to recreate the test file) +//#define CUEBAND_WRITE_TEST_FILE 2000 // If defined, create a test file of ACTIVITY_MAXIMUM_BLOCKS using this value as an offset for the logical sectors (set to a new value to recreate the test file) #if defined(CUEBAND_WRITE_TEST_FILE) // These values for debugging only #define CUEBAND_ACTIVITY_EPOCH_INTERVAL 2 #define ACTIVITY_MAXIMUM_BLOCKS 512 + + #define CUEBAND_MAXIMUM_SAMPLES_PER_BLOCK 5 // Only for debugging (normally derived from available space) #else #define CUEBAND_ACTIVITY_EPOCH_INTERVAL 60 // 60 #define ACTIVITY_MAXIMUM_BLOCKS 512 // 512 = 128 kB, ~10 days; @@ -220,6 +222,9 @@ #if defined(CUEBAND_DEBUG_DUMMY_MISSING_BLOCKS) #warning "CUEBAND_DEBUG_DUMMY_MISSING_BLOCKS should not normally be defined" #endif +#if defined(CUEBAND_MAXIMUM_SAMPLES_PER_BLOCK) + #warning "CUEBAND_MAXIMUM_SAMPLES_PER_BLOCK should not normally be defined (usually all available space is used)" +#endif #endif // SystemTask.cpp: