kopia lustrzana https://github.com/fsphil/hadie
Updates done for hadie:3 flight code
rodzic
f2e6d0aea2
commit
06f7931b07
4
gps.c
4
gps.c
|
@ -349,9 +349,9 @@ void gps_init(void)
|
|||
{
|
||||
rxline[0] = '\0';
|
||||
|
||||
/* Do UART1 initialisation, 38400 baud @ 7.3728 MHz */
|
||||
/* Do UART1 initialisation, 9600 baud @ 7.3728 MHz */
|
||||
UBRR1H = 0;
|
||||
UBRR1L = 11;
|
||||
UBRR1L = 47;
|
||||
|
||||
/* Enable RX, TX and RX interrupt */
|
||||
UCSR1B = (1 << RXEN1) | (1 << TXEN1) | (1 << RXCIE1);
|
||||
|
|
12
rtty.c
12
rtty.c
|
@ -21,7 +21,7 @@ extern inline void gps_tick(void);
|
|||
|
||||
/* MARK = Upper tone, Idle, bit */
|
||||
#define TXPIN (1 << 0) /* PB0 */
|
||||
#define TXENABLE (1 << 2) /* PB2 */
|
||||
#define TXENABLE (1 << 1) /* PB1 */
|
||||
|
||||
#define TXBIT(b) PORTB = (PORTB & ~TXPIN) | ((b) ? TXPIN : 0)
|
||||
|
||||
|
@ -59,6 +59,12 @@ ISR(TIMER0_COMPA_vect)
|
|||
gps_tick();
|
||||
}
|
||||
|
||||
void rtx_enable(char en)
|
||||
{
|
||||
if(en) PORTB |= TXENABLE;
|
||||
else PORTB &= ~TXENABLE;
|
||||
}
|
||||
|
||||
void rtx_init(void)
|
||||
{
|
||||
/* RTTY is driven by TIMER0 in CTC mode */
|
||||
|
@ -69,8 +75,8 @@ void rtx_init(void)
|
|||
|
||||
/* We use Port B pins 1 and 2 */
|
||||
TXBIT(1);
|
||||
PORTB |= TXENABLE;
|
||||
DDRB |= TXPIN | TXENABLE;
|
||||
rtx_enable(0);
|
||||
DDRB |= TXPIN | TXENABLE;
|
||||
}
|
||||
|
||||
void inline rtx_wait(void)
|
||||
|
|
1
rtty.h
1
rtty.h
|
@ -14,6 +14,7 @@
|
|||
#include <avr/pgmspace.h>
|
||||
|
||||
extern void rtx_init(void);
|
||||
extern void rtx_enable(char en);
|
||||
extern void inline rtx_wait(void);
|
||||
extern void rtx_data(uint8_t *data, size_t length);
|
||||
extern void rtx_data_P(PGM_P data, size_t length);
|
||||
|
|
Ładowanie…
Reference in New Issue