Updated serial prints for debugging
Dependents: mbedica_on_yehowshua mbedica
Diff: uVGAIII_main.cpp
- Revision:
- 6:58c02c38e75f
- Parent:
- 0:de1ab53f3480
--- a/uVGAIII_main.cpp Mon Mar 24 19:54:56 2014 +0000 +++ b/uVGAIII_main.cpp Mon Dec 10 17:58:38 2018 +0000 @@ -39,9 +39,10 @@ pc.printf("uVGAIII CONSTRUCTOR\n"); pc.printf("********************\n"); #endif + _cmd.baud(9600); _rst = 1; // put RESET pin to high to start TFT screen - + reset(); cls(); // clear screen speversion(); // get SPE version information @@ -60,7 +61,7 @@ void uVGAIII :: writeBYTE(char c) { // send a BYTE command to screen _cmd.putc(c); - wait_ms(1); + wait_ms(100); // changed FROM 1 to 100 #if DEBUGMODE pc.printf(" Char sent : 0x%02X\n",c); @@ -81,20 +82,24 @@ pc.printf("\n"); pc.printf("New COMMAND : 0x%02X%02X\n", command[0], command[1]); #endif + int i, resp = 0; freeBUFFER(); - + + // Changed wait on following line FROM 100 to 400 for (i = 0; i < commNum; i++) {writeBYTE(command[i]); wait_ms(100);} // send command to serial port - + for (i = 0; i < respNum; i++) { - while (!_cmd.readable()) wait_ms(TEMPO); // wait for screen answer + while (!_cmd.readable()){ wait_ms(TEMPO); } // wait for screen answer if (_cmd.readable()) { resp = _cmd.getc(); // read response if any + #if DEBUGMODE pc.printf("response = 0x%02X\n",resp); #endif } } + return resp; } @@ -121,8 +126,9 @@ command[1] = SPEVERSION & 0xFF; spe = readVERSION(command, 2); - +#if DEBUGMODE pc.printf("spe:%d\n",spe); +#endif } //************************************************************************** @@ -133,8 +139,9 @@ command[1] = PMMCVERSION & 0xFF; pmmc = readVERSION(command, 2); - +#if DEBUGMODE pc.printf("pmmc:%d\n",pmmc); +#endif } //************************************************************************** @@ -256,7 +263,9 @@ while (_cmd.readable() && resp < ARRAY_SIZE(response)) { temp = _cmd.getc(); response[resp] = (char)temp; +#if DEBUGMODE pc.printf("response = 0x%02X\n",response[resp]); +#endif resp++; } switch (resp) {