Subversion Repositories NaviCtrl

Rev

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

Rev 196 Rev 198
Line 77... Line 77...
77
#include "fifo.h"
77
#include "fifo.h"
Line 78... Line 78...
78
 
78
 
79
#define FALSE   0
79
#define FALSE   0
Line -... Line 80...
-
 
80
#define TRUE    1
-
 
81
 
Line 80... Line 82...
80
#define TRUE    1
82
#define ABO_TIMEOUT 4000 // disable abo after 4 seconds
81
 
83
u32 UART1_AboTimeOut = 0;
82
 
84
 
83
u8 UART1_Request_VersionInfo    = FALSE;
85
u8 UART1_Request_VersionInfo    = FALSE;
Line 165... Line 167...
165
Waypoint_t FollowMe;
167
Waypoint_t FollowMe;
166
Data3D_t Data3D;
168
Data3D_t Data3D;
167
u16 Echo; // 2 bytes recieved will be sent back as echo
169
u16 Echo; // 2 bytes recieved will be sent back as echo
Line 168... Line 170...
168
 
170
 
169
u32 UART1_DebugData_Timer = 0;
171
u32 UART1_DebugData_Timer = 0;
170
u32 UART1_DebugData_Interval = 5000;    // in ms
172
u32 UART1_DebugData_Interval = 0;       // in ms
171
u32 UART1_NaviData_Timer = 0;
173
u32 UART1_NaviData_Timer = 0;
172
u32 UART1_NaviData_Interval = 5000;             // in ms
174
u32 UART1_NaviData_Interval = 0;        // in ms
173
u32 UART1_Data3D_Timer = 0;                             // in ms
175
u32 UART1_Data3D_Timer = 0;
174
u32 UART1_Data3D_Interval = 0;
176
u32 UART1_Data3D_Interval = 0;          // in ms
175
u32 UART1_Display_Timer = 0;
177
u32 UART1_Display_Timer = 0;
Line 176... Line 178...
176
u32 UART1_Display_Interval = 0;
178
u32 UART1_Display_Interval = 0;
177
 
179
 
Line 505... Line 507...
505
                                break;
507
                                break;
506
                        */
508
                        */
507
                        case 'd': // request for debug data;
509
                        case 'd': // request for debug data;
508
                                UART1_DebugData_Interval = (u32) SerialMsg.pData[0] * 10;
510
                                UART1_DebugData_Interval = (u32) SerialMsg.pData[0] * 10;
509
                                if(UART1_DebugData_Interval > 0) UART1_Request_DebugData = TRUE;
511
                                if(UART1_DebugData_Interval > 0) UART1_Request_DebugData = TRUE;
-
 
512
                                UART1_AboTimeOut = SetDelay(ABO_TIMEOUT);
510
                                break;
513
                                break;
Line 511... Line 514...
511
 
514
 
512
                        case 'c': // request for 3D data;
515
                        case 'c': // request for 3D data;
513
                                UART1_Data3D_Interval = (u32) SerialMsg.pData[0] * 10;
516
                                UART1_Data3D_Interval = (u32) SerialMsg.pData[0] * 10;
-
 
517
                                if(UART1_Data3D_Interval > 0) UART1_Request_Data3D = TRUE;
514
                                if(UART1_Data3D_Interval > 0) UART1_Request_Data3D = TRUE;
518
                                UART1_AboTimeOut = SetDelay(ABO_TIMEOUT);
515
                                break;
519
                                break;
516
                        /*
520
                        /*
517
                        case 'g':// request for external control data
521
                        case 'g':// request for external control data
518
                                UART1_Request_ExternalControl = TRUE;
522
                                UART1_Request_ExternalControl = TRUE;
Line 527... Line 531...
527
                                else
531
                                else
528
                                {
532
                                {
529
                                        RemoteKeys |= ~SerialMsg.pData[0];
533
                                        RemoteKeys |= ~SerialMsg.pData[0];
530
                                        UART1_Display_Interval = (u32) SerialMsg.pData[1] * 10;
534
                                        UART1_Display_Interval = (u32) SerialMsg.pData[1] * 10;
531
                                        UART1_DisplayLine = 4;
535
                                        UART1_DisplayLine = 4;
-
 
536
                                        UART1_AboTimeOut = SetDelay(ABO_TIMEOUT);
532
                                }
537
                                }
533
                                UART1_Request_Display = TRUE;
538
                                UART1_Request_Display = TRUE;
534
                                break;
539
                                break;
Line 535... Line 540...
535
 
540
 
Line 539... Line 544...
539
                                break;
544
                                break;
Line 540... Line 545...
540
 
545
 
541
                        case 'o': // request for navigation information
546
                        case 'o': // request for navigation information
542
                                UART1_NaviData_Interval = (u32) SerialMsg.pData[0] * 10;
547
                                UART1_NaviData_Interval = (u32) SerialMsg.pData[0] * 10;
-
 
548
                                if(UART1_NaviData_Interval > 0) UART1_Request_NaviData = TRUE;
543
                                if(UART1_NaviData_Interval > 0) UART1_Request_NaviData = TRUE;
549
                                UART1_AboTimeOut = SetDelay(ABO_TIMEOUT);
Line 544... Line 550...
544
                                break;
550
                                break;
545
 
551
 
546
                        case 'v': // request for version info
552
                        case 'v': // request for version info
Line 612... Line 618...
612
/* Send the answers to incomming commands at the debug uart   */
618
/* Send the answers to incomming commands at the debug uart   */
613
/**************************************************************/
619
/**************************************************************/
614
void UART1_TransmitTxData(void)
620
void UART1_TransmitTxData(void)
615
{
621
{
616
        if(DebugUART != UART1) return;
622
        if(DebugUART != UART1) return;
-
 
623
 
-
 
624
        if(CheckDelay(UART1_AboTimeOut))
-
 
625
        {
-
 
626
                UART1_DebugData_Interval = 0;
-
 
627
                UART1_NaviData_Interval = 0;
-
 
628
                UART1_Data3D_Interval = 0;
-
 
629
                UART1_Display_Interval = 0;
-
 
630
        }
-
 
631
 
617
        UART1_Transmit(); // output pending bytes in tx buffer
632
        UART1_Transmit(); // output pending bytes in tx buffer
618
        if((UART1_tx_buffer.Locked == TRUE)) return;
633
        if((UART1_tx_buffer.Locked == TRUE)) return;
Line 619... Line 634...
619
 
634
 
620
        if(UART1_Request_Parameter && (UART1_tx_buffer.Locked == FALSE))
635
        if(UART1_Request_Parameter && (UART1_tx_buffer.Locked == FALSE))