From 638369d6596f14194d43ed23b22473dd327ccdee Mon Sep 17 00:00:00 2001 From: Stephen Olesen Date: Mon, 13 Jul 2015 21:16:22 -0600 Subject: [PATCH] Minor fixups to KISS, now append FCS. Remove 19200 refclk for now. --- KISS.cpp | 4 ++-- examples/KISS/KISS.ino | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/KISS.cpp b/KISS.cpp index 06a2115..fdcd52a 100644 --- a/KISS.cpp +++ b/KISS.cpp @@ -23,7 +23,7 @@ void KISS::loop() { } } // Check if we have incoming data to turn into a packet - if(io->available()) { + while(io->available()) { uint8_t c = (uint8_t)io->read(); if(c == KISS_FEND) { if(inFrame && kissLen > 0) { @@ -31,7 +31,7 @@ void KISS::loop() { AFSK::Packet *packet = AFSK::PacketBuffer::makePacket(PACKET_MAX_LEN); packet->start(); for(i = 0; i < kissLen; i++) { - packet->append(kissBuffer[i]); + packet->appendFCS(kissBuffer[i]); } packet->finish(); radio->afsk.encoder.putPacket(packet); diff --git a/examples/KISS/KISS.ino b/examples/KISS/KISS.ino index 7cec7e1..e308284 100644 --- a/examples/KISS/KISS.ino +++ b/examples/KISS/KISS.ino @@ -1,5 +1,3 @@ -#define DDS_REFCLK_DEFAULT 19200 - #include #include #include @@ -21,7 +19,7 @@ void setup() { radio.setFrequency(145010); I2Cdev::writeWord(A1846S_DEV_ADDR_SENLOW, 0x30, 0x06); I2Cdev::writeWord(A1846S_DEV_ADDR_SENLOW, 0x30, 0x26); - I2Cdev::writeWord(A1846S_DEV_ADDR_SENLOW, 0x44, 0b0000011111111111); + I2Cdev::writeWord(A1846S_DEV_ADDR_SENLOW, 0x44, 0x05FF); dds.start(); radio.afsk.start(&dds);