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.
Diff: Picaso_4DGL-32PTU_graphics.cpp
- Revision:
- 5:890ddd974624
- Parent:
- 4:50511ed54ab4
- Child:
- 6:a1a85f2bc04b
--- a/Picaso_4DGL-32PTU_graphics.cpp Fri Sep 09 12:45:28 2016 +0000
+++ b/Picaso_4DGL-32PTU_graphics.cpp Mon Sep 12 10:15:54 2016 +0000
@@ -41,6 +41,7 @@
command[1] = (CLS >> (8*0)) & 0xff;
writeCOMMAND(command, 2);
+ getResponse(1);
}
//**************************************************************************
@@ -59,6 +60,7 @@
command[5] = (newColor >> (8*0)) & 0xff;
writeCOMMAND(command, 6);
+ getResponse(1);
}
//**************************************************************************
@@ -81,6 +83,7 @@
command[9] = (color >> (8*0)) & 0xff;
writeCOMMAND(command, 10);
+ getResponse(1);
}
//**************************************************************************
@@ -105,6 +108,7 @@
command[9] = (color >> (8*0)) & 0xff;
writeCOMMAND(command, 10);
+ getResponse(1);
}
//**************************************************************************
@@ -129,6 +133,7 @@
command[11] = (color >> (8*0)) & 0xff;
writeCOMMAND(command, 12);
+ getResponse(1);
}
//**************************************************************************
@@ -154,6 +159,7 @@
command[11] = (color >> (8*0)) & 0xff;
writeCOMMAND(command, 12);
+ getResponse(1);
}
//**************************************************************************
@@ -181,6 +187,7 @@
command[11] = (color >> (8*0)) & 0xff;
writeCOMMAND(command, 12);
+ getResponse(1);
}
@@ -222,6 +229,7 @@
command[j+1] = (color >> (8*0)) & 0xff;
writeCOMMAND(command, size);
+ getResponse(1);
}
//**************************************************************************
@@ -263,6 +271,7 @@
command[j+1] = (color >> (8*0)) & 0xff;
writeCOMMAND(command, size);
+ getResponse(1);
}
//**************************************************************************
@@ -303,6 +312,7 @@
command[j+1] = (color >> (8*0)) & 0xff;
writeCOMMAND(command, size);
+ getResponse(1);
}
}
@@ -333,6 +343,7 @@
command[15] = (color >> (8*0)) & 0xff;
writeCOMMAND(command, 16);
+ getResponse(1);
}
//**************************************************************************
@@ -361,6 +372,7 @@
command[15] = (color >> (8*0)) & 0xff;
writeCOMMAND(command, 16);
+ getResponse(1);
}
//**************************************************************************
@@ -371,8 +383,8 @@
//**************************************************************************
void PICASO_4DGL :: calculateOrbit(short angle, short distance) {
- int i, temp = 0, resp = 0;
- char response[5] = "";
+ //int i, temp = 0, resp = 0;
+ //char response[5] = "";
char command[6] = "";
command[0] = (CALCULATE_ORBIT >> (8*1)) & 0xff;
@@ -383,31 +395,7 @@
command[5] = (distance >> (8*0)) & 0xff;
writeCOMMAND(command, 6);
-/*
- freeBUFFER();
-
- for (i = 0; i < 6; i++) writeBYTE(command[i]); // send command to serial port
-
- while (!_cmd.readable()) wait_ms(TEMPO); // wait for screen answer
-
- while (_cmd.readable()) {
- temp = _cmd.getc();
- response[resp++] = (char)temp;
- }
- switch (resp) {
- case 5 :
- pc.printf(" Orbit received : 0x %02X %02X %02X %02X %02X\n\r", response[0], response[1], response[2], response[3], response[4]);
- //resp = (int)response[1]; // if OK populate data
- break;
- default :
- //resp = -1; // else return 0
- break;
- }
- #if DEBUGMODE
- //pc.printf(" Answer received : %d\n\r", resp);
- #endif
-*/
- //return resp;
+ getResponse(5);
}