/* plugin entry point */ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) { bool exit = false; /* plugin init */ TEST_PLUGIN_API(api); (void)parameter; rb = api; /* end of plugin init */ while(!exit) { switch(minesweeper()){ case MINESWEEPER_WIN: rb->splash(HZ*2, true, "You Win :)"); break; case MINESWEEPER_LOSE: rb->splash(HZ*2, true, "You Lost :("); break; case MINESWEEPER_USB: return PLUGIN_USB_CONNECTED; case MINESWEEPER_QUIT: exit = true; break; default: break; } } return PLUGIN_OK; }
/* plugin entry point */ enum plugin_status plugin_start(const void* parameter) { bool exit = false; (void)parameter; #if LCD_DEPTH > 1 rb->lcd_set_backdrop(NULL); #endif while( !exit ) { switch( minesweeper() ) { case MINESWEEPER_WIN: rb->splash( HZ, "You Win!" ); rb->lcd_clear_display(); mine_show(); break; case MINESWEEPER_LOSE: rb->splash( HZ, "You Lose!" ); rb->lcd_clear_display(); mine_show(); break; case MINESWEEPER_USB: return PLUGIN_USB_CONNECTED; case MINESWEEPER_QUIT: exit = true; break; default: break; } } return PLUGIN_OK; }