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
 ****************************************************************************/
Line -... Line 20...
-
 
20
 
-
 
21
#include <avr/io.h>
-
 
22
#include <avr/interrupt.h>
-
 
23
#include <util/delay.h>
20
 
24
#include "main.h"
Line -... Line 25...
-
 
25
#include "usart1.h"
-
 
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;
21
#include "usart1.h"
32
volatile uint8_t RxDataLen = 0;
22
 
33
 
23
/* ##########################################################################
34
/* ##########################################################################
Line 24... Line 35...
24
 * USART stuff
35
 * USART stuff
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';
Line 216... Line 227...
216
 
227
 
217
    usart1_puts((char*) txd_buffer);
228
    usart1_puts((char*) txd_buffer);
-
 
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();