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_main.cpp
- Revision:
- 17:5bf7947c3c19
- Parent:
- 16:cb072eea16e9
- Child:
- 20:88e137b9ea46
--- a/Picaso_4DGL-32PTU_main.cpp Thu Sep 15 12:26:58 2016 +0000
+++ b/Picaso_4DGL-32PTU_main.cpp Thu Sep 15 12:28:47 2016 +0000
@@ -238,177 +238,3 @@
_cmd.baud(speed);
getResponse(1);
}
-
-//**************************************************************************
-bool PICASO_4DGL :: getResponse(int count) {
-
-#if DEBUGMODE
- pc.printf("\n\r DEBUG: Wait for answer...");
-#endif
- //pc.printf("\n\r count = %i, index = %i", count, index);
- while (index < count) wait_ms(100); // wait for screen answer
-
-#if DEBUGMODE
- pc.printf("\n\r DEBUG: Answer = ");
- for (int i = 0; i < index; i++) {
- pc.printf("%02X ", rxBuf[i]);
- }
- pc.printf("\n\r");
-#endif
- if (rxBuf[0] == 0x06) {
- index = 0; // set buffer index to 0
- return true;
- }
- else {
- index = 0;
- return false;
- }
-}
-
-//**************************************************************************
-bool PICASO_4DGL :: calculateOrbitResponse() {
-
-#if DEBUGMODE
- pc.printf("\n\r DEBUG: Wait for answer...");
-#endif
- while (index < 5) wait_ms(100); // wait for screen answer
-
-#if DEBUGMODE
- pc.printf("\n\r DEBUG: Answer = ");
- for (int i = 0; i < index; i++) {
- pc.printf("%02X ", rxBuf[i]);
- }
- pc.printf("\n\r");
-#endif
- Xdest = rxBuf[1] << 8 | rxBuf[2];
- Ydest = rxBuf[3] << 8 | rxBuf[4];
-#if DEBUGMODE
- pc.printf("\n\r DEBUG: New coordiantes = %i x %i\n\r", Xdest, Ydest);
-#endif
- index = 0; // set buffer index to 0
- return true;
-}
-
-
-//**************************************************************************
-short PICASO_4DGL :: getGraphicsResponse() {
-
-#if DEBUGMODE
- pc.printf("\n\r DEBUG: Wait for answer...");
-#endif
- while (index < 3) wait_ms(100); // wait for screen answer
-
-#if DEBUGMODE
- pc.printf("\n\r DEBUG: Answer = ");
- for (int i = 0; i < index; i++) {
- pc.printf("%02X ", rxBuf[i]);
- }
- pc.printf("\n\r");
-#endif
- short answer = rxBuf[1] << 8 | rxBuf[2]; // set response variable
- index = 0; // set buffer index to 0
- return answer;
-}
-
-//**************************************************************************
-short PICASO_4DGL :: mediaInitResponse() {
-
-#if DEBUGMODE
- pc.printf("\n\r DEBUG: Wait for answer...");
-#endif
- while (index < 3) wait_ms(100); // wait for screen answer
-
-#if DEBUGMODE
- pc.printf("\n\r DEBUG: Answer = ");
- for (int i = 0; i < index; i++) {
- pc.printf("%02X ", rxBuf[i]);
- }
- pc.printf("\n\r");
-#endif
- short answer = rxBuf[1] << 8 | rxBuf[2];
- index = 0;
- return answer;
-}
-
-//**************************************************************************
-bool PICASO_4DGL :: readSectorResponse(int count) {
-
-#if DEBUGMODE
- pc.printf("\n\r DEBUG: Wait for answer");
-#endif
-
- while (index < count) wait_ms(100); // wait for screen answer
-
-#if DEBUGMODE
- pc.printf("\n\r DEBUG: Answer = ");
- pc.printf("%02X %02X %02X\n\r", rxBuf[0], rxBuf[1], rxBuf[2]);
-#endif
-
- int j = 3;
- for (int i = 0; i < BUFFER_SIZE; i++) {
- buffer[i] = rxBuf[j];
- j++;
- }
-#if DEBUGMODE
- pc.printf("\n\r DEBUG: Buffer = ");
- for (int i = 0; i < BUFFER_SIZE; i++) {
- pc.printf("%02X ", buffer[i]);
- }
- pc.printf("\n\r");
-#endif
- if (rxBuf[2] == 1) {
- index = 0; // set buffer index to 0
- return true;
- }
- else {
- index = 0;
- return false;
- }
-}
-
-//**************************************************************************
-bool PICASO_4DGL :: writeSectorResponse(int count) {
-
-#if DEBUGMODE
- pc.printf("\n\r DEBUG: Wait for answer");
-#endif
- while (index < count) wait_ms(100); // wait for screen answer
-
-#if DEBUGMODE
- pc.printf("\n\r DEBUG: Answer = ");
- pc.printf("%02X %02X %02X\n\r", rxBuf[0], rxBuf[1], rxBuf[2]);
-#endif
-
- if (rxBuf[2] == 1) {
- index = 0; // set buffer index to 0
- return true;
- }
- else {
- index = 0;
- return false;
- }
-}
-
-//**************************************************************************
-bool PICASO_4DGL :: readByteResponse(int count) {
-
-#if DEBUGMODE
- pc.printf("\n\r DEBUG: Wait for answer");
-#endif
-
- while (index < count) wait_ms(100); // wait for screen answer
-
-#if DEBUGMODE
- pc.printf("\n\r DEBUG: Answer = ");
- pc.printf("%02X %02X %02X\n\r", rxBuf[0], rxBuf[1], rxBuf[2]);
-#endif
-
- if (rxBuf[0] == 6) {
- index = 0; // set buffer index to 0
- return true;
- }
- else {
- index = 0;
- return false;
- }
-}