mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[apps/POSTAndHWTest] POST does Text tests, not full LCD tests
This commit is contained in:
@@ -15,7 +15,7 @@ bool LCDDataTestController::handleEvent(Ion::Events::Event event) {
|
||||
}
|
||||
|
||||
void LCDDataTestController::viewWillAppear() {
|
||||
bool testOK = Shared::POSTAndHardwareTests::LCDDataOK(k_LCDTestIterationsCount);
|
||||
bool testOK = Shared::POSTAndHardwareTests::LCDDataOK();
|
||||
m_view.lcdDataStateTextView()->setText(testOK ? k_lcdDataOKText : k_lcdDataFailTest);
|
||||
m_view.setColor(testOK ? KDColorGreen : KDColorRed);
|
||||
}
|
||||
|
||||
@@ -7,16 +7,6 @@
|
||||
namespace HardwareTest {
|
||||
|
||||
class LCDDataTestController : public ViewController {
|
||||
|
||||
/* We want to test that:
|
||||
* - Command/data switching is OK,
|
||||
* - Data is correctly sent,
|
||||
* - There are no short-circuits between the data wires.
|
||||
* We thus send a tiled pattern (to test command/data switching), where each
|
||||
* tile is a checker of a color and its contrary (to tests that Data is sent
|
||||
* OK). To test each of the 16 data wires for short-circuits, we use 16 colors:
|
||||
* 2**k with 0 <= k < 16. */
|
||||
|
||||
public:
|
||||
LCDDataTestController(Responder * parentResponder) :
|
||||
ViewController(parentResponder),
|
||||
@@ -42,7 +32,6 @@ private:
|
||||
};
|
||||
constexpr static const char * k_lcdDataOKText = "LCD DATA: OK";
|
||||
constexpr static const char * k_lcdDataFailTest = "LCD DATA: FAIL";
|
||||
constexpr static int k_LCDTestIterationsCount = 20;
|
||||
|
||||
ContentView m_view;
|
||||
};
|
||||
|
||||
@@ -9,7 +9,7 @@ KDColor PowerOnSelfTest::Perform() {
|
||||
KDColor resultColor = KDColorGreen;
|
||||
|
||||
// Screen tests
|
||||
bool screenTestsOK = Shared::POSTAndHardwareTests::VBlankOK() && Shared::POSTAndHardwareTests::LCDDataOK(k_LCDTestIterationsCount);
|
||||
bool screenTestsOK = Shared::POSTAndHardwareTests::VBlankOK() && Shared::POSTAndHardwareTests::TextLCDTestOK();
|
||||
|
||||
// We push a white screen so that the LCD Data test is invisible for the user.
|
||||
Ion::Display::waitForVBlank();
|
||||
|
||||
@@ -38,11 +38,11 @@ bool POSTAndHardwareTests::TextLCDTestOK() {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool POSTAndHardwareTests::LCDDataOK(int numberOfIterations) {
|
||||
bool POSTAndHardwareTests::LCDDataOK() {
|
||||
if (!TextLCDTestOK()) {
|
||||
return false;
|
||||
}
|
||||
for (int iteration = 0; iteration < numberOfIterations; iteration++) {
|
||||
for (int iteration = 0; iteration < k_numberOfTilingLCDIterations; iteration++) {
|
||||
Ion::Display::POSTPushMulticolor(iteration, k_stampSize);
|
||||
KDColor stamp[k_stampSize*k_stampSize];
|
||||
int numberOfInvalidPixels = 0;
|
||||
|
||||
@@ -11,10 +11,19 @@ public:
|
||||
static bool BatteryOK();
|
||||
static bool VBlankOK();
|
||||
static bool TextLCDTestOK();
|
||||
/* LCDDataOK carefully tests the LCD controller. It verifies that:
|
||||
* - Command/data switching is OK,
|
||||
* - Data is correctly sent,
|
||||
* - There are no short-circuits between the data wires.
|
||||
* LCDDataOK thus sends a tiled pattern (to test command/data switching),
|
||||
* where each tile is a checker of a color and its contrary (to tests that
|
||||
* Data is sent OK). To test each of the 16 data wires for short-circuits, 16
|
||||
* colors are used: 2**k with 0 <= k < 16. */
|
||||
static bool LCDDataOK();
|
||||
private:
|
||||
constexpr static int k_stampSize = 8;
|
||||
constexpr static int k_invalidPixelsLimit = 2;
|
||||
constexpr static int k_numberOfTilingLCDIterations = 20;
|
||||
static_assert(Ion::Display::Width % k_stampSize == 0, "Stamps must tesselate the display");
|
||||
static_assert(Ion::Display::Height % k_stampSize == 0, "Stamps must tesselate the display");
|
||||
static_assert(k_stampSize % 2 == 0, "Even number of XOR needed.");
|
||||
|
||||
Reference in New Issue
Block a user