]> mj.ucw.cz Git - home-hw.git/blobdiff - Src/display.c
Time display through USB
[home-hw.git] / Src / display.c
index a8aecf3db468c6def128af853b2000f74e65f020..2af6ad1e6bea0a423b34c2f4837741421620e631 100644 (file)
@@ -157,3 +157,35 @@ void display_counter(uint cnt)
       display_data_end();
     }
 }
       display_data_end();
     }
 }
+
+void display_buffer(byte *buf)
+{
+  for (uint p=0; p<4; p++)
+    {
+      display_cmd(SSD1306_SETSTARTPAGE + p);
+      display_cmd(SSD1306_SETHIGHCOLUMN);
+      display_cmd(SSD1306_SETLOWCOLUMN);
+      display_data_start();
+      for (uint i=0; i<5; i++)
+       {
+         uint ch = buf[i];
+         if (ch <= 10)
+           {
+             for (uint j=0; j<23; j++)
+               {
+                 byte x = Gentium23x32[(23*4+1)*ch + 1 + 4*j + p];
+                 display_data(x);
+               }
+           }
+         else
+           {
+             for (uint j=0; j<23; j++)
+               display_data(0);
+           }
+         display_data(0);
+         display_data(0);
+         display_data(0);
+       }
+      display_data_end();
+    }
+}