コード例 #1
0
ファイル: test_atomic.c プロジェクト: ffabbri4/libatomic_ops
int main(void)
{
  test_atomic();
  test_atomic_acquire();
  test_atomic_release();
  test_atomic_read();
  test_atomic_write();
  test_atomic_full();
  test_atomic_release_write();
  test_atomic_acquire_read();
  test_atomic_dd_acquire_read();
# if defined(AO_HAVE_fetch_and_add1) && defined(AO_HAVE_fetch_and_sub1)
    run_parallel(4, add1sub1_thr, add1sub1_test, "add1/sub1");
# endif
# if defined(AO_HAVE_store_release_write) && defined(AO_HAVE_load_acquire_read)
    run_parallel(3, acqrel_thr, acqrel_test,
         "store_release_write/load_acquire_read");
# endif
# if defined(AO_HAVE_test_and_set_acquire)
    run_parallel(5, test_and_set_thr, test_and_set_test,
         "test_and_set");
# endif
  test_atomic_emulation();
  return 0;
}
コード例 #2
0
int main(void)
{
	board_init();

	if (test_erase() == STATUS_OK) {
		/* Toggle LED to indicate success */
		gpio_toggle_pin(LED_PIN_0);
	}

	if (test_write() == STATUS_OK) {
		/* Toggle LED to indicate success */
		gpio_toggle_pin(LED_PIN_1);
	}

	if (test_atomic_write() == STATUS_OK) {
		/* Toggle LED to indicate success */
		gpio_toggle_pin(LED_PIN_2);
	}

	if (test_split_write() == STATUS_OK) {
		/* Toggle LED to indicate success */
		gpio_toggle_pin(LED_PIN_3);
	}

	if (test_erase_bytes() == STATUS_OK) {
		/* Toggle LED to indicate success */
		gpio_toggle_pin(LED_PIN_4);
	}

	/* Toggle LED to indicate that we are done */
	gpio_toggle_pin(LED_PIN_7);

	while (true) {}

}
コード例 #3
0
ファイル: example2_xmega_gfx.c プロジェクト: InSoonPark/asf
int main(void)
{
	board_init();

	// Initialize graphics library
	gfx_mono_init();

	// Enable backlight
	ioport_set_pin_high(LCD_BACKLIGHT_ENABLE_PIN);

	gfx_mono_draw_string("Tests successful: \r\n1   2   3   4   5",
			0, 0, &sysfont);

	if (test_erase() == STATUS_OK) {
		gfx_mono_draw_string("OK",
				0, 2 * SYSFONT_HEIGHT + 1, &sysfont);
	} else {
		gfx_mono_draw_string("ERR",
				0, 2 * SYSFONT_HEIGHT + 1, &sysfont);
	}

	if (test_write() == STATUS_OK) {
		gfx_mono_draw_string("OK",
				4 * SYSFONT_WIDTH, 2 * SYSFONT_HEIGHT + 1, &sysfont);
	} else {
		gfx_mono_draw_string("ERR",
				4 * SYSFONT_WIDTH, 2 * SYSFONT_HEIGHT + 1, &sysfont);
	}

	if (test_atomic_write() == STATUS_OK) {
		gfx_mono_draw_string("OK",
				8 * SYSFONT_WIDTH, 2 * SYSFONT_HEIGHT + 1, &sysfont);
	} else {
		gfx_mono_draw_string("ERR",
				8 * SYSFONT_WIDTH, 2 * SYSFONT_HEIGHT + 1, &sysfont);
	}

	if (test_split_write() == STATUS_OK) {
		gfx_mono_draw_string("OK",
				12 * SYSFONT_WIDTH, 2 * SYSFONT_HEIGHT + 1, &sysfont);
	} else {
		gfx_mono_draw_string("ERR",
				12 * SYSFONT_WIDTH, 2 * SYSFONT_HEIGHT + 1, &sysfont);
	}

	if (test_erase_bytes() == STATUS_OK) {
		gfx_mono_draw_string("OK",
				16 * SYSFONT_WIDTH, 2 * SYSFONT_HEIGHT + 1, &sysfont);
	} else {
		gfx_mono_draw_string("ERR",
				16 * SYSFONT_WIDTH, 2 * SYSFONT_HEIGHT + 1, &sysfont);
	}

	while (true) {}

}