You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
637 B

5 months ago
#include "system_func.h"
static volatile uint8_t usTickCountDiv;
void SystemCoreClockSet(SYSTEM_CORE_CLOCK_LIST clock)
{
switch(clock)
{
case HIRC_96MHZ:
usTickCountDiv = 48;
LP_SetOperatingVoltage(LP_OVR_1_1);
break;
case HIRC_48MHZ:
usTickCountDiv = 24;
LP_SetOperatingVoltage(LP_OVR_1_0);
break;
case HIRC_24MHZ:
usTickCountDiv = 12;
LP_SetOperatingVoltage(LP_OVR_0_9);
break;
default:
usTickCountDiv = 48;
LP_SetOperatingVoltage(LP_OVR_1_1);
break;;
}
}