Compare commits

...

14 Commits

Author SHA1 Message Date
morgan 883a1d1cb5 updating version 2021-04-19 13:32:11 -04:00
Morgan Redfield df7e551844
Merge pull request #2 from per1234/depends
Specify library dependencies in library.properties
2021-04-19 12:17:44 -04:00
Morgan Redfield eae0d7db09
Merge pull request #3 from maqifrnswa/patch-1
dds.h moved to DDS library
2021-04-19 12:16:17 -04:00
Scott Howard 32b02a6128
dds.h moved to DDS library
DDS is its own library now, this is needed to build
2020-06-27 20:49:19 -04:00
per1234 5e512db17d
Specify library dependencies in library.properties
Specifying the library dependencies in the depends field of library.properties causes the Arduino Library Manager (Arduino IDE 1.8.10 and newer) to offer to install any missing dependencies during installation of this library. "arduino-cli lib install" will automatically install the dependencies (arduino-cli 0.7.0 and newer).
2019-12-23 23:41:27 -08:00
Morgan Redfield d2502913d5
Merge pull request #1 from EnhancedRadioDevices/ssid-typo
Fixed what I believe is a typo in SSID handling during packet creation.
2019-03-13 21:12:49 -07:00
Nigel Vander Houwen 0bcbbdb2e3 Fixed what I believe is a typo in SSID handling during packet creation. 2019-03-13 16:33:48 -07:00
morgan 56161805a4 update library properties 2018-11-17 11:47:04 -08:00
morgan 07fbb1af2f fix signedness for char 2018-11-07 16:40:44 -08:00
Morgan Redfield ba97bd4702 Update library.properties 2017-02-03 15:17:49 -08:00
morgan 5fc9e7abbd Merge branch 'master' of https://github.com/EnhancedRadioDevices/HamShield_KISS 2017-02-03 15:15:46 -08:00
Morgan Redfield 0689f95f74 added check for tx before parsing serial 2017-02-03 11:35:06 -08:00
Morgan Redfield 74d7724843 update version 2017-01-15 12:15:21 -08:00
morgan d365fee768 fix KISS TNC 2016-12-27 12:09:02 -08:00
4 changed files with 17 additions and 26 deletions

View File

@ -1,5 +1,5 @@
name=HamShield_KISS
version=1.0.2
version=1.0.6
author=Morgan Redfield <morgan@enhancedradio.com>, Casey Halverson <casey@enhancedradio.com>
maintainer=Morgan Redfield <morgan@enhancedradio.com>
sentence=A library for use with HamShield by Enhanced Radio Devices.
@ -7,4 +7,5 @@ paragraph=See the HamShield library by Enhanced Radio Devices for examples.
category=Device Control
url=http://www.hamshield.com
architectures=*
includes=packet.h, SimpleFIFO.h, KISS.h
includes=packet.h, SimpleFIFO.h, KISS.h
depends=HamShield, DDS

View File

@ -2,6 +2,7 @@
#include "packet.h"
#include "KISS.h"
//AFSK::Packet kissPacket;
bool inFrame = false;
uint8_t kissBuffer[PACKET_MAX_LEN];
@ -11,11 +12,11 @@ uint16_t kissLen = 0;
// KISS equipment, and look if we have anything to relay along
void KISS::loop() {
static bool currentlySending = false;
if(afsk.decoder.read() || afsk.rxPacketCount()) {
if(afsk->decoder.read() || afsk->rxPacketCount()) {
// A true return means something was put onto the packet FIFO
// If we actually have data packets in the buffer, process them all now
while(afsk.rxPacketCount()) {
AFSK::Packet *packet = afsk.getRXPacket();
while(afsk->rxPacketCount()) {
AFSK::Packet *packet = afsk->getRXPacket();
if(packet) {
writePacket(packet);
AFSK::PacketBuffer::freePacket(packet);
@ -23,7 +24,7 @@ void KISS::loop() {
}
}
// Check if we have incoming data to turn into a packet
while(io->available()) {
while(currentlySending == false && io->available()) {
uint8_t c = (uint8_t)io->read();
if(c == KISS_FEND) {
if(inFrame && kissLen > 0) {
@ -34,7 +35,7 @@ void KISS::loop() {
packet->appendFCS(kissBuffer[i]);
}
packet->finish();
afsk.encoder.putPacket(packet);
afsk->encoder.putPacket(packet);
}
kissLen = 0;
inFrame = false;
@ -57,15 +58,15 @@ void KISS::loop() {
inFrame = true;
}
}
if(afsk.txReady()) {
if(afsk->txReady()) {
radio->setModeTransmit();
currentlySending = true;
if(!afsk.txStart()) { // Unable to start for some reason
if(!afsk->txStart()) { // Unable to start for some reason
radio->setModeReceive();
currentlySending = false;
}
}
if(currentlySending && afsk.encoder.isDone()) {
if(currentlySending && afsk->encoder.isDone()) {
radio->setModeReceive();
currentlySending = false;
}
@ -76,7 +77,7 @@ void KISS::writePacket(AFSK::Packet *p) {
io->write(KISS_FEND);
io->write((uint8_t)0); // Host to TNC port identifier
for(i = 0; i < p->len-2; i++) {
char c = p->getByte(i);
unsigned char c = p->getByte(i);
if(c == KISS_FEND || c == KISS_FESC) {
io->write(KISS_FESC);
io->write((c==KISS_FEND?KISS_TFEND:KISS_TFESC));

View File

@ -11,26 +11,15 @@
class KISS {
public:
KISS(Stream *_io, HamShield *h, DDS *d) : io(_io), radio(h), dds(d) {}
KISS(Stream *_io, HamShield *h, DDS *d, AFSK *a) : io(_io), radio(h), dds(d), afsk(a) {}
bool read();
AFSK afsk;
void writePacket(AFSK::Packet *);
void loop();
inline void isr() {
static uint8_t tcnt = 0;
TIFR1 = _BV(ICF1); // Clear the timer flag
dds->clockTick();
if(++tcnt == (DDS_REFCLK_DEFAULT/9600)) {
//PORTD |= _BV(2); // Diagnostic pin (D2)
afsk.timer();
tcnt = 0;
}
//PORTD &= ~(_BV(2));
}
private:
Stream *io;
HamShield *radio;
DDS *dds;
AFSK *afsk;
};
#endif /* _KISS_H_ */

View File

@ -1,7 +1,7 @@
#include <Arduino.h>
#include "SimpleFIFO.h"
#include "packet.h"
#include "dds.h"
#include <DDS.h>
#include <util/atomic.h>
#define PHASE_BIT 8
@ -537,7 +537,7 @@ size_t AFSK::Packet::appendCallsign(const char *callsign, uint8_t ssid, bool fin
if(final) {
ssidField |= 0b01100001;
} else {
ssidField |= 0b11100000;
ssidField |= 0b01100000;
}
appendFCS(ssidField);
}