int main(void)
{
  for (u32 i = 0; i < 600000; i++)
    __asm__("nop");

	led_setup();
  led_on(LED_GREEN);
  led_on(LED_RED);

  /* NAP is not required for this test. */
  nap_conf_b_setup();
  nap_conf_b_clear();

  sbp_setup(0, 0);

  while (1) {
    led_toggle(LED_RED);
    led_toggle(LED_GREEN);
    for (int i = 0; i < 10000; i++) /* Wait a bit. */
      __asm__("NOP");
    printf("ABCDEFGHIJKLMNOPQRSTUVWXYZ\n\r");
  }

	return 0;
}
Beispiel #2
0
int main(void)
{

  led_setup();
  led_on(LED_GREEN);
  led_on(LED_RED);

  /* Setup and hold the FPGA PROGRAM_B line low so that the FPGA does not
   * contest the flash SPI bus */
  nap_conf_b_setup();
  nap_conf_b_clear();

  spi_setup();
  sbp_setup(0);
  m25_setup();
  stm_flash_callbacks_setup();

  for (u32 i = 0; i < 600000; i++)
    __asm__("nop");

  printf("\n\nFirmware info - git: " GIT_VERSION ", built: " __DATE__ " " __TIME__ "\n");
  printf("--- M25 FLASH TEST ---\n");

  while (1) {
    DO_EVERY(300,
      led_toggle(LED_GREEN);
      led_toggle(LED_RED);
    );
    sbp_process_messages();
  }