for Release Version 1.097
This commit is contained in:
parent
7c1ee29500
commit
e79dbdbbe7
@ -28,8 +28,8 @@
|
|||||||
//#define UBITX_DISPLAY_LCD1602I //I2C type 16 x 02 LCD
|
//#define UBITX_DISPLAY_LCD1602I //I2C type 16 x 02 LCD
|
||||||
//#define UBITX_DISPLAY_LCD1602I_DUAL //I2C type 16 x02 LCD Dual
|
//#define UBITX_DISPLAY_LCD1602I_DUAL //I2C type 16 x02 LCD Dual
|
||||||
//#define UBITX_DISPLAY_LCD2004P //24 x 04 LCD (Parallel)
|
//#define UBITX_DISPLAY_LCD2004P //24 x 04 LCD (Parallel)
|
||||||
//#define UBITX_DISPLAY_LCD2004I //I2C type 24 x 04 LCD
|
#define UBITX_DISPLAY_LCD2004I //I2C type 24 x 04 LCD
|
||||||
#define UBITX_DISPLAY_NEXTION //NEXTION LCD
|
//#define UBITX_DISPLAY_NEXTION //NEXTION LCD
|
||||||
|
|
||||||
//#define UBITX_DISPLAY_NEXTION_SAFE //Only EEProm Write 770~775
|
//#define UBITX_DISPLAY_NEXTION_SAFE //Only EEProm Write 770~775
|
||||||
#define I2C_LCD_MASTER_ADDRESS_DEFAULT 0x27 //0x27 //DEFAULT, if Set I2C Address by uBITX Manager, read from EEProm
|
#define I2C_LCD_MASTER_ADDRESS_DEFAULT 0x27 //0x27 //DEFAULT, if Set I2C Address by uBITX Manager, read from EEProm
|
||||||
@ -187,7 +187,7 @@ extern byte I2C_LCD_SECOND_ADDRESS; //only using Dual LCD Mode
|
|||||||
* ground and six pins. Each of these six pins can be individually programmed
|
* ground and six pins. Each of these six pins can be individually programmed
|
||||||
* either as an analog input, a digital input or a digital output.
|
* either as an analog input, a digital input or a digital output.
|
||||||
* The pins are assigned as follows (left to right, display facing you):
|
* The pins are assigned as follows (left to right, display facing you):
|
||||||
* Pin 1 (Violet), A7, SPARE
|
* Pin 1 (Violet), A7, SPARE => Analog S-Meter
|
||||||
* Pin 2 (Blue), A6, KEYER (DATA)
|
* Pin 2 (Blue), A6, KEYER (DATA)
|
||||||
* Pin 3 (Green), +5v
|
* Pin 3 (Green), +5v
|
||||||
* Pin 4 (Yellow), Gnd
|
* Pin 4 (Yellow), Gnd
|
||||||
@ -217,7 +217,7 @@ extern byte I2C_LCD_SECOND_ADDRESS; //only using Dual LCD Mode
|
|||||||
* The second set of 16 pins on the Raduino's bottom connector are have the three clock outputs and the digital lines to control the rig.
|
* The second set of 16 pins on the Raduino's bottom connector are have the three clock outputs and the digital lines to control the rig.
|
||||||
* This assignment is as follows :
|
* This assignment is as follows :
|
||||||
* Pin 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
|
* Pin 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
|
||||||
* GND +5V CLK0 GND GND CLK1 GND GND CLK2 GND D2 D3 D4 D5 D6 D7
|
* GND +5V CLK2 GND GND CLK1 GND GND CLK0 GND D2 D3 D4 D5 D6 D7
|
||||||
* These too are flexible with what you may do with them, for the Raduino, we use them to :
|
* These too are flexible with what you may do with them, for the Raduino, we use them to :
|
||||||
* - TX_RX line : Switches between Transmit and Receive after sensing the PTT or the morse keyer
|
* - TX_RX line : Switches between Transmit and Receive after sensing the PTT or the morse keyer
|
||||||
* - CW_KEY line : turns on the carrier for CW
|
* - CW_KEY line : turns on the carrier for CW
|
||||||
|
@ -1255,9 +1255,15 @@ void setup()
|
|||||||
initSettings();
|
initSettings();
|
||||||
initPorts();
|
initPorts();
|
||||||
|
|
||||||
#ifndef USE_SW_SERIAL
|
#ifdef USE_SW_SERIAL
|
||||||
|
// if (userCallsignLength > 0 && ((userCallsignLength & 0x80) == 0x80))
|
||||||
|
// {
|
||||||
|
userCallsignLength = userCallsignLength & 0x7F;
|
||||||
|
// }
|
||||||
|
#else
|
||||||
//for Chracter LCD
|
//for Chracter LCD
|
||||||
if (userCallsignLength > 0 && ((userCallsignLength & 0x80) == 0x80)) {
|
if (userCallsignLength > 0 && ((userCallsignLength & 0x80) == 0x80))
|
||||||
|
{
|
||||||
userCallsignLength = userCallsignLength & 0x7F;
|
userCallsignLength = userCallsignLength & 0x7F;
|
||||||
DisplayCallsign(userCallsignLength);
|
DisplayCallsign(userCallsignLength);
|
||||||
}
|
}
|
||||||
|
@ -230,16 +230,37 @@ void SendHeader(char varType, char varIndex)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define INT_ETX 0
|
||||||
|
#define STR_ETX 1
|
||||||
|
#define TMP_ETX 2
|
||||||
|
//Send 0xFF, 0xFF, 0xFF
|
||||||
|
//etxType : INT_ETX = 0xFF, 0xFF, 0xFF
|
||||||
|
// STR_ETX = ", 0xFF, 0xFF, 0xFF
|
||||||
|
// TEMP_ETX = softTemp, 0xFF, 0xFF, 0xff
|
||||||
|
|
||||||
|
void SendCommandETX(char etxType)
|
||||||
|
{
|
||||||
|
if (etxType == 2)
|
||||||
|
{
|
||||||
|
SWSerial_Print(softTemp);
|
||||||
|
}
|
||||||
|
else if (etxType == 1)
|
||||||
|
{
|
||||||
|
SWSerial_Print("\"");
|
||||||
|
}
|
||||||
|
|
||||||
|
SWSerial_Write(0xff);
|
||||||
|
SWSerial_Write(0xff);
|
||||||
|
SWSerial_Write(0xff);
|
||||||
|
}
|
||||||
|
|
||||||
void SendCommandUL(char varIndex, unsigned long sendValue)
|
void SendCommandUL(char varIndex, unsigned long sendValue)
|
||||||
{
|
{
|
||||||
SendHeader(SWS_HEADER_INT_TYPE, varIndex);
|
SendHeader(SWS_HEADER_INT_TYPE, varIndex);
|
||||||
|
|
||||||
memset(softTemp, 0, 20);
|
memset(softTemp, 0, 20);
|
||||||
ultoa(sendValue, softTemp, DEC);
|
ultoa(sendValue, softTemp, DEC);
|
||||||
SWSerial_Print(softTemp);
|
SendCommandETX(TMP_ETX);
|
||||||
SWSerial_Write(0xff);
|
|
||||||
SWSerial_Write(0xff);
|
|
||||||
SWSerial_Write(0xff);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SendCommandL(char varIndex, long sendValue)
|
void SendCommandL(char varIndex, long sendValue)
|
||||||
@ -248,10 +269,7 @@ void SendCommandL(char varIndex, long sendValue)
|
|||||||
|
|
||||||
memset(softTemp, 0, 20);
|
memset(softTemp, 0, 20);
|
||||||
ltoa(sendValue, softTemp, DEC);
|
ltoa(sendValue, softTemp, DEC);
|
||||||
SWSerial_Print(softTemp);
|
SendCommandETX(TMP_ETX);
|
||||||
SWSerial_Write(0xff);
|
|
||||||
SWSerial_Write(0xff);
|
|
||||||
SWSerial_Write(0xff);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SendCommandStr(char varIndex, char* sendValue)
|
void SendCommandStr(char varIndex, char* sendValue)
|
||||||
@ -259,10 +277,7 @@ void SendCommandStr(char varIndex, char* sendValue)
|
|||||||
SendHeader(SWS_HEADER_STR_TYPE, varIndex);
|
SendHeader(SWS_HEADER_STR_TYPE, varIndex);
|
||||||
|
|
||||||
SWSerial_Print(sendValue);
|
SWSerial_Print(sendValue);
|
||||||
SWSerial_Write('\"');
|
SendCommandETX(STR_ETX);
|
||||||
SWSerial_Write(0xFF);
|
|
||||||
SWSerial_Write(0xFF);
|
|
||||||
SWSerial_Write(0xFF);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//Send String data with duplicate check
|
//Send String data with duplicate check
|
||||||
@ -274,10 +289,7 @@ void SendTextLineBuff(char lineNumber)
|
|||||||
SendHeader(SWS_HEADER_STR_TYPE, lineNumber + 0x30); //s0.txt, s1.txt
|
SendHeader(SWS_HEADER_STR_TYPE, lineNumber + 0x30); //s0.txt, s1.txt
|
||||||
|
|
||||||
SWSerial_Print(softBuffLines[lineNumber]);
|
SWSerial_Print(softBuffLines[lineNumber]);
|
||||||
SWSerial_Write('\"');
|
SendCommandETX(STR_ETX);
|
||||||
SWSerial_Write(0xFF);
|
|
||||||
SWSerial_Write(0xFF);
|
|
||||||
SWSerial_Write(0xFF);
|
|
||||||
|
|
||||||
strcpy(softBuffSended[lineNumber], softBuffLines[lineNumber]);
|
strcpy(softBuffSended[lineNumber], softBuffLines[lineNumber]);
|
||||||
}
|
}
|
||||||
@ -312,10 +324,7 @@ void SendEEPromData(char varIndex, int eepromStartIndex, int eepromEndIndex, cha
|
|||||||
SWSerial_Write(EEPROM.read((offsetTtype == 0 ? USER_CALLSIGN_DAT : WSPR_MESSAGE1) + i));
|
SWSerial_Write(EEPROM.read((offsetTtype == 0 ? USER_CALLSIGN_DAT : WSPR_MESSAGE1) + i));
|
||||||
}
|
}
|
||||||
|
|
||||||
SWSerial_Write('\"');
|
SendCommandETX(STR_ETX);
|
||||||
SWSerial_Write(0xFF);
|
|
||||||
SWSerial_Write(0xFF);
|
|
||||||
SWSerial_Write(0xFF);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t softBuff1Num[14] = {'p', 'm', '.', 'c', '0', '.', 'v', 'a', 'l', '=', 0, 0xFF, 0xFF, 0xFF};
|
uint8_t softBuff1Num[14] = {'p', 'm', '.', 'c', '0', '.', 'v', 'a', 'l', '=', 0, 0xFF, 0xFF, 0xFF};
|
||||||
@ -646,7 +655,6 @@ void updateDisplay() {
|
|||||||
#define RESPONSE_EEPROM_STR 87 //String
|
#define RESPONSE_EEPROM_STR 87 //String
|
||||||
|
|
||||||
const uint8_t ResponseHeader[11]={'p', 'm', '.', 's', 'h', '.', 't', 'x', 't', '=', '"'};
|
const uint8_t ResponseHeader[11]={'p', 'm', '.', 's', 'h', '.', 't', 'x', 't', '=', '"'};
|
||||||
const uint8_t ResponseFooter[4]={'"', 0xFF, 0xFF, 0xFF};
|
|
||||||
const char HexCodes[16] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f', };
|
const char HexCodes[16] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f', };
|
||||||
|
|
||||||
//void sendSpectrumData(unsigned long startFreq, unsigned long incStep, int scanCount, int delayTime, int sendCount)
|
//void sendSpectrumData(unsigned long startFreq, unsigned long incStep, int scanCount, int delayTime, int sendCount)
|
||||||
@ -719,9 +727,7 @@ void sendResponseData(int protocolType, unsigned long startFreq, unsigned int se
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < 4; i++)
|
SendCommandETX(STR_ETX);
|
||||||
SWSerial_Write(ResponseFooter[i]);
|
|
||||||
|
|
||||||
} //end of for
|
} //end of for
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -995,12 +1001,7 @@ void idle_process()
|
|||||||
#else
|
#else
|
||||||
int newSMeter;
|
int newSMeter;
|
||||||
|
|
||||||
//VK2ETA S-Meter from MAX9814 TC pin
|
|
||||||
newSMeter = analogRead(ANALOG_SMETER) / 4;
|
newSMeter = analogRead(ANALOG_SMETER) / 4;
|
||||||
|
|
||||||
//Faster attack, Slower release
|
|
||||||
//currentSMeter = (newSMeter > currentSMeter ? ((currentSMeter * 3 + newSMeter * 7) + 5) / 10 : ((currentSMeter * 7 + newSMeter * 3) + 5) / 10);
|
|
||||||
//currentSMeter = ((currentSMeter * 7 + newSMeter * 3) + 5) / 10;
|
|
||||||
currentSMeter = newSMeter;
|
currentSMeter = newSMeter;
|
||||||
|
|
||||||
scaledSMeter = 0;
|
scaledSMeter = 0;
|
||||||
|
@ -290,11 +290,10 @@ int GetI2CSmeterValue(int valueType)
|
|||||||
{
|
{
|
||||||
return Wire.read();
|
return Wire.read();
|
||||||
}
|
}
|
||||||
//else
|
else
|
||||||
//{
|
{
|
||||||
// delay(10);
|
return 0;
|
||||||
// return Wire.read();
|
}
|
||||||
//}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user