You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • Sure - there's nothing built-in, but it's what I use for testing:

    function getClockSource() {
      return ["NONE","LSE","LSI","HSE"][((peek32(0x40­021020)&768)>>8)];
    }
    getClockSource();
    

    It checks the actual registers in the chip to see what it's set to.

  • Thank you Gordon!

    I listed the meaning of the abbreviations below, for any one else who might also use the snippet:
    LSE = Low-speed external user clock
    LSI = Low-speed internal
    HSE = High-speed external user clock

About

Avatar for Gordon @Gordon started