Refactor to use new protocol module and sipo.
[bertos.git] / bertos / net / afsk.c
index 3f96d4daa7ce97fd4563ba7b1e9b4816594a288d..d58758cd8397031613a1e8b9395f7421b5edc241 100644 (file)
@@ -32,8 +32,7 @@
  *
  * \brief AFSK1200 modem.
  *
- * \version $Id$
- * \author Francesco Sacchi <asterix@develer.com>
+ * \author Francesco Sacchi <batt@develer.com>
  */
 
 #include "afsk.h"
@@ -106,11 +105,7 @@ INLINE uint8_t sin_sample(uint16_t idx)
        uint16_t new_idx = idx % (SIN_LEN / 2);
        new_idx = (new_idx >= (SIN_LEN / 4)) ? (SIN_LEN / 2 - new_idx - 1) : new_idx;
 
-       #if CPU_HARVARD
-               uint8_t data = pgm_read_char(&sin_table[new_idx]);
-       #else
-               uint8_t data = sin_table[new_idx];
-       #endif
+       uint8_t data = pgm_read8(&sin_table[new_idx]);
 
        return (idx >= (SIN_LEN / 2)) ? (255 - data) : data;
 }
@@ -127,7 +122,7 @@ INLINE uint8_t sin_sample(uint16_t idx)
  * \param bit  current bit to be parsed.
  * \param fifo FIFO buffer used to push characters.
  *
- * \return True if all is ok, False if the fifo is full.
+ * \return true if all is ok, false if the fifo is full.
  */
 static bool hdlc_parse(Hdlc *hdlc, bool bit, FIFOBuffer *fifo)
 {
@@ -209,7 +204,7 @@ static bool hdlc_parse(Hdlc *hdlc, bool bit, FIFOBuffer *fifo)
  * ADC ISR callback.
  * This function has to be called by the ADC ISR when a sample of the configured
  * channel is available.
- * \param af Afsk context to operate one (\see Afsk).
+ * \param af Afsk context to operate on.
  * \param curr_sample current sample from the ADC.
  */
 void afsk_adc_isr(Afsk *af, int8_t curr_sample)
@@ -340,7 +335,7 @@ static void afsk_txStart(Afsk *af)
  * This function has to be called by the DAC ISR when a sample of the configured
  * channel has been converted out.
  *
- * \param af Afsk context to operate one (\see Afsk).
+ * \param af Afsk context to operate on.
  *
  * \return The next DAC output sample.
  */
@@ -477,7 +472,7 @@ static size_t afsk_read(KFile *fd, void *_buf, size_t size)
                ticks_t start = timer_clock();
                #endif
 
-               while (fifo_isempty_locked(&af->rx_fifo));
+               while (fifo_isempty_locked(&af->rx_fifo))
                {
                        cpu_relax();
                        #if CONFIG_AFSK_RXTIMEOUT != -1
@@ -535,7 +530,7 @@ static void afsk_clearerr(KFile *fd)
 
 /**
  * Initialize an AFSK1200 modem.
- * \param af Afsk context to operate one (\see Afsk).
+ * \param af Afsk context to operate on.
  * \param adc_ch  ADC channel used by the demodulator.
  * \param dac_ch  DAC channel used by the modulator.
  */