summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReinhard Panhuber <[email protected]>2022-03-16 07:13:38 +0100
committerReinhard Panhuber <[email protected]>2022-03-16 07:13:38 +0100
commit92ac041869b79aba6948e6440bbfc51ba77130ac (patch)
tree02972648b29d53313a941a842978ac6cfcbc48a8
parent90502739c34b8cbcf37229031eb4f575c33311fa (diff)
Add todos and comments
-rw-r--r--src/class/audio/audio_device.c2
-rw-r--r--src/device/usbd.c12
2 files changed, 9 insertions, 5 deletions
diff --git a/src/class/audio/audio_device.c b/src/class/audio/audio_device.c
index 1dbeb7643..37bf76135 100644
--- a/src/class/audio/audio_device.c
+++ b/src/class/audio/audio_device.c
@@ -2047,6 +2047,8 @@ void audiod_sof (uint8_t rhport, uint32_t frame_count)
uint32_t n_cylces = tud_audio_n_get_fm_n_cycles_cb(rhport, audio->ep_fb);
uint32_t feedback = ((n_cylces - audio->n_cycles_old) << 3) * audio->feeback_param_factor_N / audio->feeback_param_factor_D; // feeback_param_factor_N has scaling factor of 13 bits, n_cycles 3 and feeback_param_factor_D 1, hence 16.16 precision
+ // TODO: Implement fast computation in case n_frames * f_s / f_m is a power of two
+
tud_audio_n_fb_set(i, feedback);
audio->n_frames_current = 0;
audio->n_cycles_old = n_cylces;
diff --git a/src/device/usbd.c b/src/device/usbd.c
index 6170c2bda..96ac19c8d 100644
--- a/src/device/usbd.c
+++ b/src/device/usbd.c
@@ -587,11 +587,12 @@ void tud_task (void)
case DCD_EVENT_SOF:
TU_LOG2("\r\n");
- for ( uint8_t i = 0; i < TOTAL_DRIVER_COUNT; i++ )
- {
- usbd_class_driver_t const * driver = get_driver(i);
- if ( driver->sof ) driver->sof(event.rhport, event.sof.frame_count);
- }
+ // TODO: Should this really be done here in the queue? How to distinguish the calls here from those SOF events which should be handled directly in the ISR routine? If we do it like this, the SOF routines get called two time right now, once in the ISR context and once again here
+// for ( uint8_t i = 0; i < TOTAL_DRIVER_COUNT; i++ )
+// {
+// usbd_class_driver_t const * driver = get_driver(i);
+// if ( driver->sof ) driver->sof(event.rhport, event.sof.frame_count);
+// }
break;
case USBD_EVENT_FUNC_CALL:
@@ -1410,6 +1411,7 @@ void usbd_edpt_close(uint8_t rhport, uint8_t ep_addr)
void usbd_sof_enable(uint8_t rhport, bool en)
{
+ // TODO: Check needed if all drivers including the user sof_cb does not need an active SOF ISR any more. Only if all drivers switched off SOF calls the SOF interrupt may be disabled
dcd_sof_enable(rhport, en);
}