From a718d3064d1d1b3a29a74ab364540fe67dfaa900 Mon Sep 17 00:00:00 2001 From: Reed Nightingale Date: Wed, 1 Jan 2020 11:48:41 -0800 Subject: [PATCH] Get rid of touch-specific SPI settings --- nano_gui.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/nano_gui.cpp b/nano_gui.cpp index 00ac5b5..acc008e 100644 --- a/nano_gui.cpp +++ b/nano_gui.cpp @@ -37,7 +37,6 @@ void writeTouchCalibration(){ #define Z_THRESHOLD 400 #define Z_THRESHOLD_INT 75 #define MSEC_THRESHOLD 3 -#define SPI_SETTING SPISettings(2000000, MSBFIRST, SPI_MODE0) static uint32_t msraw=0x80000000; static int16_t xraw=0, yraw=0, zraw=0; @@ -63,7 +62,6 @@ static void touch_update(){ uint32_t now = millis(); if (now - msraw < MSEC_THRESHOLD) return; - SPI.beginTransaction(SPI_SETTING); digitalWrite(CS_PIN, LOW); SPI.transfer(0xB1 /* Z1 */); int16_t z1 = SPI.transfer16(0xC1 /* Z2 */) >> 3; @@ -81,7 +79,6 @@ static void touch_update(){ data[4] = SPI.transfer16(0xD0 /* Y */) >> 3; // Last Y touch power down data[5] = SPI.transfer16(0) >> 3; digitalWrite(CS_PIN, HIGH); - SPI.endTransaction(); //Serial.printf("z=%d :: z1=%d, z2=%d ", z, z1, z2); if (z < 0) z = 0; if (z < Z_THRESHOLD) { // if ( !touched ) {