-
Notifications
You must be signed in to change notification settings - Fork 7.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[I2S] removes code forcing two slots in PCM Short Slot (IDFGH-14064) #14879
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -318,8 +318,7 @@ void i2s_hal_tdm_set_tx_slot(i2s_hal_context_t *hal, bool is_slave, const i2s_ha | |
uint32_t msk = slot_cfg->tdm.slot_mask; | ||
/* Get the maximum slot number */ | ||
cnt = 32 - __builtin_clz(msk); | ||
/* There should be at least 2 slots in total even for mono mode */ | ||
cnt = cnt < 2 ? 2 : cnt; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. cnt = (cnt < 2) && (slot_cfg->tdm.ws_width != 1) ? 2 : cnt; There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd suggest:
as depending on the compiler optimization it may end up assigning zero to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you help to update the commit? |
||
|
||
uint32_t total_slot = slot_cfg->tdm.total_slot > cnt ? slot_cfg->tdm.total_slot : cnt; | ||
i2s_ll_tx_reset(hal->dev); | ||
i2s_ll_tx_set_slave_mod(hal->dev, is_slave); //TX Slave | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar here with adding
()
around the conditions.