components/driver/i2s.c
/**
 * @brief Get max actived channel number
 *
 * @param chan_mask I2S channel mask that indicates which channels are actived
 * @return
 *      - Max actived channel number
 */
@brief Get max actived channel number
@param chan_mask I2S channel mask that indicates which channels are actived
@return
- Max actived channel number
@brief Get max actived channel number @param chan_mask I2S channel mask that indicates which channels are actived @return - Max actived channel number
static uint32_t i2s_get_max_channel_num(i2s_channel_t chan_mask)
{
    uint32_t max_chan = 0;
    uint32_t channel = chan_mask & 0xFFFF;
    for (int i = 0; channel && i < 16; i++, channel >>= 1) {
        if (channel & 0x01) {
            max_chan = i + 1;
        }
    }
    return max_chan < 2 ? 2 : max_chan;
}
static uint32_t i2s_get_max_channel_num ( i2s_channel_t chan_mask ) { uint32_t max_chan = 0 ; uint32_t channel = chan_mask & 0xFFFF ; for ( int i = 0 ; channel && i < 16 ; i ++ , channel >>= 1 ) { if ( channel & 0x01 ) { max_chan = i + 1 ; } } return max_chan < 2 ? 2 : max_chan ; }
@brief Get max actived channel number
 @param chan_mask I2S channel mask that indicates which channels are actived
 @return
      - Max actived channel number
@brief Get max actived channel number @param chan_mask I2S channel mask that indicates which channels are actived @return - Max actived channel number
/* Can't be smaller than 2 */