Rev 110 | Rev 116 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 110 | Rev 112 | ||
---|---|---|---|
Line 232... | Line 232... | ||
232 | // enable the uart 0 IRQ |
232 | // enable the uart 0 IRQ |
233 | VIC_ITCmd(UART0_ITLine, ENABLE); |
233 | VIC_ITCmd(UART0_ITLine, ENABLE); |
234 | UART0_Connect_to_MKGPS(); |
234 | UART0_Connect_to_MKGPS(); |
Line 235... | Line 235... | ||
235 | 235 | ||
236 | // initialize txd buffer |
- | |
237 | UART0_tx_buffer.pData = UART0_tbuffer; |
236 | // initialize txd buffer |
238 | UART0_tx_buffer.Size = UART0_TX_BUFFER_LEN; |
- | |
239 | UART0_tx_buffer.Position = 0; |
- | |
Line 240... | Line 237... | ||
240 | UART0_tx_buffer.Locked = FALSE; |
237 | Buffer_Init(&UART0_tx_buffer, UART0_tbuffer, UART0_TX_BUFFER_LEN); |
241 | - | ||
242 | // initialize rxd buffer |
238 | |
243 | UART0_rx_buffer.pData = UART0_rbuffer; |
- | |
244 | UART0_rx_buffer.Size = UART0_RX_BUFFER_LEN; |
- | |
Line 245... | Line 239... | ||
245 | UART0_rx_buffer.Position = 0; |
239 | // initialize rxd buffer |
246 | UART0_rx_buffer.Locked = FALSE; |
240 | Buffer_Init(&UART0_rx_buffer, UART0_rbuffer, UART0_RX_BUFFER_LEN); |
Line 247... | Line 241... | ||
247 | 241 | ||
Line 333... | Line 327... | ||
333 | // unsupported command recieved |
327 | // unsupported command recieved |
334 | break; |
328 | break; |
335 | } |
329 | } |
336 | break; // default: |
330 | break; // default: |
337 | } |
331 | } |
338 | // unlock the rxd buffer after processing |
- | |
339 | UART0_rx_buffer.Position = 0; |
332 | Buffer_Clear(&UART0_rx_buffer); |
340 | UART0_rx_buffer.Locked = FALSE; |
- | |
341 | } |
333 | } |
Line 342... | Line 334... | ||
342 | 334 | ||
343 | /**************************************************************/ |
335 | /**************************************************************/ |
344 | /* Transmit tx buffer via uart0 */ |
336 | /* Transmit tx buffer via uart0 */ |
Line 353... | Line 345... | ||
353 | tmp_tx = UART0_tx_buffer.pData[UART0_tx_buffer.Position++]; // read next byte from txd buffer |
345 | tmp_tx = UART0_tx_buffer.pData[UART0_tx_buffer.Position++]; // read next byte from txd buffer |
354 | UART_SendData(UART0, tmp_tx); // put character to txd fifo |
346 | UART_SendData(UART0, tmp_tx); // put character to txd fifo |
355 | // if terminating character or end of txd buffer reached |
347 | // if terminating character or end of txd buffer reached |
356 | if((tmp_tx == '\r') || (UART0_tx_buffer.Position == UART0_tx_buffer.Size)) |
348 | if((tmp_tx == '\r') || (UART0_tx_buffer.Position == UART0_tx_buffer.Size)) |
357 | { |
349 | { |
358 | UART0_tx_buffer.Position = 0; // reset txd buffer positon |
- | |
359 | UART0_tx_buffer.Locked = FALSE;// unlock tx buffer |
350 | Buffer_Clear(&UART0_tx_buffer); |
360 | } |
351 | } |
361 | } |
352 | } |
362 | } |
353 | } |