mirror of
https://github.com/cesanta/mongoose.git
synced 2024-12-28 23:49:44 +08:00
Use single-line comments
This commit is contained in:
parent
a113e344a1
commit
44b4944334
@ -158,8 +158,8 @@ struct mip_driver mip_driver_stm32 = {.init = mip_driver_stm32_init,
|
||||
.setrx = mip_driver_stm32_setrx,
|
||||
.up = mip_driver_stm32_up};
|
||||
|
||||
/* Calculate HCLK from clock settings,
|
||||
valid for STM32F74xxx/75xxx (5.3) and STM32F42xxx/43xxx (6.3) */
|
||||
// Calculate HCLK from clock settings,
|
||||
// valid for STM32F74xxx/75xxx (5.3) and STM32F42xxx/43xxx (6.3)
|
||||
static const uint8_t ahbptab[8] = {1, 2, 3, 4, 6, 7, 8, 9}; // log2(div)
|
||||
struct rcc {
|
||||
volatile uint32_t CR, PLLCFGR, CFGR;
|
||||
@ -179,7 +179,7 @@ static uint32_t hclk_get(void) {
|
||||
clk = MG_STM32_CLK_HSE;
|
||||
else
|
||||
clk = MG_STM32_CLK_HSI;
|
||||
vco = (uint32_t)((uint64_t)(((uint32_t) clk * (uint32_t) n)) /
|
||||
vco = (uint32_t) ((uint64_t) (((uint32_t) clk * (uint32_t) n)) /
|
||||
((uint32_t) m));
|
||||
clk = vco / p;
|
||||
} else {
|
||||
@ -190,14 +190,14 @@ static uint32_t hclk_get(void) {
|
||||
return ((uint32_t) clk) >> ahbptab[hpre - 8];
|
||||
}
|
||||
|
||||
/* Guess CR from HCLK:
|
||||
MDC clock is generated from HCLK (AHB); as per 802.3, it must not exceed 2.5MHz
|
||||
As the AHB clock can be (and usually is) derived from the HSI (internal RC),
|
||||
and it can go above specs, the datasheets specify a range of frequencies and
|
||||
activate one of a series of dividers to keep the MDC clock safely below 2.5MHz.
|
||||
We guess a divider setting based on HCLK with a +5% drift.
|
||||
If the user uses a different clock from our defaults, needs to set the macros on top
|
||||
Valid for STM32F74xxx/75xxx (38.8.1) and STM32F42xxx/43xxx (33.8.1) (both 4.5% worst case drift) */
|
||||
// Guess CR from HCLK. MDC clock is generated from HCLK (AHB); as per 802.3,
|
||||
// it must not exceed 2.5MHz As the AHB clock can be (and usually is) derived
|
||||
// from the HSI (internal RC), and it can go above specs, the datasheets
|
||||
// specify a range of frequencies and activate one of a series of dividers to
|
||||
// keep the MDC clock safely below 2.5MHz. We guess a divider setting based on
|
||||
// HCLK with a +5% drift. If the user uses a different clock from our
|
||||
// defaults, needs to set the macros on top Valid for STM32F74xxx/75xxx
|
||||
// (38.8.1) and STM32F42xxx/43xxx (33.8.1) (both 4.5% worst case drift)
|
||||
#define CRDTAB_LEN 6
|
||||
static const uint8_t crdtab[CRDTAB_LEN][2] = {
|
||||
// [{setting, div ratio},...]
|
||||
|
Loading…
x
Reference in New Issue
Block a user