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) {} }
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) {} }