+ /* Divider is enabled and used */\r
+ if(0 == FDIV)\r
+ {\r
+ /* No fractional divider, so MCLK = DCO_Clk / (2 * IDIV) */\r
+ Clock = MCLK_MHZ / IDIV;\r
+ }\r
+ else\r
+ {\r
+ /* Both integer and fractional divider must be considered */\r
+ /* 1. IDIV + FDIV/256 */\r
+ Q_24_8 FDiv_IDiv_Sum = (IDIV << FRACBITS) + FDIV; \r
+\r
+ /* 2. Fixed point division Q24.8 / Q9.8 = Q15.0 */\r
+ Q_15_0 ClockVal = (DCO_DCLK_MULTIPLIER << FRACBITS)/ FDiv_IDiv_Sum;\r
+ Clock = ((uint32_t)ClockVal) * KHZ_MULTIPLIER;\r
+ Clock = Clock >> DCO_DCLK_DIVIDER;\r
+ }\r