diff --git a/source/main.cpp b/source/main.cpp index 3ea17390ee4ae12ca6be4435be0395f130c04619..dd9c87597453987967b9528d4db94cfdc7baad34 100755 --- a/source/main.cpp +++ b/source/main.cpp @@ -163,6 +163,25 @@ MicroBitImage Block::image() const { } +void debug_test() { + // XXX: simple debug test to check my FLASH images were stored correctly + while (true) { + // scroll random blocks down the screen + Block block; // make a new random Block + // starting positions: + int x = 1; + int y = -3; + // print image until scrolled down off the screen + while (y < 6) { + UBIT.display.clear(); + UBIT.display.print(block.image(), x, y); + y++; + UBIT.sleep(350); // 350ms sleep for 2.85 FPS + } + } +} + + int main() { // Initialise the micro:bit runtime. UBIT.init(); @@ -179,21 +198,7 @@ int main() { UBIT.display.scroll("BLOCKS!"); - // XXX: simple debug test to check my FLASH images were stored correctly - while (true) { - // scroll random blocks down the screen - Block block; // make a new random Block - // starting positions: - int x = 1; - int y = -3; - // print image until scrolled down off the screen - while (y < 6) { - UBIT.display.clear(); - UBIT.display.print(block.image(), x, y); - y++; - UBIT.sleep(350); // 350ms sleep for 2.85 FPS - } - } + debug_test(); // TODO: potentially remove this call, if clarified that it is not required. // If main exits, there may still be other fibers running or registered event handlers etc.