cancel
Showing results for 
Search instead for 
Did you mean: 

Bug in CLK_GetClockFreq, stm8l15x_clk.c, V1.5.0

FordFairlane
Associate III
Posted on April 25, 2012 at 10:19

I think this is wrong:

CONST uint8_t SYSDivFactor[5] = {1, 2, 4, 8, 16}; /*!< Holds the different Master clock Divider factors */

It should be like this:

CONST uint8_t SYSDivFactor[8] = {1, 2, 4, 8, 16, 32, 64, 128}; /*!< Holds the different Master clock Divider factors */

Because of this:

typedef enum {

  CLK_SYSCLKDiv_1   = (uint8_t)0x00, /*!< System Clock Divider: 1 */

  CLK_SYSCLKDiv_2   = (uint8_t)0x01, /*!< System Clock Divider: 2 */

  CLK_SYSCLKDiv_4   = (uint8_t)0x02, /*!< System Clock Divider: 4 */

  CLK_SYSCLKDiv_8   = (uint8_t)0x03, /*!< System Clock Divider: 8 */

  CLK_SYSCLKDiv_16  = (uint8_t)0x04, /*!< System Clock Divider: 16 */

  CLK_SYSCLKDiv_32  = (uint8_t)0x05, /*!< System Clock Divider: 32 */

  CLK_SYSCLKDiv_64  = (uint8_t)0x06, /*!< System Clock Divider: 64 */

  CLK_SYSCLKDiv_128 = (uint8_t)0x07  /*!< System Clock Divider: 128 */

} CLK_SYSCLKDiv_TypeDef;

Right?

0 REPLIES 0