From 32586999d011b250c851c7d9c433081b1f0b7a53 Mon Sep 17 00:00:00 2001 From: jakegoodwin Date: Mon, 16 Jan 2023 19:43:48 -0800 Subject: [PATCH] Added in some defines for logic --- avr_usart.h | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/avr_usart.h b/avr_usart.h index f3cb982..4d6609f 100644 --- a/avr_usart.h +++ b/avr_usart.h @@ -4,7 +4,7 @@ * Description: AT-09 Bluetooth module library for AVR micro crontrollers. * Filename: avr_at-09.h */ - +#define __AVR_ATmega328P__ #include #include @@ -17,9 +17,9 @@ * AVR D1 --> AT-09 RX * AVR D2 --> AT-09 State */ -#define FOSC 8000000 -#define BLE_BAUD 9600 -#define BT_UBRR FOSC/16/BLE_BAUD - 1 +#define FOSC 1000000UL +#define BLE_BAUD 4800 +#define BT_UBRR ((FOSC)/(BLE_BAUD*16UL)-1) #define TX_PIN PIND1 #define TX_DDR DDD1 @@ -35,9 +35,18 @@ //############################# -//TYPES +//MACROS //############################# +#define USE_U2X 0 +#define STOP_BITS 2 +#define DATA_BITS 8 +#define CLOCK_POL 0 +#define PARITY_BITS 0 +#define PARITY_POS 0 + + + //############################# //FUNCTION PROTOTYPES //#############################