18,8 → 18,19 |
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * |
****************************************************************************/ |
|
#include <avr/io.h> |
#include <avr/interrupt.h> |
#include <util/delay.h> |
#include "main.h" |
#include "usart1.h" |
|
volatile uint8_t rxd_buffer_locked = 0; |
volatile uint8_t rxd_buffer[RXD_BUFFER_LEN]; |
volatile uint8_t txd_buffer[TXD_BUFFER_LEN]; |
volatile uint8_t ReceivedBytes = 0; |
volatile uint8_t *pRxData = 0; |
volatile uint8_t RxDataLen = 0; |
|
/* ########################################################################## |
* USART stuff |
* ##########################################################################*/ |
216,3 → 227,19 |
|
usart1_puts((char*) txd_buffer); |
} |
|
/** |
* short script to directly send a request thorugh usart including en- and disabling it |
* where <address> is the address of the receipient, <label> is which data set to request |
* and <ms> represents the milliseconds delay between data |
*/ |
void usart1_request_mk_data(uint8_t address, char label, uint8_t ms) { |
// re-enable TXD pin |
usart1_EnableTXD(); |
|
unsigned char mstenth = ms/10; |
sendMKData(label, address, &mstenth, 1); |
|
// disable TXD pin again |
usart1_DisableTXD(); |
} |