summaryrefslogtreecommitdiff
path: root/apps/abrepeat.h
diff options
context:
space:
mode:
Diffstat (limited to 'apps/abrepeat.h')
-rw-r--r--apps/abrepeat.h11
1 files changed, 0 insertions, 11 deletions
diff --git a/apps/abrepeat.h b/apps/abrepeat.h
index ec0a07c827..f7ee65247c 100644
--- a/apps/abrepeat.h
+++ b/apps/abrepeat.h
@@ -41,9 +41,7 @@ void ab_set_B_marker(unsigned int song_position);
41 * The actual positions are returned via output parameter */ 41 * The actual positions are returned via output parameter */
42bool ab_get_A_marker(unsigned int *song_position); 42bool ab_get_A_marker(unsigned int *song_position);
43bool ab_get_B_marker(unsigned int *song_position); 43bool ab_get_B_marker(unsigned int *song_position);
44#if (CONFIG_CODEC == SWCODEC)
45void ab_end_of_track_report(void); 44void ab_end_of_track_report(void);
46#endif
47 45
48/* These functions really need to be inlined for speed */ 46/* These functions really need to be inlined for speed */
49extern unsigned int ab_A_marker; 47extern unsigned int ab_A_marker;
@@ -59,16 +57,9 @@ static inline bool ab_reached_B_marker(unsigned int song_position)
59/* following is the size of the window in which we'll detect that the B marker 57/* following is the size of the window in which we'll detect that the B marker
60was hit; it must be larger than the frequency (in milliseconds) at which this 58was hit; it must be larger than the frequency (in milliseconds) at which this
61function is called otherwise detection of the B marker will be unreliable */ 59function is called otherwise detection of the B marker will be unreliable */
62#if (CONFIG_CODEC == SWCODEC)
63/* On swcodec, the worst case seems to be 9600kHz with 1024 samples between 60/* On swcodec, the worst case seems to be 9600kHz with 1024 samples between
64 * calls, meaning ~9 calls per second, look within 1/5 of a second */ 61 * calls, meaning ~9 calls per second, look within 1/5 of a second */
65#define B_MARKER_DETECT_WINDOW 200 62#define B_MARKER_DETECT_WINDOW 200
66#else
67/* we assume that this function will be called on each system tick and derive
68the window size from this with a generous margin of error (note: the number
69of ticks per second is given by HZ) */
70#define B_MARKER_DETECT_WINDOW ((1000/HZ)*10)
71#endif
72 if (ab_B_marker != AB_MARKER_NONE) 63 if (ab_B_marker != AB_MARKER_NONE)
73 { 64 {
74 if ( (song_position >= ab_B_marker) 65 if ( (song_position >= ab_B_marker)
@@ -78,7 +69,6 @@ of ticks per second is given by HZ) */
78 return false; 69 return false;
79} 70}
80 71
81#if (CONFIG_CODEC == SWCODEC)
82static inline void ab_position_report(unsigned long position) 72static inline void ab_position_report(unsigned long position)
83{ 73{
84 if (ab_repeat_mode_enabled()) 74 if (ab_repeat_mode_enabled())
@@ -90,7 +80,6 @@ static inline void ab_position_report(unsigned long position)
90 } 80 }
91 } 81 }
92} 82}
93#endif
94 83
95#endif 84#endif
96 85