Reading from the touchscreen now works by executing private APIs directly by pointer

This should speed things up alot!
This commit is contained in:
meepingsnesroms
2018-07-01 16:34:05 -07:00
parent fd741e4634
commit 9748738edc
3 changed files with 9 additions and 5 deletions

View File

@@ -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*/

View File

@@ -4,6 +4,6 @@
#include <PalmOS.h>
#include <stdint.h>
const void (*customCall_HwrADC)(uint16_t mode, void* returnData);
uint16_t (*customCall_HwrADC)(uint16_t mode, void* returnData);
#endif

View File

@@ -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;