From 9748738edcfbc820c8e2d9e05eb26af17a2d78f3 Mon Sep 17 00:00:00 2001 From: meepingsnesroms Date: Sun, 1 Jul 2018 16:34:05 -0700 Subject: [PATCH] Reading from the touchscreen now works by executing private APIs directly by pointer This should speed things up alot! --- hwTestSuite/blobs.c | 9 ++++++--- hwTestSuite/blobs.h | 2 +- hwTestSuite/tests.c | 3 ++- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/hwTestSuite/blobs.c b/hwTestSuite/blobs.c index 5667987..2530274 100644 --- a/hwTestSuite/blobs.c +++ b/hwTestSuite/blobs.c @@ -3,7 +3,8 @@ #include "testSuite.h" -static ALIGN(2) uint8_t HwrADC_PIC_bin[] = { +/* +static uint8_t HwrADC_PIC_bin[] ALIGN(2) = { 0x4e, 0x56, 0xff, 0xe2, 0x48, 0xe7, 0x1f, 0x38, 0x7c, 0x00, 0x40, 0xc0, 0x00, 0x7c, 0x07, 0x00, 0x3d, 0x40, 0xff, 0xe2, 0x24, 0x6e, 0x00, 0x0a, 0x02, 0x38, 0x00, 0xfb, 0xf4, 0x31, 0x00, 0x38, 0x00, 0x01, 0xf4, 0x20, @@ -102,7 +103,9 @@ static ALIGN(2) uint8_t HwrADC_PIC_bin[] = { 0x46, 0xc0, 0x30, 0x06, 0x4c, 0xdf, 0x1c, 0xf8, 0x4e, 0x5e, 0x4e, 0x75, 0x86, 0x48, 0x77, 0x72, 0x41, 0x44, 0x43 }; +*/ /*static uint32_t HwrADC_PIC_len = 1159;*/ - -const void (*customCall_HwrADC)(uint16_t mode, void* returnData) = (const void (*)(uint16_t, void*))HwrADC_PIC_bin; +/*Prv* and Hwr* calls are not exposed so they must be called by fixed address or copyed into the code*/ +/*uint16_t (*customCall_HwrADC)(uint16_t mode, void* returnData) = (uint16_t (*)(uint16_t, void*))HwrADC_PIC_bin;*/ +uint16_t (*customCall_HwrADC)(uint16_t mode, void* returnData) = (uint16_t (*)(uint16_t, void*))0x10081284;/*Palm m515 ROM HwrADC address*/ diff --git a/hwTestSuite/blobs.h b/hwTestSuite/blobs.h index 77ea112..18b98de 100644 --- a/hwTestSuite/blobs.h +++ b/hwTestSuite/blobs.h @@ -4,6 +4,6 @@ #include #include -const void (*customCall_HwrADC)(uint16_t mode, void* returnData); +uint16_t (*customCall_HwrADC)(uint16_t mode, void* returnData); #endif diff --git a/hwTestSuite/tests.c b/hwTestSuite/tests.c index d454a64..4debd21 100644 --- a/hwTestSuite/tests.c +++ b/hwTestSuite/tests.c @@ -439,6 +439,7 @@ var ads7846ReadOsVersion(){ uint16_t channelData[14];/*should be 7 but just want to be safe*/ uint16_t y = 0; + if(firstRun){ firstRun = false; referenceMode = false; @@ -455,7 +456,7 @@ var ads7846ReadOsVersion(){ customCall_HwrADC(referenceMode, channelData); - StrPrintF(sharedDataBuffer, "Ref Mode:%s", referenceMode ? "true" : "false"); + StrPrintF(sharedDataBuffer, "Ref Mode:%s", referenceMode ? "true " : "false"); UG_PutString(0, y, sharedDataBuffer); y += FONT_HEIGHT + 1;