Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Qvist committed Apr 4, 2014
1 parent 2dc4e73 commit 6b496c3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 13 deletions.
7 changes: 2 additions & 5 deletions Modem/afsk.c
Expand Up @@ -5,12 +5,9 @@
#include <drv/timer.h>
#include <cfg/module.h>

#include <cfg/log.h>

#include <cpu/power.h>
#include <cpu/pgm.h>
#include <struct/fifobuf.h>

#include <string.h>

// Sine table for DAC DDS
Expand All @@ -28,7 +25,7 @@ static const uint8_t PROGMEM sin_table[] =
}; STATIC_ASSERT(sizeof(sin_table) == SIN_LEN / 4);


// Calculate Sine value from quarter sine table
// Calculate any sine value from quarter wave sine table
INLINE uint8_t sinSample(uint16_t i) {
ASSERT(i < SIN_LEN);
uint16_t newI = i % (SIN_LEN/2);
Expand Down Expand Up @@ -147,7 +144,7 @@ void afsk_adc_isr(Afsk *afsk, int8_t currentSample) {
// the bit of the sample, we multiply the sample by
// a sample delayed by (samples per bit / 2).
// We then lowpass-filter the sample with a first
// order 600Hz filter
// order 600Hz filter. This is a Chebyshev filter.

afsk->iirX[0] = afsk->iirX[1];
afsk->iirX[1] = ((int8_t)fifo_pop(&afsk->delayFifo) * currentSample) >> 2;
Expand Down
10 changes: 3 additions & 7 deletions Modem/afsk.h
Expand Up @@ -10,9 +10,9 @@
#include <struct/fifobuf.h>


#define SAMPLERATE 9600
#define BITRATE 1200
#define SAMPLESPERBIT (SAMPLERATE / BITRATE)
#define SAMPLERATE 9600 // The rate at which we are sampling and synthesizing
#define BITRATE 1200 // The actual bitrate at baseband. This is the baudrate.
#define SAMPLESPERBIT (SAMPLERATE / BITRATE) // How many DAC/ADC samples constitute on bit (8).

typedef struct Hdlc
{
Expand Down Expand Up @@ -99,8 +99,4 @@ void afsk_adc_isr(Afsk *af, int8_t sample);
uint8_t afsk_dac_isr(Afsk *af);
void afsk_init(Afsk *af, int adc_ch, int dac_ch);

//int afsk_testSetup(void);
//int afsk_testRun(void);
//int afsk_testTearDown(void);

#endif
2 changes: 1 addition & 1 deletion buildrev.h
@@ -1,2 +1,2 @@
#define VERS_BUILD 123
#define VERS_BUILD 126
#define VERS_HOST "vixen"

0 comments on commit 6b496c3

Please sign in to comment.