Konfiguracja ilosci bitow i ilosci bitow stopu

aprs_test
Łukasz Nidecki 2016-12-24 22:30:18 +01:00
rodzic 67b660d8e6
commit 1ffd2e0d6b
3 zmienionych plików z 13 dodań i 3 usunięć

Wyświetl plik

@ -10,6 +10,10 @@
#define freq 434.150f //Mhz middle frequency
//************rtty speed****************** si4032
#define RTTY_SPEED 300
//************rtty bits****************** si4032
#define RTTY_7BIT 1
//************rtty stop bits****************** si4032
#define RTTY_USE_2_STOP_BITS 0
//************band select****************** si4032
#define fb 1
#define fbsel 1

Wyświetl plik

@ -1,4 +1,3 @@
#include <stdint.h>
#include "f_rtty.h"
uint8_t start_bits;
@ -13,7 +12,7 @@ rttyStates send_rtty(char *znak) {
if (nr_bit == 1) {
return rttyZero;
}
if (nr_bit > 1 && nr_bit < 10) {
if (nr_bit > 1 && nr_bit < (RTTY_7BIT ? 9 : 10)) {
if ((*(znak) >> (nr_bit - 2)) & 0x01) {
return rttyOne;
} else {
@ -21,13 +20,18 @@ rttyStates send_rtty(char *znak) {
}
}
#ifdef RTTY_7BIT
nr_bit++;
#endif
if (nr_bit == 10) {
return rttyOne;
}
#ifdef RTTY_USE_2_STOP_BITS
if (nr_bit == 11) {
return rttyOne;
}
#endif
nr_bit = 0;
return rttyEnd;
}

Wyświetl plik

@ -1,3 +1,5 @@
#include <stdint.h>
#include "config.h"
typedef enum {
rttyZero = 0,