Subversion Repositories Projects

Rev

Rev 331 | Rev 387 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 331 Rev 346
Line 16... Line 16...
16
 *   along with this program; if not, write to the                          *
16
 *   along with this program; if not, write to the                          *
17
 *   Free Software Foundation, Inc.,                                        *
17
 *   Free Software Foundation, Inc.,                                        *
18
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.              *
18
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.              *
19
 ****************************************************************************/
19
 ****************************************************************************/
20
 
20
 
-
 
21
#include <avr/io.h>
-
 
22
#include <avr/interrupt.h>
-
 
23
#include <util/delay.h>
-
 
24
#include "main.h"
21
#include "usart1.h"
25
#include "usart1.h"
22
 
26
 
-
 
27
volatile uint8_t rxd_buffer_locked = 0;
-
 
28
volatile uint8_t rxd_buffer[RXD_BUFFER_LEN];
-
 
29
volatile uint8_t txd_buffer[TXD_BUFFER_LEN];
-
 
30
volatile uint8_t ReceivedBytes = 0;
-
 
31
volatile uint8_t *pRxData = 0;
-
 
32
volatile uint8_t RxDataLen = 0;
-
 
33
 
23
/* ##########################################################################
34
/* ##########################################################################
24
 * USART stuff
35
 * USART stuff
25
 * ##########################################################################*/
36
 * ##########################################################################*/
26
 
37
 
27
/**
38
/**
Line 214... Line 225...
214
    txd_buffer[i++] = '=' + tmpCRC % 64;
225
    txd_buffer[i++] = '=' + tmpCRC % 64;
215
    txd_buffer[i++] = '\r';
226
    txd_buffer[i++] = '\r';
216
 
227
 
217
    usart1_puts((char*) txd_buffer);
228
    usart1_puts((char*) txd_buffer);
218
}
229
}
-
 
230
 
-
 
231
/**
-
 
232
 * short script to directly send a request thorugh usart including en- and disabling it
-
 
233
 * where <address> is the address of the receipient, <label> is which data set to request
-
 
234
 * and <ms> represents the milliseconds delay between data
-
 
235
 */
-
 
236
void usart1_request_mk_data(uint8_t address, char label, uint8_t ms) {
-
 
237
            // re-enable TXD pin
-
 
238
            usart1_EnableTXD();
-
 
239
 
-
 
240
            unsigned char mstenth = ms/10;
-
 
241
                        sendMKData(label, address, &mstenth, 1);
-
 
242
 
-
 
243
            // disable TXD pin again
-
 
244
            usart1_DisableTXD();
-
 
245
}