}
/*
- * makes a buffer for sending to the watch from the drawing buffer, e.g.
+ * makes a buffer for sending to the LCD watch from the drawing buffer, e.g.
* mw_send_bitmap(mw_fd, MW_SCREEN_MODE_IDLE, 96, 65, 31, bbuf, len);
+ *
+ * NOT reentrant !
*/
unsigned char *mw_make_mw_buffer(mw_buffer *mwbuf, int *buflen)
{
return wbuf;
}
+unsigned char *mw_make_mw_oled_buffer(mw_buffer *mwbuf, int *buflen)
+{
+ static unsigned char wbuf[2*80]; /* size of one OLED, two rows */
+ int x, y;
+ unsigned char clr;
+
+ memset(wbuf, 0, 2*80);
+
+ for (x=0; x<mwbuf->res_x; x++) {
+ for (y=0; y<mwbuf->res_y; y++) {
+ clr = *(unsigned char *)(mwbuf->pbuf+((y*mwbuf->res_x)+x));
+ if (clr) {
+ *(unsigned char *)(wbuf+(x+80*(y/8))) |= 1 << (7-(y%8));
+ }
+ }
+ }
+ *buflen = (mwbuf->res_y / 8) * 80;
+
+ return wbuf;
+}
+
void mw_dump_mw_buffer(mw_buffer *mwbuf)
{
int x, y;