Optimising

This commit is contained in:
Sjef Verhoeven PE5PVB
2024-12-23 16:10:33 +01:00
parent cc15ac6159
commit e27c2f504e
5 changed files with 11 additions and 5 deletions

View File

@@ -6,7 +6,6 @@
#include <Wire.h> #include <Wire.h>
#include <math.h> #include <math.h>
#include <TimeLib.h> #include <TimeLib.h>
#include <ESP32Time.h> // https://github.com/fbiego/ESP32Time/archive/refs/heads/main.zip
#include <TFT_eSPI.h> // https://github.com/ohmytime/TFT_eSPI_DynamicSpeed/archive/refs/heads/master.zip (please then edit the User_Setup.h as described in the Wiki) #include <TFT_eSPI.h> // https://github.com/ohmytime/TFT_eSPI_DynamicSpeed/archive/refs/heads/master.zip (please then edit the User_Setup.h as described in the Wiki)
#include <Hash.h> // https://github.com/bbx10/Hash_tng/archive/refs/heads/master.zip #include <Hash.h> // https://github.com/bbx10/Hash_tng/archive/refs/heads/master.zip
#include "src/WiFiConnect.h" #include "src/WiFiConnect.h"
@@ -5212,9 +5211,7 @@ void TuneFreq(int temp) {
} }
void NumpadProcess(int num) { void NumpadProcess(int num) {
static bool input_mode = false; if (scandxmode) {
if (scandxmode) {
if (num == 127) cancelDXScan(); if (num == 127) cancelDXScan();
} else { } else {
if (num == 127) { if (num == 127) {

View File

@@ -3,6 +3,8 @@
#include "Tuner_Patch_Lithio_V205_p512.h" #include "Tuner_Patch_Lithio_V205_p512.h"
#include <Wire.h> #include <Wire.h>
bool Data_Accelerator = false;
const unsigned char tuner_init_tab[] PROGMEM = { const unsigned char tuner_init_tab[] PROGMEM = {
7, 0x20, 0x0B, 0x01, 0x03, 0x98, 0x00, 0x00, 7, 0x20, 0x0B, 0x01, 0x03, 0x98, 0x00, 0x00,
5, 0x20, 0x14, 0x01, 0x00, 0x00, 5, 0x20, 0x14, 0x01, 0x00, 0x00,
@@ -72,7 +74,7 @@ bool Tuner_WriteBuffer(unsigned char *buf, uint16_t len) {
Wire.beginTransmission(0x64); Wire.beginTransmission(0x64);
for (uint16_t i = 0; i < len; i++) Wire.write(buf[i]); for (uint16_t i = 0; i < len; i++) Wire.write(buf[i]);
uint8_t r = Wire.endTransmission(); uint8_t r = Wire.endTransmission();
delayMicroseconds(100); if (!Data_Accelerator) delay(2);
return (r == 0) ? 1 : 0; return (r == 0) ? 1 : 0;
} }

View File

@@ -1,3 +1,6 @@
#ifndef TUNER_INTERFACE_H
#define TUNER_INTERFACE_H
void Tuner_I2C_Init(); void Tuner_I2C_Init();
void Tuner_Patch(byte TEF); void Tuner_Patch(byte TEF);
void Tuner_Init(const unsigned char *table); void Tuner_Init(const unsigned char *table);
@@ -5,3 +8,4 @@ bool Tuner_WriteBuffer(unsigned char *buf, uint16_t len);
bool Tuner_ReadBuffer(unsigned char *buf, uint16_t len); bool Tuner_ReadBuffer(unsigned char *buf, uint16_t len);
bool Tuner_Table_Write(const unsigned char *tab); bool Tuner_Table_Write(const unsigned char *tab);
void Tuner_Reset(void); void Tuner_Reset(void);
#endif

View File

@@ -675,6 +675,7 @@ void XDRGTKRoutine() {
if (scandxmode) cancelDXScan(); if (scandxmode) cancelDXScan();
if (!XDRScan) BWsetRecall = BWset; if (!XDRScan) BWsetRecall = BWset;
XDRScan = true; XDRScan = true;
Data_Accelerator = true;
switch (buff[1]) { switch (buff[1]) {
case 'a': scanner_start = (atol(buff + 2) + 5) / 10; break; case 'a': scanner_start = (atol(buff + 2) + 5) / 10; break;
@@ -763,6 +764,7 @@ void XDRGTKRoutine() {
} }
break; break;
} }
Data_Accelerator = false;
break; break;
case 'W': case 'W':

View File

@@ -15,6 +15,7 @@ extern bool afscreen;
extern bool aftest; extern bool aftest;
extern bool autosquelch; extern bool autosquelch;
extern bool BWreset; extern bool BWreset;
extern bool Data_Accelerator;
extern bool direction; extern bool direction;
extern bool externaltune; extern bool externaltune;
extern bool fullsearchrds; extern bool fullsearchrds;