So.. now I have:
Code: Select all
// Define is missing for F0.
#ifndef RCC_CR_HSITRIM_4
#define RCC_CR_HSITRIM_4 0x80
#endif
RCC->CR = (RCC->CR & ~RCC_CR_HSITRIM) | RCC_CR_HSITRIM_4;
The easy fix would be to define the HSITRIM_4 bit just like the other families.
Or I might use:
( ( (RCC_CR_HSITRIM<<1)& ~ RCC_CR_HSITRIM) >> 1) // the highest bit of HSITRIM.
But I doubt that anybody (Including me in two weeks) reading that will understand.