示例#1
0
void init(void)
{
  /* Delay on start-up as some programmers reset the STM twice. */
  for (u32 i = 0; i < 600000; i++)
    __asm__("nop");

  led_setup();

  nap_setup();

  s32 serial_number = nap_conf_rd_serial_number();
  if (serial_number < 0) {
    /* TODO: Handle this properly! */
    serial_number = 0x2222;
  }
  sbp_setup(serial_number);

  fault_handling_setup();

  nap_callbacks_setup();

  reset_callback_register();

  flash_callbacks_register();

  stm_unique_id_callback_register();
}
示例#2
0
void init(void)
{
  fault_handling_setup();
  reset_callback_register();

  nap_version_check();
  nap_auth_check();
  nap_callbacks_setup();

  rng_setup();
  srand(random_int());

  stm_unique_id_callback_register();
}