projects
/
bertos.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
USB: coding style fixes (structure naming)
[bertos.git]
/
bertos
/
net
/
afsk.c
diff --git
a/bertos/net/afsk.c
b/bertos/net/afsk.c
index 4a195891d9befe3e1a96c7d5b5dafc86fa854678..d7ac8bf0cb7a32fc22d08780ae272fc7046e9862 100644
(file)
--- a/
bertos/net/afsk.c
+++ b/
bertos/net/afsk.c
@@
-32,8
+32,7
@@
*
* \brief AFSK1200 modem.
*
*
* \brief AFSK1200 modem.
*
- * \version $Id$
- * \author Francesco Sacchi <asterix@develer.com>
+ * \author Francesco Sacchi <batt@develer.com>
*/
#include "afsk.h"
*/
#include "afsk.h"
@@
-127,7
+126,7
@@
INLINE uint8_t sin_sample(uint16_t idx)
* \param bit current bit to be parsed.
* \param fifo FIFO buffer used to push characters.
*
* \param bit current bit to be parsed.
* \param fifo FIFO buffer used to push characters.
*
- * \return
True if all is ok, F
alse if the fifo is full.
+ * \return
true if all is ok, f
alse if the fifo is full.
*/
static bool hdlc_parse(Hdlc *hdlc, bool bit, FIFOBuffer *fifo)
{
*/
static bool hdlc_parse(Hdlc *hdlc, bool bit, FIFOBuffer *fifo)
{
@@
-209,7
+208,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.
* 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 on
e (\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)
* \param curr_sample current sample from the ADC.
*/
void afsk_adc_isr(Afsk *af, int8_t curr_sample)
@@
-340,13
+339,14
@@
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.
*
* 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 on
e (\see Afsk)
.
+ * \param af Afsk context to operate on.
*
*
- * \note The next DAC output sample is supplied by the Afsk driver through calling
- * the AFSK_DAC_SET() callback.
+ * \return The next DAC output sample.
*/
*/
-
void
afsk_dac_isr(Afsk *af)
+
uint8_t
afsk_dac_isr(Afsk *af)
{
{
+ AFSK_STROBE_ON();
+
/* Check if we are at a start of a sample cycle */
if (af->sample_count == 0)
{
/* Check if we are at a start of a sample cycle */
if (af->sample_count == 0)
{
@@
-357,7
+357,8
@@
void afsk_dac_isr(Afsk *af)
{
AFSK_DAC_IRQ_STOP(af->dac_ch);
af->sending = false;
{
AFSK_DAC_IRQ_STOP(af->dac_ch);
af->sending = false;
- return;
+ AFSK_STROBE_OFF();
+ return 0;
}
else
{
}
else
{
@@
-396,7
+397,8
@@
void afsk_dac_isr(Afsk *af)
{
AFSK_DAC_IRQ_STOP(af->dac_ch);
af->sending = false;
{
AFSK_DAC_IRQ_STOP(af->dac_ch);
af->sending = false;
- return;
+ AFSK_STROBE_OFF();
+ return 0;
}
else
af->curr_out = fifo_pop(&af->tx_fifo);
}
else
af->curr_out = fifo_pop(&af->tx_fifo);
@@
-453,8
+455,9
@@
void afsk_dac_isr(Afsk *af)
af->phase_acc += af->phase_inc;
af->phase_acc %= SIN_LEN;
af->phase_acc += af->phase_inc;
af->phase_acc %= SIN_LEN;
- AFSK_DAC_SET(af->dac_ch, sin_sample(af->phase_acc));
af->sample_count--;
af->sample_count--;
+ AFSK_STROBE_OFF();
+ return sin_sample(af->phase_acc);
}
}
@@
-473,7
+476,7
@@
static size_t afsk_read(KFile *fd, void *_buf, size_t size)
ticks_t start = timer_clock();
#endif
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
{
cpu_relax();
#if CONFIG_AFSK_RXTIMEOUT != -1
@@
-531,7
+534,7
@@
static void afsk_clearerr(KFile *fd)
/**
* Initialize an AFSK1200 modem.
/**
* Initialize an AFSK1200 modem.
- * \param af Afsk context to operate on
e (\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.
*/
* \param adc_ch ADC channel used by the demodulator.
* \param dac_ch DAC channel used by the modulator.
*/