Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Revision 4:f746ea56e891, committed 2011-02-10
- Comitter:
- sakai
- Date:
- Thu Feb 10 14:44:49 2011 +0000
- Parent:
- 3:8739f7e5148a
- Commit message:
Changed in this revision
| NokiaLCD.cpp | 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 |
--- a/NokiaLCD.cpp Thu Feb 10 14:29:29 2011 +0000
+++ b/NokiaLCD.cpp Thu Feb 10 14:44:49 2011 +0000
@@ -339,7 +339,7 @@
void NokiaLCD::blit12(int x, int y, int width, int height, const unsigned char* colour12) {
_cs = 0;
- _window(x, y, width, height);
+ _window(x, y, width, height+2); // The reason is not understood.
switch (_type) {
case LCD6100:
@@ -349,7 +349,7 @@
}
break;
case LCD6610:
- for (int i=0; i<width*height*3/2; i++) {
+ for (int i=0; i<width*height/2*3; i++) {
data(colour12[i]);
}
break;
--- a/main.cpp Thu Feb 10 14:29:29 2011 +0000
+++ b/main.cpp Thu Feb 10 14:44:49 2011 +0000
@@ -1,23 +1,23 @@
-#include "mbed.h"
-#include "NokiaLCD.h"
-#include "SDFileSystem.h"
-
-NokiaLCD lcd(p11, p13, p14, p15, NokiaLCD::LCD6610); // mosi, sclk, cs, rst, type
-SDFileSystem sd(p5, p6, p7, p8, "sd");
-
-int main() {
- lcd.background(0x000000);
- lcd.cls();
- FILE *fp = NULL;
- fp = fopen("/sd/128x128.r12", "r");
- if (fp != NULL) {
- printf("Start!\r\n");
- unsigned char bufLine[64 * 3 * 128];
- fread(bufLine, sizeof(unsigned char), (64 * 3 * 128), fp);
- lcd.blit12(0, 0, 128, 128, bufLine);
- fclose(fp);
- printf("Finish!\r\n");
- } else {
- printf("Can't open file.\r\n");
- }
-}
+#include "mbed.h"
+#include "NokiaLCD.h"
+#include "SDFileSystem.h"
+
+NokiaLCD lcd(p11, p13, p14, p15, NokiaLCD::LCD6610); // mosi, sclk, cs, rst, type
+SDFileSystem sd(p5, p6, p7, p8, "sd");
+
+int main() {
+ lcd.background(0x000000);
+ lcd.cls();
+ FILE *fp = NULL;
+ fp = fopen("/sd/128x128.r12", "r");
+ if (fp != NULL) {
+ printf("Start!\r\n");
+ unsigned char bufLine[64 * 3 * 128];
+ fread(bufLine, sizeof(unsigned char), (64 * 3 * 128), fp);
+ lcd.blit12(0, 0, 128, 128, bufLine);
+ fclose(fp);
+ printf("Finish!\r\n");
+ } else {
+ printf("Can't open file.\r\n");
+ }
+}