~ruther/stm32h747i-disco-usb-image-viewer

c298348f285fbfddea5180435c867af1e2b429f6 — Rutherther 3 months ago 6107f1b
few minorities
3 files changed, 9 insertions(+), 3 deletions(-)

M include/clocks.h
M src/clocks.c
M src/main.c
M include/clocks.h => include/clocks.h +0 -1
@@ 45,6 45,5 @@ void clocks_pll_wait_ready(clock_pll_t pll, uint16_t timeout_us);
void clocks_system_clock_source(sysclock_source_t source, uint8_t d1cpre,
                                uint8_t d1ppre, uint8_t hpre,
                                uint16_t timeout_us);
uint8_t clocks_system_clock_wait_ready(uint16_t timeout_us);

#endif // CLOCKS_H

M src/clocks.c => src/clocks.c +1 -1
@@ 82,7 82,7 @@ void clocks_system_clock_source(sysclock_source_t source, uint8_t d1cpre, uint8_
                 ((d1cpre & 0xF) << RCC_D1CFGR_D1CPRE_Pos) |
                 ((d1ppre & 0x7) << RCC_D1CFGR_D1PPRE_Pos) |
                 ((hpre & 0xF) << RCC_D1CFGR_HPRE_Pos),
                 RCC_D1CFGR_D1CPRE | RCC_D1CFGR_D1PPRE | RCC_D1CFGR_HPRE);
                 RCC_D1CFGR_D1CPRE_Msk | RCC_D1CFGR_D1PPRE_Msk | RCC_D1CFGR_HPRE_Msk);
  reg_write_bits(&RCC->CFGR, source, RCC_CFGR_SW);
  while (reg_read_bits_pos(&RCC->CFGR, RCC_CFGR_SWS_Pos, 0x7) != source);
}

M src/main.c => src/main.c +8 -1
@@ 15,6 15,7 @@
#define LED1_PIN 12
/* #define LED2_PIN 13 */

pin_t wkup;
pin_t led1;
exti_t exti_wkup;



@@ 263,6 264,7 @@ void main()
  clocks_enable(CLOCK_HSI48);
  clocks_wait_ready(CLOCK_HSI48);

  // Enable HSE for PLLs
  clocks_enable(CLOCK_HSE);
  clocks_wait_ready(CLOCK_HSE);



@@ 273,6 275,12 @@ void main()
  clocks_pll_enable(CLOCK_PLL2);
  clocks_pll_wait_ready(CLOCK_PLL2, 300);

  /* clocks_pll_configure(CLOCK_PLL1, 1, 25, PLL_SOURCE_HSE, 200, 2, 2, 2); */
  /* clocks_pll_enable(CLOCK_PLL1); */
  /* clocks_pll_wait_ready(CLOCK_PLL1, 300); */

  /* clocks_system_clock_source(CLOCK_SOURCE_PLL_1_P_CK, 1, 1, 1, 300); */

  fmc_t fmc;
  init_fmc(&fmc);



@@ 289,7 297,6 @@ void main()
  pin_toggle(&led1);

  // pc13 input - wakeup button
  pin_t wkup;
  pin_init(&wkup, GPIOC, 13);
  pin_into_input(&wkup);


Do not follow this link