X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=src%2Fstm%2Fao_flash_stm_pins.h;h=b82046d7fca221ec200ddb00e84aad75ea3c7ccb;hp=d157a2265eae9e85b4270bc29bbd91ddc1c6e22e;hb=2f87e182d9f0b3c2856f62149371ad70b16148cf;hpb=106d212ff5920c39d95751ef6249dc141970412c diff --git a/src/stm/ao_flash_stm_pins.h b/src/stm/ao_flash_stm_pins.h index d157a226..b82046d7 100644 --- a/src/stm/ao_flash_stm_pins.h +++ b/src/stm/ao_flash_stm_pins.h @@ -3,7 +3,8 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of @@ -20,6 +21,10 @@ #include +#ifndef AO_PLLMUL + +#if AO_HSE == 8000000 + /* PLLVCO = 96MHz (so that USB will work) */ #define AO_PLLMUL 12 #define AO_RCC_CFGR_PLLMUL (STM_RCC_CFGR_PLLMUL_12) @@ -28,6 +33,22 @@ #define AO_PLLDIV 3 #define AO_RCC_CFGR_PLLDIV (STM_RCC_CFGR_PLLDIV_3) +#endif + +#if AO_HSE == 16000000 + +/* PLLVCO = 96MHz (so that USB will work) */ +#define AO_PLLMUL 6 +#define AO_RCC_CFGR_PLLMUL (STM_RCC_CFGR_PLLMUL_6) + +/* SYSCLK = 32MHz */ +#define AO_PLLDIV 3 +#define AO_RCC_CFGR_PLLDIV (STM_RCC_CFGR_PLLDIV_3) + +#endif + +#endif + /* HCLK = 32MHZ (CPU clock) */ #define AO_AHB_PRESCALER 1 #define AO_RCC_CFGR_HPRE_DIV STM_RCC_CFGR_HPRE_DIV_1