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_test.c
diff --git
a/bertos/net/afsk_test.c
b/bertos/net/afsk_test.c
index 54e22fd05e4d1e562f1b597bc822e3a3e0ed48ac..cb7d2cd13feb02838192f61720390a1a7026ae7c 100644
(file)
--- a/
bertos/net/afsk_test.c
+++ b/
bertos/net/afsk_test.c
@@
-32,7
+32,6
@@
*
* \brief AFSK demodulator test.
*
*
* \brief AFSK demodulator test.
*
- * \version $Id$
* \author Francesco Sacchi <batt@develer.com>
* $test$: cp bertos/cfg/cfg_ax25.h $cfgdir/
* $test$: echo "#undef AX25_LOG_LEVEL" >> $cfgdir/cfg_ax25.h
* \author Francesco Sacchi <batt@develer.com>
* $test$: cp bertos/cfg/cfg_ax25.h $cfgdir/
* $test$: echo "#undef AX25_LOG_LEVEL" >> $cfgdir/cfg_ax25.h
@@
-51,6
+50,7
@@
#include <cfg/test.h>
#include <cfg/debug.h>
#include <cfg/test.h>
#include <cfg/debug.h>
+#include <cfg/kfile_debug.h>
#include <cpu/byteorder.h>
#include <cpu/byteorder.h>
@@
-61,16
+61,15
@@
FILE *fp_adc;
FILE *fp_dac;
uint32_t data_size;
uint32_t data_written;
FILE *fp_dac;
uint32_t data_size;
uint32_t data_written;
-bool afsk_tx_test;
Afsk afsk_fd;
AX25Ctx ax25;
Afsk afsk_fd;
AX25Ctx ax25;
-
-int8_t afsk_adc_val;
+KFileDebug dbg;
int msg_cnt;
int msg_cnt;
-static void message_hook(
UNUSED_ARG(struct AX25Msg *, msg)
)
+static void message_hook(
struct AX25Msg *msg
)
{
msg_cnt++;
{
msg_cnt++;
+ ax25_print(&dbg.fd, msg);
}
static FILE *afsk_fileOpen(const char *name)
}
static FILE *afsk_fileOpen(const char *name)
@@
-129,6
+128,7
@@
static FILE *afsk_fileOpen(const char *name)
int afsk_testSetup(void)
{
kdbg_init();
int afsk_testSetup(void)
{
kdbg_init();
+ kfiledebug_init(&dbg);
fp_adc = afsk_fileOpen("test/afsk_test.au");
#if CPU_AVR
#warning TODO: open the file?
fp_adc = afsk_fileOpen("test/afsk_test.au");
#if CPU_AVR
#warning TODO: open the file?
@@
-147,7
+147,6
@@
int afsk_testSetup(void)
timer_init();
afsk_init(&afsk_fd, 0 ,0);
timer_init();
afsk_init(&afsk_fd, 0 ,0);
- afsk_fd.fd.error = kfile_genericClose;
ax25_init(&ax25, &afsk_fd.fd, message_hook);
return 0;
}
ax25_init(&ax25, &afsk_fd.fd, message_hook);
return 0;
}
@@
-184,9
+183,13
@@
int afsk_testRun(void)
ax25_send(&ax25, AX25_CALL("abcdef", 0), AX25_CALL("123456", 1), buf, sizeof(buf));
ax25_send(&ax25, AX25_CALL("abcdef", 0), AX25_CALL("123456", 1), buf, sizeof(buf));
- while (afsk_tx_test)
- afsk_dac_isr(&afsk_fd);
-
+ do
+ {
+ int8_t val = afsk_dac_isr(&afsk_fd) - 128;
+ ASSERT(fwrite(&val, 1, sizeof(val), fp_dac) == sizeof(val));
+ data_written++;
+ }
+ while (afsk_fd.sending);
#define SND_DATASIZE_OFF 8
#if CPU_AVR
#define SND_DATASIZE_OFF 8
#if CPU_AVR