Skip to content

Commit

Permalink
Merge pull request #443 from xross/develop
Browse files Browse the repository at this point in the history
Allow special mclk/blck divide == 1 case in debug asserts
  • Loading branch information
xross authored Nov 8, 2024
2 parents d05e1d9 + f5752d1 commit 50e3cba
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib_xua/src/core/audiohub/xua_audiohub.xc
Original file line number Diff line number Diff line change
Expand Up @@ -726,13 +726,14 @@ void XUA_AudioHub(chanend ?c_aud, clock ?clk_audio_mclk, clock ?clk_audio_bclk,
#endif
divide = mClk / (curSamFreq * numBits);

//Do some checks
// Do some checks
xassert((divide > 0) && "Error: divider is 0, BCLK rate unachievable");

unsigned remainder = mClk % ( curSamFreq * numBits);
xassert((!remainder) && "Error: MCLK not divisible into BCLK by an integer number");

unsigned divider_is_odd = divide & 0x1;
/* Ignore special divide = 1 case */
unsigned divider_is_odd = (divide & 0x1) && (divide != 1);
xassert((!divider_is_odd) && "Error: divider is odd, clockblock cannot produce desired BCLK");

}
Expand Down

0 comments on commit 50e3cba

Please sign in to comment.