...

Dependencies:   DS_1337 Grove_OLED_Display_128X64 mbed

Files at this revision

API Documentation at this revision

Comitter:
loovee
Date:
Tue Apr 01 07:05:54 2014 +0000
Commit message:
...

Changed in this revision

DS_1337.lib Show annotated file Show diff for this revision Revisions of this file
Grove_OLED_Display_128X64.lib Show annotated file Show diff for this revision Revisions of this file
font_watch.h Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r 4683a4a41f47 DS_1337.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/DS_1337.lib	Tue Apr 01 07:05:54 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/loovee/code/DS_1337/#f4f9b627adf9
diff -r 000000000000 -r 4683a4a41f47 Grove_OLED_Display_128X64.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Grove_OLED_Display_128X64.lib	Tue Apr 01 07:05:54 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/loovee/code/Grove_OLED_Display_128X64/#1ec2545f0516
diff -r 000000000000 -r 4683a4a41f47 font_watch.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/font_watch.h	Tue Apr 01 07:05:54 2014 +0000
@@ -0,0 +1,526 @@
+#ifndef __FONT_WATCH_H__
+#define __FONT_WATCH_H__
+
+const unsigned char font_num[10][44] = 
+{
+
+/*--  文字:  0  --*/
+/*--  Arial Narrow18;  此字体下对应的点阵为:宽x高=11x29   --*/
+/*--  高度不是8的倍数,现调整为:宽度x高度=11x32  --*/
+0x00,0x00,0x80,0xC0,0xC0,0xC0,0xC0,0xC0,0x80,0x00,0x00,
+0xFC,0xFF,0xFF,0xFF,0x07,0x01,0x1F,0xFF,0xFF,0xFF,0x00,
+0x07,0x1F,0x3F,0x7F,0x7C,0x70,0x7F,0x7F,0x3F,0x1F,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+
+/*--  文字:  1  --*/
+/*--  Arial Narrow18;  此字体下对应的点阵为:宽x高=11x29   --*/
+/*--  高度不是8的倍数,现调整为:宽度x高度=11x32  --*/
+0x00,0x00,0x00,0x00,0x80,0xC0,0xC0,0xC0,0xC0,0x00,0x00,0x00,0x38,0x3C,0x1E,0xFF,
+0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x7F,0x7F,0x7F,0x7F,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+
+/*--  文字:  2  --*/
+/*--  Arial Narrow18;  此字体下对应的点阵为:宽x高=11x29   --*/
+/*--  高度不是8的倍数,现调整为:宽度x高度=11x32  --*/
+0x00,0x00,0x80,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0x80,0x00,0x0C,0x0F,0x0F,0x0F,0x87,
+0xC1,0xF3,0xFF,0xFF,0x7F,0x00,0x70,0x78,0x7E,0x7F,0x7F,0x7F,0x73,0x71,0x70,0x70,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+
+/*--  文字:  3  --*/
+/*--  Arial Narrow18;  此字体下对应的点阵为:宽x高=11x29   --*/
+/*--  高度不是8的倍数,现调整为:宽度x高度=11x32  --*/
+0x00,0x00,0x80,0xC0,0xC0,0xC0,0xC0,0xC0,0x80,0x00,0x00,0x04,0x07,0x07,0x07,0xE7,
+0xF1,0xFF,0xFF,0xBF,0x9F,0x00,0x0C,0x3C,0x3C,0x7C,0x78,0x70,0x79,0x7F,0x3F,0x3F,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+
+/*--  文字:  4  --*/
+/*--  Arial Narrow18;  此字体下对应的点阵为:宽x高=11x29   --*/
+/*--  高度不是8的倍数,现调整为:宽度x高度=11x32  --*/
+0x00,0x00,0x00,0x00,0x00,0xC0,0xC0,0xC0,0xC0,0xC0,0x00,0x00,0xC0,0xF0,0xFC,0xFF,
+0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x0F,0x0F,0x0F,0x0F,0x0E,0x7F,0x7F,0x7F,0x7F,0x7F,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+
+/*--  文字:  5  --*/
+/*--  Arial Narrow18;  此字体下对应的点阵为:宽x高=11x29   --*/
+/*--  高度不是8的倍数,现调整为:宽度x高度=11x32  --*/
+0x00,0x00,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0x00,0x40,0x7F,0x7F,0x7F,0x7F,
+0x39,0x79,0xF9,0xF9,0xF1,0x00,0x06,0x1E,0x3E,0x7E,0x7C,0x70,0x78,0x7F,0x3F,0x3F,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+
+/*--  文字:  6  --*/
+/*--  Arial Narrow18;  此字体下对应的点阵为:宽x高=11x29   --*/
+/*--  高度不是8的倍数,现调整为:宽度x高度=11x32  --*/
+0x00,0x00,0x80,0xC0,0xC0,0xC0,0xC0,0xC0,0x80,0x00,0x00,0xFC,0xFF,0xFF,0xFF,0xFF,
+0x71,0xF7,0xF7,0xF7,0xE7,0x00,0x07,0x1F,0x3F,0x7F,0x7F,0x70,0x78,0x7F,0x3F,0x3F,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+
+/*--  文字:  7  --*/
+/*--  Arial Narrow18;  此字体下对应的点阵为:宽x高=11x29   --*/
+/*--  高度不是8的倍数,现调整为:宽度x高度=11x32  --*/
+0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0x00,0x01,0x01,0x01,0xC1,0xF1,
+0xFD,0xFF,0x7F,0x0F,0x03,0x00,0x00,0x00,0x7C,0x7F,0x7F,0x7F,0x07,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+
+/*--  文字:  8  --*/
+/*--  Arial Narrow18;  此字体下对应的点阵为:宽x高=11x29   --*/
+/*--  高度不是8的倍数,现调整为:宽度x高度=11x32  --*/
+0x00,0x80,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0x80,0x00,0x06,0xDF,0xFF,0xFF,0xFF,
+0x71,0xFF,0xFF,0xFF,0xDF,0x00,0x0F,0x3F,0x3F,0x7F,0x78,0x70,0x78,0x7F,0x3F,0x3F,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+
+/*--  文字:  9  --*/
+/*--  Arial Narrow18;  此字体下对应的点阵为:宽x高=11x29   --*/
+/*--  高度不是8的倍数,现调整为:宽度x高度=11x32  --*/
+0x00,0x80,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0x80,0x00,0x00,0x7F,0xFF,0xFF,0xFF,0xE3,
+0xC1,0xFF,0xFF,0xFF,0xFF,0xFC,0x0C,0x3C,0x7D,0x7D,0x79,0x71,0x7F,0x7F,0x3F,0x1F,
+0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+};
+
+const unsigned char font_dot[] = 
+{/*--  文字:  :  --*/
+/*--  Arial Narrow18;  此字体下对应的点阵为:宽x高=7x29   --*/
+/*--  高度不是8的倍数,现调整为:宽度x高度=7x32  --*/
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x38,0x38,0x38,0x38,0x38,0x00,
+0x00,0x70,0x70,0x70,0x70,0x70,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00
+};
+
+
+//8*16 font
+const unsigned char font_ascii[95][16] = 
+{
+/*--  文字:     --*/
+/*--  @宋体11;  此字体下对应的点阵为:宽x高=8x14   --*/
+/*--  高度不是8的倍数,现调整为:宽度x高度=8x16  --*/
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+
+/*--  文字:  !  --*/
+/*--  @宋体11;  此字体下对应的点阵为:宽x高=8x14   --*/
+/*--  高度不是8的倍数,现调整为:宽度x高度=8x16  --*/
+0x00,0x00,0x00,0xFC,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x0D,0x0D,0x00,0x00,0x00,
+
+/*--  文字:  "  --*/
+/*--  @宋体11;  此字体下对应的点阵为:宽x高=8x14   --*/
+/*--  高度不是8的倍数,现调整为:宽度x高度=8x16  --*/
+0x00,0x08,0x0C,0x0E,0x0E,0x06,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+
+/*--  文字:  #  --*/
+/*--  @宋体11;  此字体下对应的点阵为:宽x高=8x14   --*/
+/*--  高度不是8的倍数,现调整为:宽度x高度=8x16  --*/
+0x10,0xD0,0xFC,0x3C,0xD0,0xFC,0x3C,0x00,0x01,0x0F,0x0F,0x01,0x0F,0x0F,0x01,0x00,
+
+/*--  文字:  $  --*/
+/*--  @宋体11;  此字体下对应的点阵为:宽x高=8x14   --*/
+/*--  高度不是8的倍数,现调整为:宽度x高度=8x16  --*/
+0x00,0x38,0x7C,0xFE,0xFE,0x9C,0x18,0x00,0x00,0x06,0x0E,0x1F,0x1F,0x0F,0x07,0x00,
+
+/*--  文字:  %  --*/
+/*--  @宋体11;  此字体下对应的点阵为:宽x高=8x14   --*/
+/*--  高度不是8的倍数,现调整为:宽度x高度=8x16  --*/
+0x78,0xFC,0xFC,0xF8,0xFC,0xCC,0x80,0x00,0x00,0x0C,0x0F,0x07,0x0F,0x0F,0x07,0x00,
+
+/*--  文字:  &  --*/
+/*--  @宋体11;  此字体下对应的点阵为:宽x高=8x14   --*/
+/*--  高度不是8的倍数,现调整为:宽度x高度=8x16  --*/
+0x80,0xF8,0xFC,0xFC,0xF8,0xC0,0x40,0x00,0x07,0x0F,0x09,0x0F,0x0F,0x0B,0x0C,0x04,
+
+/*--  文字:  '  --*/
+/*--  @宋体11;  此字体下对应的点阵为:宽x高=8x14   --*/
+/*--  高度不是8的倍数,现调整为:宽度x高度=8x16  --*/
+0x00,0x12,0x1E,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+
+/*--  文字:  (  --*/
+/*--  @宋体11;  此字体下对应的点阵为:宽x高=8x14   --*/
+/*--  高度不是8的倍数,现调整为:宽度x高度=8x16  --*/
+0x00,0x00,0x00,0xF0,0xFC,0x0E,0x02,0x00,0x00,0x00,0x00,0x03,0x0F,0x1C,0x10,0x00,
+
+/*--  文字:  )  --*/
+/*--  @宋体11;  此字体下对应的点阵为:宽x高=8x14   --*/
+/*--  高度不是8的倍数,现调整为:宽度x高度=8x16  --*/
+0x00,0x02,0x0E,0xFC,0xF0,0x00,0x00,0x00,0x00,0x10,0x1C,0x0F,0x03,0x00,0x00,0x00,
+
+/*--  文字:  *  --*/
+/*--  @宋体11;  此字体下对应的点阵为:宽x高=8x14   --*/
+/*--  高度不是8的倍数,现调整为:宽度x高度=8x16  --*/
+0x00,0x90,0xF0,0xF8,0xF8,0xF0,0x90,0x00,0x00,0x00,0x00,0x01,0x01,0x00,0x00,0x00,
+
+/*--  文字:  +  --*/
+/*--  @宋体11;  此字体下对应的点阵为:宽x高=8x14   --*/
+/*--  高度不是8的倍数,现调整为:宽度x高度=8x16  --*/
+0x80,0x80,0x80,0xF0,0xF0,0x80,0x80,0x80,0x00,0x00,0x00,0x07,0x07,0x00,0x00,0x00,
+
+/*--  文字:  ,  --*/
+/*--  @宋体11;  此字体下对应的点阵为:宽x高=8x14   --*/
+/*--  高度不是8的倍数,现调整为:宽度x高度=8x16  --*/
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x24,0x3C,0x1C,0x00,0x00,0x00,0x00,
+
+/*--  文字:  -  --*/
+/*--  @宋体11;  此字体下对应的点阵为:宽x高=8x14   --*/
+/*--  高度不是8的倍数,现调整为:宽度x高度=8x16  --*/
+0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+
+/*--  文字:  .  --*/
+/*--  @宋体11;  此字体下对应的点阵为:宽x高=8x14   --*/
+/*--  高度不是8的倍数,现调整为:宽度x高度=8x16  --*/
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x0C,0x0C,0x00,0x00,0x00,0x00,
+
+/*--  文字:  /  --*/
+/*--  @宋体11;  此字体下对应的点阵为:宽x高=8x14   --*/
+/*--  高度不是8的倍数,现调整为:宽度x高度=8x16  --*/
+0x00,0x00,0x00,0x80,0xE0,0x7C,0x1E,0x02,0x00,0x10,0x1E,0x0F,0x01,0x00,0x00,0x00,
+
+/*--  文字:  0  --*/
+/*--  宋体12;  此字体下对应的点阵为:宽x高=8x16   --*/
+0x00,0xE0,0x10,0x08,0x08,0x10,0xE0,0x00,0x00,0x0F,0x10,0x20,0x20,0x10,0x0F,0x00,
+
+/*--  文字:  1  --*/
+/*--  宋体12;  此字体下对应的点阵为:宽x高=8x16   --*/
+0x00,0x00,0x10,0x10,0xF8,0x00,0x00,0x00,0x00,0x00,0x20,0x20,0x3F,0x20,0x20,0x00,
+
+/*--  文字:  2  --*/
+/*--  宋体12;  此字体下对应的点阵为:宽x高=8x16   --*/
+0x00,0x70,0x08,0x08,0x08,0x08,0xF0,0x00,0x00,0x30,0x28,0x24,0x22,0x21,0x30,0x00,
+
+/*--  文字:  3  --*/
+/*--  宋体12;  此字体下对应的点阵为:宽x高=8x16   --*/
+0x00,0x30,0x08,0x08,0x08,0x88,0x70,0x00,0x00,0x18,0x20,0x21,0x21,0x22,0x1C,0x00,
+
+/*--  文字:  4  --*/
+/*--  宋体12;  此字体下对应的点阵为:宽x高=8x16   --*/
+0x00,0x00,0x80,0x40,0x30,0xF8,0x00,0x00,0x00,0x06,0x05,0x24,0x24,0x3F,0x24,0x24,
+
+/*--  文字:  5  --*/
+/*--  宋体12;  此字体下对应的点阵为:宽x高=8x16   --*/
+0x00,0xF8,0x88,0x88,0x88,0x08,0x08,0x00,0x00,0x19,0x20,0x20,0x20,0x11,0x0E,0x00,
+
+/*--  文字:  6  --*/
+/*--  宋体12;  此字体下对应的点阵为:宽x高=8x16   --*/
+0x00,0xE0,0x10,0x88,0x88,0x90,0x00,0x00,0x00,0x0F,0x11,0x20,0x20,0x20,0x1F,0x00,
+
+/*--  文字:  7  --*/
+/*--  宋体12;  此字体下对应的点阵为:宽x高=8x16   --*/
+0x00,0x18,0x08,0x08,0x88,0x68,0x18,0x00,0x00,0x00,0x00,0x3E,0x01,0x00,0x00,0x00,
+
+/*--  文字:  8  --*/
+/*--  宋体12;  此字体下对应的点阵为:宽x高=8x16   --*/
+0x00,0x70,0x88,0x08,0x08,0x88,0x70,0x00,0x00,0x1C,0x22,0x21,0x21,0x22,0x1C,0x00,
+
+/*--  文字:  9  --*/
+/*--  宋体12;  此字体下对应的点阵为:宽x高=8x16   --*/
+0x00,0xF0,0x08,0x08,0x08,0x10,0xE0,0x00,0x00,0x01,0x12,0x22,0x22,0x11,0x0F,0x00,
+
+/*--  文字:  :  --*/
+/*--  @宋体11;  此字体下对应的点阵为:宽x高=8x14   --*/
+/*--  高度不是8的倍数,现调整为:宽度x高度=8x16  --*/
+0x00,0x00,0x00,0x60,0x60,0x60,0x00,0x00,0x00,0x00,0x00,0x0C,0x0C,0x0C,0x00,0x00,
+
+/*--  文字:  ;  --*/
+/*--  @宋体11;  此字体下对应的点阵为:宽x高=8x14   --*/
+/*--  高度不是8的倍数,现调整为:宽度x高度=8x16  --*/
+0x00,0x00,0x00,0x40,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,
+
+/*--  文字:  <  --*/
+/*--  @宋体11;  此字体下对应的点阵为:宽x高=8x14   --*/
+/*--  高度不是8的倍数,现调整为:宽度x高度=8x16  --*/
+0x00,0xC0,0xE0,0x30,0x18,0x0C,0x04,0x00,0x00,0x00,0x01,0x03,0x06,0x0C,0x08,0x00,
+
+/*--  文字:  =  --*/
+/*--  @宋体11;  此字体下对应的点阵为:宽x高=8x14   --*/
+/*--  高度不是8的倍数,现调整为:宽度x高度=8x16  --*/
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+
+/*--  文字:  >  --*/
+/*--  @宋体11;  此字体下对应的点阵为:宽x高=8x14   --*/
+/*--  高度不是8的倍数,现调整为:宽度x高度=8x16  --*/
+0x00,0x04,0x0C,0x18,0x30,0xE0,0xC0,0x00,0x00,0x08,0x0C,0x06,0x03,0x01,0x00,0x00,
+
+/*--  文字:  ?  --*/
+/*--  @宋体11;  此字体下对应的点阵为:宽x高=8x14   --*/
+/*--  高度不是8的倍数,现调整为:宽度x高度=8x16  --*/
+0x00,0x30,0x38,0x88,0xC8,0x78,0x30,0x00,0x00,0x00,0x00,0x0D,0x0D,0x0C,0x00,0x00,
+
+/*--  文字:  @  --*/
+/*--  宋体12;  此字体下对应的点阵为:宽x高=8x16   --*/
+0xC0,0x30,0xC8,0x28,0xE8,0x10,0xE0,0x00,0x07,0x18,0x27,0x28,0x2F,0x28,0x17,0x00,
+
+/*--  文字:  A  --*/
+/*--  宋体12;  此字体下对应的点阵为:宽x高=8x16   --*/
+0x00,0x00,0xC0,0x38,0xE0,0x00,0x00,0x00,0x20,0x3C,0x23,0x02,0x02,0x27,0x38,0x20,
+
+/*--  文字:  B  --*/
+/*--  宋体12;  此字体下对应的点阵为:宽x高=8x16   --*/
+0x08,0xF8,0x88,0x88,0x88,0x70,0x00,0x00,0x20,0x3F,0x20,0x20,0x20,0x11,0x0E,0x00,
+
+/*--  文字:  C  --*/
+/*--  宋体12;  此字体下对应的点阵为:宽x高=8x16   --*/
+0xC0,0x30,0x08,0x08,0x08,0x08,0x38,0x00,0x07,0x18,0x20,0x20,0x20,0x10,0x08,0x00,
+
+/*--  文字:  D  --*/
+/*--  宋体12;  此字体下对应的点阵为:宽x高=8x16   --*/
+0x08,0xF8,0x08,0x08,0x08,0x10,0xE0,0x00,0x20,0x3F,0x20,0x20,0x20,0x10,0x0F,0x00,
+
+/*--  文字:  E  --*/
+/*--  宋体12;  此字体下对应的点阵为:宽x高=8x16   --*/
+0x08,0xF8,0x88,0x88,0xE8,0x08,0x10,0x00,0x20,0x3F,0x20,0x20,0x23,0x20,0x18,0x00,
+
+/*--  文字:  F  --*/
+/*--  宋体12;  此字体下对应的点阵为:宽x高=8x16   --*/
+0x08,0xF8,0x88,0x88,0xE8,0x08,0x10,0x00,0x20,0x3F,0x20,0x00,0x03,0x00,0x00,0x00,
+
+/*--  文字:  G  --*/
+/*--  宋体12;  此字体下对应的点阵为:宽x高=8x16   --*/
+0xC0,0x30,0x08,0x08,0x08,0x38,0x00,0x00,0x07,0x18,0x20,0x20,0x22,0x1E,0x02,0x00,
+
+/*--  文字:  H  --*/
+/*--  宋体12;  此字体下对应的点阵为:宽x高=8x16   --*/
+0x08,0xF8,0x08,0x00,0x00,0x08,0xF8,0x08,0x20,0x3F,0x21,0x01,0x01,0x21,0x3F,0x20,
+
+/*--  文字:  I  --*/
+/*--  宋体12;  此字体下对应的点阵为:宽x高=8x16   --*/
+0x00,0x08,0x08,0xF8,0x08,0x08,0x00,0x00,0x00,0x20,0x20,0x3F,0x20,0x20,0x00,0x00,
+
+/*--  文字:  J  --*/
+/*--  宋体12;  此字体下对应的点阵为:宽x高=8x16   --*/
+0x00,0x00,0x08,0x08,0xF8,0x08,0x08,0x00,0xC0,0x80,0x80,0x80,0x7F,0x00,0x00,0x00,
+
+/*--  文字:  K  --*/
+/*--  宋体12;  此字体下对应的点阵为:宽x高=8x16   --*/
+0x08,0xF8,0x88,0xC0,0x28,0x18,0x08,0x00,0x20,0x3F,0x20,0x01,0x26,0x38,0x20,0x00,
+
+/*--  文字:  L  --*/
+/*--  宋体12;  此字体下对应的点阵为:宽x高=8x16   --*/
+0x08,0xF8,0x08,0x00,0x00,0x00,0x00,0x00,0x20,0x3F,0x20,0x20,0x20,0x20,0x30,0x00,
+
+/*--  文字:  M  --*/
+/*--  宋体12;  此字体下对应的点阵为:宽x高=8x16   --*/
+0x08,0xF8,0xF8,0x00,0xF8,0xF8,0x08,0x00,0x20,0x3F,0x01,0x3E,0x01,0x3F,0x20,0x00,
+
+/*--  文字:  N  --*/
+/*--  宋体12;  此字体下对应的点阵为:宽x高=8x16   --*/
+0x08,0xF8,0x30,0xC0,0x00,0x08,0xF8,0x08,0x20,0x3F,0x20,0x00,0x07,0x18,0x3F,0x00,
+
+/*--  文字:  O  --*/
+/*--  宋体12;  此字体下对应的点阵为:宽x高=8x16   --*/
+0xE0,0x10,0x08,0x08,0x08,0x10,0xE0,0x00,0x0F,0x10,0x20,0x20,0x20,0x10,0x0F,0x00,
+
+/*--  文字:  P  --*/
+/*--  宋体12;  此字体下对应的点阵为:宽x高=8x16   --*/
+0x08,0xF8,0x08,0x08,0x08,0x08,0xF0,0x00,0x20,0x3F,0x21,0x01,0x01,0x01,0x00,0x00,
+
+/*--  文字:  Q  --*/
+/*--  宋体12;  此字体下对应的点阵为:宽x高=8x16   --*/
+0xE0,0x10,0x08,0x08,0x08,0x10,0xE0,0x00,0x0F,0x10,0x28,0x28,0x30,0x50,0x4F,0x00,
+
+/*--  文字:  R  --*/
+/*--  宋体12;  此字体下对应的点阵为:宽x高=8x16   --*/
+0x08,0xF8,0x88,0x88,0x88,0x88,0x70,0x00,0x20,0x3F,0x20,0x00,0x03,0x0C,0x30,0x20,
+
+/*--  文字:  S  --*/
+/*--  宋体12;  此字体下对应的点阵为:宽x高=8x16   --*/
+0x00,0x70,0x88,0x08,0x08,0x08,0x38,0x00,0x00,0x38,0x20,0x21,0x21,0x22,0x1C,0x00,
+
+/*--  文字:  T  --*/
+/*--  宋体12;  此字体下对应的点阵为:宽x高=8x16   --*/
+0x18,0x08,0x08,0xF8,0x08,0x08,0x18,0x00,0x00,0x00,0x20,0x3F,0x20,0x00,0x00,0x00,
+
+/*--  文字:  U  --*/
+/*--  宋体12;  此字体下对应的点阵为:宽x高=8x16   --*/
+0x08,0xF8,0x08,0x00,0x00,0x08,0xF8,0x08,0x00,0x1F,0x20,0x20,0x20,0x20,0x1F,0x00,
+
+/*--  文字:  V  --*/
+/*--  宋体12;  此字体下对应的点阵为:宽x高=8x16   --*/
+0x08,0x78,0x88,0x00,0x00,0xC8,0x38,0x08,0x00,0x00,0x07,0x38,0x0E,0x01,0x00,0x00,
+
+/*--  文字:  W  --*/
+/*--  宋体12;  此字体下对应的点阵为:宽x高=8x16   --*/
+0x08,0xF8,0x00,0xF8,0x00,0xF8,0x08,0x00,0x00,0x03,0x3E,0x01,0x3E,0x03,0x00,0x00,
+
+/*--  文字:  X  --*/
+/*--  宋体12;  此字体下对应的点阵为:宽x高=8x16   --*/
+0x08,0x18,0x68,0x80,0x80,0x68,0x18,0x08,0x20,0x30,0x2C,0x03,0x03,0x2C,0x30,0x20,
+
+/*--  文字:  Y  --*/
+/*--  宋体12;  此字体下对应的点阵为:宽x高=8x16   --*/
+0x08,0x38,0xC8,0x00,0xC8,0x38,0x08,0x00,0x00,0x00,0x20,0x3F,0x20,0x00,0x00,0x00,
+
+/*--  文字:  Z  --*/
+/*--  宋体12;  此字体下对应的点阵为:宽x高=8x16   --*/
+0x10,0x08,0x08,0x08,0xC8,0x38,0x08,0x00,0x20,0x38,0x26,0x21,0x20,0x20,0x18,0x00,
+
+/*--  文字:  [  --*/
+/*--  @宋体11;  此字体下对应的点阵为:宽x高=8x14   --*/
+/*--  高度不是8的倍数,现调整为:宽度x高度=8x16  --*/
+0x00,0x00,0x00,0xFE,0xFE,0x02,0x02,0x00,0x00,0x00,0x00,0x1F,0x1F,0x10,0x10,0x00,
+
+/*--  文字:  \  --*/
+/*--  @宋体11;  此字体下对应的点阵为:宽x高=8x14   --*/
+/*--  高度不是8的倍数,现调整为:宽度x高度=8x16  --*/
+0x00,0x04,0x3C,0xF8,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x0F,0x1E,0x10,0x00,
+
+/*--  文字:  ]  --*/
+/*--  @宋体11;  此字体下对应的点阵为:宽x高=8x14   --*/
+/*--  高度不是8的倍数,现调整为:宽度x高度=8x16  --*/
+0x00,0x02,0x02,0xFE,0xFE,0x00,0x00,0x00,0x00,0x10,0x10,0x1F,0x1F,0x00,0x00,0x00,
+
+/*--  文字:  ^  --*/
+/*--  @宋体11;  此字体下对应的点阵为:宽x高=8x14   --*/
+/*--  高度不是8的倍数,现调整为:宽度x高度=8x16  --*/
+0x00,0x00,0x02,0x03,0x01,0x03,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+
+/*--  文字:  _  --*/
+/*--  @宋体11;  此字体下对应的点阵为:宽x高=8x14   --*/
+/*--  高度不是8的倍数,现调整为:宽度x高度=8x16  --*/
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
+
+/*--  文字:  `  --*/
+/*--  @宋体11;  此字体下对应的点阵为:宽x高=8x14   --*/
+/*--  高度不是8的倍数,现调整为:宽度x高度=8x16  --*/
+0x00,0x01,0x01,0x03,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+
+/*--  文字:  a  --*/
+/*--  宋体12;  此字体下对应的点阵为:宽x高=8x16   --*/
+0x00,0x00,0x80,0x80,0x80,0x00,0x00,0x00,0x00,0x19,0x24,0x24,0x12,0x3F,0x20,0x00,
+
+/*--  文字:  b  --*/
+/*--  宋体12;  此字体下对应的点阵为:宽x高=8x16   --*/
+0x10,0xF0,0x00,0x80,0x80,0x00,0x00,0x00,0x00,0x3F,0x11,0x20,0x20,0x11,0x0E,0x00,
+
+/*--  文字:  c  --*/
+/*--  宋体12;  此字体下对应的点阵为:宽x高=8x16   --*/
+0x00,0x00,0x00,0x80,0x80,0x80,0x00,0x00,0x00,0x0E,0x11,0x20,0x20,0x20,0x11,0x00,
+
+/*--  文字:  d  --*/
+/*--  宋体12;  此字体下对应的点阵为:宽x高=8x16   --*/
+0x00,0x00,0x80,0x80,0x80,0x90,0xF0,0x00,0x00,0x1F,0x20,0x20,0x20,0x10,0x3F,0x20,
+
+/*--  文字:  e  --*/
+/*--  宋体12;  此字体下对应的点阵为:宽x高=8x16   --*/
+0x00,0x00,0x80,0x80,0x80,0x80,0x00,0x00,0x00,0x1F,0x24,0x24,0x24,0x24,0x17,0x00,
+
+/*--  文字:  f  --*/
+/*--  宋体12;  此字体下对应的点阵为:宽x高=8x16   --*/
+0x00,0x80,0x80,0xE0,0x90,0x90,0x20,0x00,0x00,0x20,0x20,0x3F,0x20,0x20,0x00,0x00,
+
+/*--  文字:  g  --*/
+/*--  宋体12;  此字体下对应的点阵为:宽x高=8x16   --*/
+0x00,0x00,0x80,0x80,0x80,0x80,0x80,0x00,0x00,0x6B,0x94,0x94,0x94,0x93,0x60,0x00,
+
+/*--  文字:  h  --*/
+/*--  宋体12;  此字体下对应的点阵为:宽x高=8x16   --*/
+0x10,0xF0,0x00,0x80,0x80,0x80,0x00,0x00,0x20,0x3F,0x21,0x00,0x00,0x20,0x3F,0x20,
+
+/*--  文字:  i  --*/
+/*--  宋体12;  此字体下对应的点阵为:宽x高=8x16   --*/
+0x00,0x80,0x98,0x98,0x00,0x00,0x00,0x00,0x00,0x20,0x20,0x3F,0x20,0x20,0x00,0x00,
+
+/*--  文字:  j  --*/
+/*--  宋体12;  此字体下对应的点阵为:宽x高=8x16   --*/
+0x00,0x00,0x00,0x80,0x98,0x98,0x00,0x00,0x00,0xC0,0x80,0x80,0x80,0x7F,0x00,0x00,
+
+/*--  文字:  k  --*/
+/*--  宋体12;  此字体下对应的点阵为:宽x高=8x16   --*/
+0x10,0xF0,0x00,0x00,0x80,0x80,0x80,0x00,0x20,0x3F,0x24,0x06,0x29,0x30,0x20,0x00,
+
+/*--  文字:  l  --*/
+/*--  宋体12;  此字体下对应的点阵为:宽x高=8x16   --*/
+0x00,0x10,0x10,0xF8,0x00,0x00,0x00,0x00,0x00,0x20,0x20,0x3F,0x20,0x20,0x00,0x00,
+
+/*--  文字:  m  --*/
+/*--  宋体12;  此字体下对应的点阵为:宽x高=8x16   --*/
+0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x00,0x20,0x3F,0x20,0x00,0x3F,0x20,0x00,0x3F,
+
+/*--  文字:  n  --*/
+/*--  宋体12;  此字体下对应的点阵为:宽x高=8x16   --*/
+0x80,0x80,0x00,0x80,0x80,0x80,0x00,0x00,0x20,0x3F,0x21,0x00,0x00,0x20,0x3F,0x20,
+
+/*--  文字:  o  --*/
+/*--  宋体12;  此字体下对应的点阵为:宽x高=8x16   --*/
+0x00,0x00,0x80,0x80,0x80,0x80,0x00,0x00,0x00,0x1F,0x20,0x20,0x20,0x20,0x1F,0x00,
+
+/*--  文字:  p  --*/
+/*--  宋体12;  此字体下对应的点阵为:宽x高=8x16   --*/
+0x80,0x80,0x00,0x80,0x80,0x00,0x00,0x00,0x80,0xFF,0x91,0x20,0x20,0x11,0x0E,0x00,
+
+/*--  文字:  q  --*/
+/*--  宋体12;  此字体下对应的点阵为:宽x高=8x16   --*/
+0x00,0x00,0x00,0x80,0x80,0x00,0x80,0x00,0x00,0x0E,0x11,0x20,0x20,0x91,0xFF,0x80,
+
+/*--  文字:  r  --*/
+/*--  宋体12;  此字体下对应的点阵为:宽x高=8x16   --*/
+0x80,0x80,0x80,0x00,0x80,0x80,0x80,0x00,0x20,0x20,0x3F,0x21,0x20,0x00,0x01,0x00,
+
+/*--  文字:  s  --*/
+/*--  宋体12;  此字体下对应的点阵为:宽x高=8x16   --*/
+0x00,0x00,0x80,0x80,0x80,0x80,0x80,0x00,0x00,0x33,0x24,0x24,0x24,0x24,0x19,0x00,
+
+/*--  文字:  t  --*/
+/*--  宋体12;  此字体下对应的点阵为:宽x高=8x16   --*/
+0x00,0x80,0x80,0xE0,0x80,0x80,0x00,0x00,0x00,0x00,0x00,0x1F,0x20,0x20,0x10,0x00,
+
+/*--  文字:  u  --*/
+/*--  宋体12;  此字体下对应的点阵为:宽x高=8x16   --*/
+0x80,0x80,0x00,0x00,0x00,0x80,0x80,0x00,0x00,0x1F,0x20,0x20,0x20,0x10,0x3F,0x20,
+
+/*--  文字:  v  --*/
+/*--  宋体12;  此字体下对应的点阵为:宽x高=8x16   --*/
+0x80,0x80,0x80,0x00,0x80,0x80,0x80,0x00,0x00,0x03,0x0C,0x30,0x0C,0x03,0x00,0x00,
+
+/*--  文字:  w  --*/
+/*--  宋体12;  此字体下对应的点阵为:宽x高=8x16   --*/
+0x80,0x80,0x00,0x80,0x80,0x00,0x80,0x80,0x01,0x0E,0x30,0x0C,0x07,0x38,0x06,0x01,
+
+/*--  文字:  x  --*/
+/*--  宋体12;  此字体下对应的点阵为:宽x高=8x16   --*/
+0x00,0x80,0x80,0x80,0x00,0x80,0x80,0x00,0x00,0x20,0x31,0x0E,0x2E,0x31,0x20,0x00,
+
+/*--  文字:  y  --*/
+/*--  宋体12;  此字体下对应的点阵为:宽x高=8x16   --*/
+0x80,0x80,0x80,0x00,0x00,0x80,0x80,0x80,0x00,0x81,0x86,0x78,0x18,0x06,0x01,0x00,
+
+/*--  文字:  z  --*/
+/*--  宋体12;  此字体下对应的点阵为:宽x高=8x16   --*/
+0x00,0x80,0x80,0x80,0x80,0x80,0x80,0x00,0x00,0x21,0x30,0x2C,0x22,0x21,0x30,0x00,
+
+/*--  文字:  {  --*/
+/*--  @宋体11;  此字体下对应的点阵为:宽x高=8x14   --*/
+/*--  高度不是8的倍数,现调整为:宽度x高度=8x16  --*/
+0x00,0x00,0x00,0x80,0xFE,0x7E,0x02,0x00,0x00,0x00,0x00,0x00,0x1F,0x1F,0x10,0x00,
+
+/*--  文字:  |  --*/
+/*--  @宋体11;  此字体下对应的点阵为:宽x高=8x14   --*/
+/*--  高度不是8的倍数,现调整为:宽度x高度=8x16  --*/
+0x00,0x00,0x00,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0x3F,0x00,0x00,0x00,
+
+/*--  文字:  }  --*/
+/*--  @宋体11;  此字体下对应的点阵为:宽x高=8x14   --*/
+/*--  高度不是8的倍数,现调整为:宽度x高度=8x16  --*/
+0x00,0x02,0x7E,0xFE,0x80,0x00,0x00,0x00,0x00,0x10,0x1F,0x1F,0x00,0x00,0x00,0x00,
+
+/*--  文字:  ~  --*/
+/*--  @宋体11;  此字体下对应的点阵为:宽x高=8x14   --*/
+/*--  高度不是8的倍数,现调整为:宽度x高度=8x16  --*/
+0x00,0x02,0x03,0x03,0x06,0x06,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+
+
+};
+
+
+const unsigned char font_ophw[] = 
+{
+
+0x00,0x00,0x00,0x00,0x80,0xC0,0xE0,0xF8,0xF0,0xE0,0xE0,0xC0,0xC0,0xC0,0xC0,0xE0,
+0xFC,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFE,0xE0,0xC0,0xC0,0xC0,0xC0,0xE0,0xF0,0xF0,
+0xF8,0xE0,0xC0,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xC7,0xFF,0xFF,
+0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x7F,0x7F,0x7F,0x7F,0xFF,0xFF,
+0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xC7,0x01,0x00,0x00,0x00,0x00,
+0x7E,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xC3,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x83,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
+0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x7E,0x00,0x00,0x00,0x00,0x80,0xE3,0xFF,0xFF,
+0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x3F,0x0E,0x00,0x00,0x00,0x00,0x06,0x3F,
+0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xE3,0x80,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x01,0x01,0x03,0x07,0x0F,0x0F,0x0F,0x07,0x03,0x03,0x03,0x07,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x07,0x03,0x03,0x07,0x07,0x0F,
+0x0F,0x07,0x03,0x01,0x01,0x00,0x00,0x00
+};
+#endif
diff -r 000000000000 -r 4683a4a41f47 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Tue Apr 01 07:05:54 2014 +0000
@@ -0,0 +1,326 @@
+#include "mbed.h"
+#include "pinmap.h"
+#include "font_watch.h"
+#include "DS1337.h"
+#include "SeeedOLED.h"
+
+
+#define HARD_SPI        1
+
+DigitalOut blue(P0_20);
+DigitalOut white(P0_23);
+
+#define I2C_FREQ            100000
+
+I2C i2c(P0_5, P0_4);        // sda, scl     
+
+
+DS1337 RTC;
+
+Serial uart(P0_19, P0_18);
+
+typedef struct{
+
+int hour;
+int minutes;
+int second;
+int year;
+int month;
+int day;
+int week;
+
+}TIME_S;
+
+TIME_S time_now, time_buf;
+
+unsigned char disp[1024];
+
+void initDta()
+{
+    for(int i=0; i<1024; i++)
+    {
+        disp[i] = 0x00;
+    }
+}
+
+
+void display()
+{
+
+    for(int i=0; i<8; i++)
+    {
+        oled.setTextXY(i,0);
+        for(int j=0; j<128; j++)
+        {
+            oled.sendData(disp[128*i+j]);
+        }
+    }
+}
+
+
+void clearOled()
+{
+    initDta();
+    display();
+}
+
+
+
+
+void initOLED()
+{
+    oled.sendCommand(SeeedOLED_Display_Off_Cmd);    //display off
+    wait_ms(5); 
+    oled.sendCommand(SeeedOLED_Display_On_Cmd);     //display on
+    wait_ms(5); 
+    oled.sendCommand(SeeedOLED_Normal_Display_Cmd);  //Set Normal Display (default)
+    
+    
+    oled.setNormalDisplay();       // Set display to normal mode (i.e non-inverse mode)
+    oled.setPageMode();            // Set addressing mode to Page Mode
+    clearOled();
+}
+
+void time_init()
+{
+    RTC.readTime();
+    time_now.hour      = RTC.getHours();
+    time_now.minutes   = RTC.getMinutes();
+    time_now.second    = RTC.getSeconds();
+    time_now.year      = RTC.getYears();
+    time_now.month     = RTC.getMonths();
+    time_now.day       = RTC.getDays();
+    time_now.week      = RTC.getDayOfWeek(); 
+    
+    time_buf.hour      = RTC.getHours();
+    time_buf.minutes   = RTC.getMinutes();
+    time_buf.second    = RTC.getSeconds();
+    time_buf.year      = RTC.getYears();
+    time_buf.month     = RTC.getMonths();
+    time_buf.day       = RTC.getDays();
+    time_buf.week      = RTC.getDayOfWeek(); 
+}
+
+void time_refresh()
+{
+    RTC.readTime();
+    time_now.hour      = RTC.getHours();
+    time_now.minutes   = RTC.getMinutes();
+    time_now.second    = RTC.getSeconds();
+    time_now.year      = RTC.getYears();
+    time_now.month     = RTC.getMonths();
+    time_now.day       = RTC.getDays();
+    time_now.week      = RTC.getDayOfWeek(); 
+}
+
+void setTime()
+{
+    RTC.setSeconds(50);
+    RTC.setMinutes(35);
+    RTC.setHours(17);
+    RTC.setDays(27);
+    RTC.setDayOfWeek(4);
+    RTC.setMonths(3);
+    RTC.setYears(2014);
+    
+    RTC.setTime();
+}
+
+
+void drawPix(int x1, int y1, unsigned int color)
+{
+    int x = 127-y1;
+    int y = x1;
+    
+    int n = y/8;
+    n = 128*n+x;
+    
+    int bit = y%8;
+    
+    
+    if(color)
+    disp[n] |= (0x01<<bit);
+    else
+    disp[n] &= ~(0x01<<bit);
+}
+
+void drawBuff(int x, int y, int buf_len, int buf_width, int color, const unsigned char *buff)
+{
+    for(int i=0; i<(buf_width/8); i++)
+    {
+        for(int j=0; j<buf_len; j++)
+        {
+            for(int k=0; k<8; k++)
+            {
+                int clr_ = (buff[i*buf_len+j] & (0x01<<k)) ? color : 0;
+                drawPix(j+x, 8*i+k+y, clr_);
+            }
+        }
+    }
+}
+
+void dispFont(int x, int y, int color, const unsigned char *font)
+{
+    drawBuff(x, y, 11, 32, color, font);
+}
+
+void dispFont_small(int x, int y, int color, const unsigned char *font)
+{   
+    drawBuff(x, y, 8, 16, color, font);
+}
+
+void dispChar(char c, int x, int y, int color)
+{
+    c = c-32;
+    drawBuff(x, y, 8, 16, color, font_ascii[c]);
+}
+
+
+void dispString(char *str)
+{
+    clearOled();
+    
+    int x=0, y=0;
+    
+    int pix = 0;
+    
+    while(*str)
+    {
+        dispChar(*str, x, y, 1);
+        str++;
+        x += 8;
+        pix++;
+        
+        if(pix == 8)
+        {
+            pix = 0;
+            x = 0;
+            y += 16;
+        }
+    }
+}
+
+void dispDot(int x, int y, int color)
+{
+    drawBuff(x, y, 7, 32, color, font_dot);
+}
+
+void refresh_time()
+{
+    int y = 60+16;
+    int color_ =1; 
+    dispFont(0, y, color_, font_num[time_now.hour/10]);
+    dispFont(14, y, color_, font_num[time_now.hour%10]);
+    dispDot(28, y-2, color_);
+    dispFont(38, y, color_, font_num[time_now.minutes/10]);
+    dispFont(52, y, color_, font_num[time_now.minutes%10]);
+}
+
+void refresh_day()
+{
+    int color_ = 1;
+    
+    int y = 40+16;
+    dispChar('M', 0, y, color_);
+    dispChar('a', 8, y, color_);
+    dispChar('r', 16, y, color_);
+
+   // dispChar()
+   
+   dispFont_small(30, y, color_, font_ascii[time_now.day/10+'0'-32]);
+   dispFont_small(38, y, color_, font_ascii[time_now.day%10+'0'-32]);
+}
+
+void show_time()
+{
+    clearOled();
+    
+    drawBuff(12, 0+16, 40, 40, 1, font_ophw);
+    int color_ = 1;
+    refresh_day();
+    for(int i=0; i<63; i++)
+    {
+        drawPix(i, 56+16, color_);
+        drawPix(i, 57+16, color_);
+    }
+    refresh_time();
+}
+
+int main()
+{
+    uart.baud(38400);
+    
+    initOLED();
+    clearOled();
+    
+    dispString("xadow   smart   watch");
+    display();
+    wait(1);
+    //setTime();
+    time_init();
+    show_time();
+
+    char ble_str[40];
+    int len_str = 0;
+
+    display();
+    for(;;)
+    {
+        time_refresh();
+        
+        if(time_now.day != time_buf.day)
+        {
+            refresh_day();
+            display();
+        }
+        
+        if(time_now.minutes != time_buf.minutes)
+        {
+            refresh_time();
+            display();
+        }
+        
+       wait(0.1);
+        
+        
+        while (uart.readable()) 
+        {
+            ble_str[len_str++] = uart.getc();
+        }
+        
+        if(len_str == 1 && (ble_str[0] == 't' || ble_str[0] == 'T'))
+        {
+            time_refresh();
+            display();
+            uart.printf("%d/%d/%d\r\n", time_now.year, time_now.month, time_now.day);
+            uart.printf("%d:%d:%d\r\n", time_now.hour, time_now.minutes, time_now.second);
+            len_str = 0;
+        }
+        else if(ble_str[0] == 's' && len_str == 16)             // set time
+        {
+            // s201403280944003
+            RTC.setSeconds((ble_str[13]-'0')*10+(ble_str[14]-'0'));
+            RTC.setMinutes((ble_str[11]-'0')*10+(ble_str[12]-'0'));
+            RTC.setHours((ble_str[9]-'0')*10+(ble_str[10]-'0'));
+            RTC.setDays((ble_str[7]-'0')*10+(ble_str[8]-'0'));
+            RTC.setDayOfWeek(ble_str[15]-'0');
+            RTC.setMonths((ble_str[5]-'0')*10+(ble_str[6]-'0'));
+            RTC.setYears((ble_str[1]-'0')*1000+(ble_str[2]-'0')*100+(ble_str[3]-'0')*10+(ble_str[4]-'0'));
+            
+            RTC.setTime();
+        }
+        else if(len_str>0)
+        {
+            uart.printf("get ok\r\n");
+            ble_str[len_str] = '\0';
+            dispString(ble_str);
+            display();
+            wait(3);
+            show_time();
+            display();
+            len_str = 0;
+        }
+        
+    }
+}
+
diff -r 000000000000 -r 4683a4a41f47 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Tue Apr 01 07:05:54 2014 +0000
@@ -0,0 +1,1 @@
+http://world3.dev.mbed.org/users/mbed_official/code/mbed/builds/824293ae5e43
\ No newline at end of file