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