- gfx_blitRaster(&lcd_bitmap, 0, 0, customer_pw_logo, 122, 32, 4);
- lcd_blit_bitmap(&lcd_bitmap);
- emul_idle();
- sleep(1);
- //timer_delay(1000);
+}
+
+/**
+ * Show the splash screen
+ */
+void bouncing_logo(void)
+{
+ const long SPEED_SCALE = 1000;
+ const long GRAVITY_ACCEL = 10;
+ const long BOUNCE_ELASTICITY = 2;
+ long h = (long)(-project_grl_logo.height) * SPEED_SCALE;
+ long speed = 1000;
+
+ /* Repeat until logo stands still on the bottom edge */
+ while (!((speed == 0) && (h == 0)))
+ {
+ /* Move */
+ h += speed;
+
+ /* Gravity acceleration */
+ speed += GRAVITY_ACCEL;
+
+ if (h > 0 && speed > 0)
+ {
+ /* Bounce */
+ speed = - (speed / BOUNCE_ELASTICITY);
+
+ }
+
+ /* Update graphics */
+ gfx_bitmapClear(&lcd_bitmap);
+ gfx_blitImage(&lcd_bitmap,
+ (lcd_bitmap.width - project_grl_logo.width) / 2,
+ h / SPEED_SCALE,
+ &project_grl_logo);
+ lcd_blitBitmap(&lcd_bitmap);
+
+ timer_delay(10);
+ }
+}
+
+int main(int argc, char *argv[])
+{
+ emul_init(&argc, argv);
+ timer_init();
+ buz_init();
+ kbd_init();
+ lcd_init();
+ proc_init();
+
+ hello_world();
+ bouncing_logo();