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.
Fork of RA8875 by
Diff: RA8875.cpp
- Revision:
- 91:ca5f829e6d27
- Parent:
- 90:d113d71ae4f0
- Child:
- 92:ce1ab76e8614
diff -r d113d71ae4f0 -r ca5f829e6d27 RA8875.cpp
--- a/RA8875.cpp Wed Jan 28 12:21:11 2015 +0000
+++ b/RA8875.cpp Wed Jan 28 12:30:45 2015 +0000
@@ -61,6 +61,7 @@
"Rectangle", "Rounded Rectangle",
"Triangle", "Circle", "Ellipse"
};
+uint16_t commandsUsed[256]; // track which commands are used with simple counter of number of hits.
#else
#define PERFORMANCE_RESET
#define REGISTERPERFORMANCE(a)
@@ -403,6 +404,10 @@
pc.printf("%10d uS %s\r\n", metrics[i], metricsName[i]);
}
pc.printf("%10d uS Idle time polling display for ready.\r\n", idletime_usec);
+ for (i=0; i<256; i++) {
+ if (commandsUsed[i])
+ pc.printf("Command %02X used %5d times.\r\n", i, commandsUsed[i])
+ }
}
#endif
@@ -428,6 +433,10 @@
RetCode_t RA8875::WriteCommand(unsigned char command, unsigned int data)
{
+#ifdef PERF_METRICS
+ if (commandsUsed[command] <= 65535)
+ commandsUsed[command]++;
+#endif
_select(true);
_spiwrite(0x80); // RS:1 (Cmd/Status), RW:0 (Write)
_spiwrite(command);
