summaryrefslogtreecommitdiffstats
path: root/app/main.c
blob: 8c51c90f424c666540eaf1f3bc7b6c90abdd012e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#include "project.h"

extern uint32_t dfu_flag;



int
main (void)
{
  /*set up pll */
  //rcc_clock_setup_in_hse_8mhz_out_24mhz ();
  //rcc_clock_setup_in_hse_8mhz_out_72mhz ();
  //rcc_clock_setup_in_hsi_out_48mhz();

  rcc_clock_setup_in_hse_8mhz_out_48mhz ();

  /*turn on clocks to peripherals */
  rcc_periph_clock_enable (RCC_GPIOA);
  rcc_periph_clock_enable (RCC_GPIOB);
  rcc_periph_clock_enable (RCC_GPIOC);
  rcc_periph_clock_enable (RCC_AFIO);


  ticker_init ();
  led_init ();
#ifndef SLIM
  i2c_bb_init ();
  lcd_init ();
#endif

  adc_init ();
  key_init ();
  state_init ();
  usb_init ();

  usb_run ();

  return 0;
}