kopia lustrzana https://github.com/Qyon/STM32_RTTY
Konfiguracja ilosci bitow i ilosci bitow stopu
rodzic
67b660d8e6
commit
1ffd2e0d6b
4
config.h
4
config.h
|
@ -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
|
||||
|
|
10
f_rtty.c
10
f_rtty.c
|
@ -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;
|
||||
}
|
||||
|
|
2
f_rtty.h
2
f_rtty.h
|
@ -1,3 +1,5 @@
|
|||
#include <stdint.h>
|
||||
#include "config.h"
|
||||
|
||||
typedef enum {
|
||||
rttyZero = 0,
|
||||
|
|
Ładowanie…
Reference in New Issue