Subversion Repositories Code-Repo

Rev

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

Rev 109 Rev 111
Line 8... Line 8...
8
#include "xbee.h"
8
#include "xbee.h"
9
#include "led_driver.h"
9
#include "led_driver.h"
10
#include "pwm.h"
10
#include "pwm.h"
11
#include "delays.h"
11
#include "delays.h"
12
#include "pin_interrupts.h"
12
#include "pin_interrupts.h"
-
 
13
#include "buffer.h"
13
 
14
 
14
#pragma config WDTEN = OFF          // Turn off watchdog timer
15
#pragma config WDTEN = OFF          // Turn off watchdog timer
15
#pragma config XINST = OFF          // Turn off extended instruction set
16
#pragma config XINST = OFF          // Turn off extended instruction set
16
#pragma config OSC = HSPLL          // Use external oscillator (101)
17
#pragma config OSC = HSPLL          // Use external oscillator (101)
17
#pragma config PLLDIV = 3           // Set PPL prescaler to 3 (to get 4MHz)
18
#pragma config PLLDIV = 3           // Set PPL prescaler to 3 (to get 4MHz)
Line 40... Line 41...
40
 * RC6 - UART Debug Output
41
 * RC6 - UART Debug Output
41
 * RC7 - UART Debug Input
42
 * RC7 - UART Debug Input
42
 *
43
 *
43
 * RB0 - XBee CTS (PPS)
44
 * RB0 - XBee CTS (PPS)
44
 * RB1 - XBee RTS (PPS)
45
 * RB1 - XBee RTS (PPS)
45
 * RB2 - XBee RX (PPS)
46
 * RB2 - XBee Tx (PPS)
46
 * RB3 - XBee Tx (PPS)
47
 * RB3 - XBee Rx (PPS)
47
 * RB4 - Button Input (Port B Interrupt on Change)
48
 * RB4 - Button Input (Port B Interrupt on Change)
48
 * RB5 - Button Input (Port B Interrupt on Change)
49
 * RB5 - Button Input (Port B Interrupt on Change)
49
 * RB6 - Button Input (Port B Interrupt on Change)
50
 * RB6 - Button Input (Port B Interrupt on Change)
50
 * RB7 - Button Input (Port B Interrupt on Change)
51
 * RB7 - Button Input (Port B Interrupt on Change)
51
 * ---------------------------- */
52
 * ---------------------------- */
52
 
53
 
53
#pragma udata umain_1
54
#pragma udata umain_1
54
static unsigned char msgbuffer[MSGLEN + 1];
55
static unsigned char msgbuffer[MSGLEN + 1];
55
#pragma udata umain_2
56
#pragma udata umain_2
56
static I2C_DATA i2c_i;
57
static I2C_DATA i2c_data;
57
#pragma udata
58
#pragma udata
58
static XBEE_DATA xbee_c;
59
static XBEE_DATA xbee_data;
59
static UART_DATA uart_c;
60
static UART_DATA uart_data;
-
 
61
static BUFFER_DATA buffer_data;
60
 
62
 
61
void main(void) {
63
void main(void) {
62
    char length;
64
    char length;
63
    unsigned char msgtype;
65
    unsigned char msgtype;
64
    unsigned char i = 0;
66
    unsigned char i = 0;
65
    unsigned char last_data_received = 0;
67
    unsigned char counter = 0;
66
    //    unsigned int adc_last_value;    // Holds 12 bit ADC value
-
 
67
    //    unsigned char adc_last_value_shifted;   // Holds upper 4 bits
-
 
68
 
68
 
69
    // Pointers to allow parsing of xbee data from arbitrary byte array
69
    // Pointers to allow parsing of xbee data from arbitrary byte array
70
    XBEE_RX_AT_COMMAND_RESPONSE_FRAME *frame_at_cmd_response;
70
    XBEE_RX_AT_COMMAND_RESPONSE_FRAME *frame_at_cmd_response;
71
    XBEE_RX_DATA_PACKET_FRAME *frame_data_packet;
71
    XBEE_RX_DATA_PACKET_FRAME *frame_data_packet;
72
    XBEE_RX_DATA_TX_STATUS_FRAME *frame_tx_status;
72
    XBEE_RX_DATA_TX_STATUS_FRAME *frame_tx_status;
Line 83... Line 83...
83
    //    OSCTUNEbits.PLLEN = 1;          // Enable 4x PLL
83
    //    OSCTUNEbits.PLLEN = 1;          // Enable 4x PLL
84
    //    OSCCONbits.IRCF = 0b111;        // Set INTOSC postscaler to 8MHz
84
    //    OSCCONbits.IRCF = 0b111;        // Set INTOSC postscaler to 8MHz
85
    OSCCONbits.SCS = 0b00; // Use 96MHz PLL as primary clock source
85
    OSCCONbits.SCS = 0b00; // Use 96MHz PLL as primary clock source
86
    /* -------------------------------------------------------------------- */
86
    /* -------------------------------------------------------------------- */
87
 
87
 
88
    uart_init(&uart_c); // Initialize the UART handler code
88
    uart_init(&uart_data); // Initialize the UART handler code
89
    xbee_init(&xbee_c); // Initialize the XBee handler code
89
    xbee_init(&xbee_data); // Initialize the XBee handler code
90
    i2c_init(&i2c_i); // Initialize the I2C handler code
90
    i2c_init(&i2c_data); // Initialize the I2C handler code
-
 
91
    buffer_init(&buffer_data);
91
    //    adc_init();                 // Initialize the ADC
92
    //    adc_init();                 // Initialize the ADC
92
    MQ_init(); // Initialize message queues before enabling any interrupts
93
    MQ_init(); // Initialize message queues before enabling any interrupts
93
    led_driver_init(); // Initialize the driver for the LED display
-
 
94
    pwm_init(); // Initialize the PWM output driver
-
 
95
    timers_init(); // Initialize timers
94
    timers_init(); // Initialize timers
96
    intx_init();
95
    led_driver_init(); // Initialize the driver for the LED display
97
    port_b_int_init(); // Initialze Port B interrupt handler
96
    port_b_int_init(); // Initialze Port B interrupt handler
-
 
97
 
-
 
98
#ifdef _BASE_STATION
-
 
99
    intx_init();    // IR receiver input
-
 
100
#endif
-
 
101
#ifdef _REMOTE
-
 
102
    pwm_init(); // Initialize the PWM output driver
-
 
103
#endif
98
    interrupt_enable(); // Enable high-priority interrupts and low-priority interrupts
104
    interrupt_enable(); // Enable high-priority interrupts and low-priority interrupts
99
    interrupt_init(); // Initialize the interrupt priorities
105
    interrupt_init(); // Initialize the interrupt priorities
100
 
106
 
101
    // Set all ports as digial I/O
107
    // Set all ports as digial I/O
102
    ANCON0 = 0xFF;
108
    ANCON0 = 0xFF;
103
    ANCON1 = 0x1F;
109
    ANCON1 = 0x1F;
104
 
110
 
105
    // Configure the hardware i2c device as a slave
111
    // Configure the hardware i2c device as a slave
106
#ifdef _MASTER
112
#ifdef _BASE_STATION
107
    i2c_configure_master();
113
    i2c_configure_master();
108
#endif
114
#endif
109
#ifdef _SLAVE
115
#ifdef _REMOTE
110
    i2c_configure_slave(0x5F);
116
    i2c_configure_slave(0x5F);
111
#endif
117
#endif
112
 
118
 
113
    DBG_PRINT_MAIN("\r\nMain: Program Started\r\n");
119
    DBG_PRINT_MAIN("\r\nMain: Program Started\r\n");
114
 
-
 
115
#ifdef _MASTER
-
 
116
    //     Delay a bit to allow XBees to start up
-
 
117
    for (i = 0; i < 20; i++)
-
 
118
        Delay10KTCYx(255);
-
 
119
 
-
 
120
    pwm_start();
-
 
121
 
-
 
122
    while (1) {
-
 
123
        /* XBee Demo */
-
 
124
        frame_tx_data = (void *) msgbuffer;
-
 
125
        frame_tx_data->frame_type = XBEE_TX_DATA_PACKET;
-
 
126
        frame_tx_data->frame_id = 0;
-
 
127
        frame_tx_data->destination_64.UPPER_32.long_value = 0x00000000;
-
 
128
        frame_tx_data->destination_64.LOWER_32.long_value = 0x00000000;
-
 
129
        frame_tx_data->destination_16.INT_16.int_value = 0x0000;
-
 
130
        frame_tx_data->broadcast_radius = 0;
-
 
131
        frame_tx_data->options = 0x01; // Disable ACK
-
 
132
        frame_tx_data->data[0] = i;
-
 
133
        i++;
-
 
134
        if (i == 100)
-
 
135
            i = 0;
-
 
136
        length = XBEE_TX_DATA_PACKET_FRAME_SIZE + 1;
-
 
137
        xbee_process_transmit_frame((void *) msgbuffer, length);
-
 
138
        Delay10KTCYx(100);
-
 
139
 
-
 
140
        /* I2C Demo */
-
 
141
        // Write 2 bytes
-
 
142
        msgbuffer[0] = 0x4;
-
 
143
        msgbuffer[1] = 0x2;
-
 
144
        i2c_master_send(0x5F, 2, msgbuffer);
-
 
145
        while (i2c_master_busy());
-
 
146
 
-
 
147
        // Read 2 bytes back
-
 
148
        i2c_master_recv(0x5F, 2);
-
 
149
        while (i2c_master_busy());
-
 
150
//        Delay10KTCYx(100);
-
 
151
    }
120
    
152
#endif
-
 
153
 
-
 
154
    // Loop and process recieved messages from interrupts
121
    // Loop and process recieved messages from interrupts
155
    while (1) {
122
    while (1) {
156
        // Call a routine that blocks until either message queues are not empty
123
        // Call a routine that blocks until either message queues are not empty
157
        MQ_wait_on_incoming_msg_queues();
124
        MQ_wait_on_incoming_msg_queues();
158
 
125
 
Line 184... Line 151...
184
                    DBG_PRINT_MAIN(" Event Count: %d", msgbuffer[length - 1]);
151
                    DBG_PRINT_MAIN(" Event Count: %d", msgbuffer[length - 1]);
185
                    DBG_PRINT_MAIN("\r\n");
152
                    DBG_PRINT_MAIN("\r\n");
186
                    switch (msgbuffer[0]) {
153
                    switch (msgbuffer[0]) {
187
                        case 0x2:
154
                        case 0x2:
188
                            length = 1;
155
                            length = 1;
-
 
156
                            // Return size of stored data in buffer
-
 
157
                            if (buffer_data.stored_length > MSGLEN) {
189
                            msgbuffer[0] = 1; // Size
158
                                msgbuffer[0] = MSGLEN;
-
 
159
                            } else {
-
 
160
                                msgbuffer[0] = buffer_data.stored_length;
-
 
161
                            }
190
                            MQ_sendmsg_FromMainToHigh(length, MSGTYPE_I2C_REPLY, (void *) msgbuffer);
162
                            MQ_sendmsg_FromMainToHigh(length, MSGTYPE_I2C_REPLY, (void *) msgbuffer);
191
                            break;
163
                            break;
192
                        case 0x4:
164
                        case 0x4:
-
 
165
                            // Return data stored in buffer
-
 
166
                            if (buffer_data.stored_length > MSGLEN) {
193
                            length = 1;
167
                                length = MSGLEN;
-
 
168
                                buffer_read(MSGLEN, msgbuffer);
-
 
169
                            } else {
194
                            msgbuffer[0] = last_data_received;
170
                                length = buffer_data.stored_length;
-
 
171
                                buffer_read(buffer_data.stored_length, msgbuffer);
-
 
172
                            }
195
                            MQ_sendmsg_FromMainToHigh(length, MSGTYPE_I2C_REPLY, (void *) msgbuffer);
173
                            MQ_sendmsg_FromMainToHigh(length, MSGTYPE_I2C_REPLY, (void *) msgbuffer);
196
                            break;
174
                            break;
197
                        case 0x6:
175
                        case 0x6:
198
                            break;
176
                            break;
199
                        case 0x7:
177
                        case 0x7:
Line 223... Line 201...
223
                    break;
201
                    break;
224
                case MSGTYPE_I2C_MASTER_RECV_FAILED:
202
                case MSGTYPE_I2C_MASTER_RECV_FAILED:
225
                    DBG_PRINT_MAIN("Main: (ERROR) I2C Master Receive Failed\r\n");
203
                    DBG_PRINT_MAIN("Main: (ERROR) I2C Master Receive Failed\r\n");
226
                    break;
204
                    break;
227
                    /* -----------------------------------------------------------*/
205
                    /* -----------------------------------------------------------*/
-
 
206
 
228
                    /* --- XBee Message Handlers ---------------------------------*/
207
                    /* --- XBee Message Handlers ---------------------------------*/
229
                case MSGTYPE_XBEE_RX_AT_COMMAND_RESPONSE:
208
                case MSGTYPE_XBEE_RX_AT_COMMAND_RESPONSE:
230
                    DBG_PRINT_MAIN("Main: XBee AT command frame\r\n");
209
                    DBG_PRINT_MAIN("Main: XBee AT command frame\r\n");
231
                    frame_at_cmd_response = (void *) msgbuffer;
210
                    frame_at_cmd_response = (void *) msgbuffer;
232
                    DBG_PRINT_MAIN("Command: %c%c\r\n", frame_at_cmd_response->command[0], frame_at_cmd_response->command[0]);
211
                    DBG_PRINT_MAIN("Command: %c%c\r\n", frame_at_cmd_response->command[0], frame_at_cmd_response->command[0]);
Line 243... Line 222...
243
                    DBG_PRINT_MAIN("Data: ");
222
                    DBG_PRINT_MAIN("Data: ");
244
                    for (i = 0; i < length - XBEE_RX_DATA_PACKET_FRAME_SIZE; i++) {
223
                    for (i = 0; i < length - XBEE_RX_DATA_PACKET_FRAME_SIZE; i++) {
245
                        DBG_PRINT_MAIN("%X ", frame_data_packet->data[i]);
224
                        DBG_PRINT_MAIN("%X ", frame_data_packet->data[i]);
246
                    }
225
                    }
247
                    DBG_PRINT_MAIN("\r\n");
226
                    DBG_PRINT_MAIN("\r\n");
248
                    last_data_received = frame_data_packet->data[0];
227
                    // Store received data into buffer
-
 
228
                    buffer_insert(length - XBEE_RX_DATA_PACKET_FRAME_SIZE, frame_data_packet->data);
-
 
229
                    // Send value of first byte received to LED display
249
                    led_driver_num(frame_data_packet->data[0]);
230
                    led_driver_num(frame_data_packet->data[0]);
250
                    break;
231
                    break;
251
                case MSGTYPE_XBEE_RX_DATA_TX_STATUS:
232
                case MSGTYPE_XBEE_RX_DATA_TX_STATUS:
252
                    DBG_PRINT_MAIN("Main: XBee TX status frame\r\n");
233
                    DBG_PRINT_MAIN("Main: XBee TX status frame\r\n");
253
                    frame_tx_status = (void *) msgbuffer;
234
                    frame_tx_status = (void *) msgbuffer;
Line 279... Line 260...
279
                case MSGTYPE_XBEE_RX_FRAME_MODEM_STATUS:
260
                case MSGTYPE_XBEE_RX_FRAME_MODEM_STATUS:
280
                    DBG_PRINT_MAIN("Main: XBee modem status frame\r\n");
261
                    DBG_PRINT_MAIN("Main: XBee modem status frame\r\n");
281
                    frame_modem_status = (void *) msgbuffer;
262
                    frame_modem_status = (void *) msgbuffer;
282
                    break;
263
                    break;
283
                    /* -----------------------------------------------------------*/
264
                    /* -----------------------------------------------------------*/
-
 
265
            };
-
 
266
            continue;
-
 
267
        }
-
 
268
 
-
 
269
        // Process low priority queue
-
 
270
        length = MQ_recvmsg_ToMainFromLow(MSGLEN, &msgtype, (void *) msgbuffer);
-
 
271
        if (length < 0) {
-
 
272
            // No message, check the error code to see if it is concern
-
 
273
            if (length != MSG_QUEUE_EMPTY) {
-
 
274
                DBG_PRINT_MAIN("Main: (ERROR) Bad low priority receive, code = %d\r\n", length);
-
 
275
            }
-
 
276
        } else {
-
 
277
            switch (msgtype) {
284
                    /* --- Port B Interrupt Handlers -----------------------------*/
278
                /* --- Port B Interrupt Handlers -----------------------------*/
285
                case MSGTYPE_PORTB_4_DOWN:
279
                case MSGTYPE_PORTB_4_DOWN:
286
                    DBG_PRINT_MAIN("Main: Port B4 Down\r\n");
280
                    DBG_PRINT_MAIN("Main: Port B4 Down\r\n");
-
 
281
#ifdef _REMOTE
-
 
282
                    timer3_enable();
-
 
283
#endif
-
 
284
#ifdef _BASE_STATION
-
 
285
                    timer0_enable();
-
 
286
#endif
287
                    break;
287
                    break;
288
                case MSGTYPE_PORTB_4_UP:
288
                case MSGTYPE_PORTB_4_UP:
289
                    DBG_PRINT_MAIN("Main: Port B4 Up\r\n");
289
                    DBG_PRINT_MAIN("Main: Port B4 Up\r\n");
-
 
290
#ifdef _REMOTE
-
 
291
                    timer3_disable();
-
 
292
#endif
-
 
293
#ifdef _BASE_STATION
-
 
294
                    timer0_disable();
-
 
295
#endif
290
                    break;
296
                    break;
291
                case MSGTYPE_PORTB_5_DOWN:
297
                case MSGTYPE_PORTB_5_DOWN:
292
                    DBG_PRINT_MAIN("Main: Port B5 Down\r\n");
298
                    DBG_PRINT_MAIN("Main: Port B5 Down\r\n");
293
                    break;
299
                    break;
294
                case MSGTYPE_PORTB_5_UP:
300
                case MSGTYPE_PORTB_5_UP:
Line 305... Line 311...
305
                    break;
311
                    break;
306
                case MSGTYPE_PORTB_7_UP:
312
                case MSGTYPE_PORTB_7_UP:
307
                    DBG_PRINT_MAIN("Main: Port B7 Up\r\n");
313
                    DBG_PRINT_MAIN("Main: Port B7 Up\r\n");
308
                    break;
314
                    break;
309
                    /* -----------------------------------------------------------*/
315
                    /* -----------------------------------------------------------*/
-
 
316
                    /* --- Timer Interrupt Handlers ------------------------------*/
-
 
317
                case MSGTYPE_TIMER0:
-
 
318
                    DBG_PRINT_MAIN("Main: Timer 0\r\n");
-
 
319
                    /* XBee Demo */
-
 
320
                    frame_tx_data = (void *) msgbuffer;
-
 
321
                    frame_tx_data->frame_type = XBEE_TX_DATA_PACKET;
-
 
322
                    frame_tx_data->frame_id = 0;
-
 
323
                    frame_tx_data->destination_64.UPPER_32.long_value = 0x00000000;
-
 
324
                    frame_tx_data->destination_64.LOWER_32.long_value = 0x00000000;
-
 
325
                    frame_tx_data->destination_16.INT_16.int_value = 0x0000;
-
 
326
                    frame_tx_data->broadcast_radius = 0;
-
 
327
                    frame_tx_data->options = 0x01; // Disable ACK
-
 
328
                    frame_tx_data->data[0] = counter;
-
 
329
                    counter++;
-
 
330
                    if (counter == 100)
-
 
331
                        counter = 0;
-
 
332
                    length = XBEE_TX_DATA_PACKET_FRAME_SIZE + 1;
-
 
333
                    xbee_process_transmit_frame((void *) msgbuffer, length);
-
 
334
                    Delay10KTCYx(100);
-
 
335
 
-
 
336
//                    /* I2C Demo */
-
 
337
//                    // Write 2 bytes
-
 
338
//                    msgbuffer[0] = 0x4;
-
 
339
//                    msgbuffer[1] = 0x2;
-
 
340
//                    i2c_master_send(0x5F, 2, msgbuffer);
-
 
341
//                    while (i2c_master_busy());
-
 
342
//
-
 
343
//                    // Read 2 bytes back
-
 
344
//                    i2c_master_recv(0x5F, 2);
-
 
345
//                    while (i2c_master_busy());
-
 
346
                    break;
-
 
347
//                case MSGTYPE_ADC_NEWVALUE:
-
 
348
//                    // Get the value in the ADC
-
 
349
//                    adc_last_value = *((unsigned int*) msgbuffer);
-
 
350
//                    adc_last_value_shifted = adc_last_value >> 4;
-
 
351
//                    DBG_PRINT_MAIN("Main: ADC Value = %d\r\n", adc_last_value);
-
 
352
//
-
 
353
//                    adc_start();
-
 
354
//                    break;
310
                default:
355
                default:
311
                    DBG_PRINT_MAIN("Main: (ERROR) Unexpected msg in high queue, length = %d, type = %d\r\n", length, msgtype);
356
                    DBG_PRINT_MAIN("Main: (ERROR) Unexpected msg in low queue, length = %d, type = %d\r\n", length, msgtype);
312
                    for (i = 0; i < length; i++) {
357
                    for (i = 0; i < length; i++) {
313
                        DBG_PRINT_MAIN("%X ", msgbuffer[i]);
358
                        DBG_PRINT_MAIN("%X ", msgbuffer[i]);
314
                    }
359
                    }
315
                    DBG_PRINT_MAIN("\r\n");
360
                    DBG_PRINT_MAIN("\r\n");
316
                    break;
361
                    break;
317
            };
362
            };
318
            continue;
363
            continue;
319
        }
364
        }
320
 
-
 
321
        //        // Process low priority queue
-
 
322
        //        length = MQ_recvmsg_ToMainFromLow(MSGLEN, &msgtype, (void *) msgbuffer);
-
 
323
        //        if (length < 0) {
-
 
324
        //            // No message, check the error code to see if it is concern
-
 
325
        //            if (length != MSG_QUEUE_EMPTY) {
-
 
326
        //                DBG_PRINT_MAIN("Main: (ERROR) Bad low priority receive, code = %d\r\n", length);
-
 
327
        //            }
-
 
328
        //        } else {
-
 
329
        //            switch (msgtype) {
-
 
330
        //                case MSGTYPE_TIMER0:
-
 
331
        //                    DBG_PRINT_MAIN("Timer 0 Triggered\r\n");
-
 
332
        //                    // Write 2 bytes
-
 
333
        //                    msgbuffer[0] = 0x4;
-
 
334
        //                    msgbuffer[1] = 0x3;
-
 
335
        //                    i2c_master_send(0x5F, 2, msgbuffer);
-
 
336
        //                    while (i2c_master_busy());
-
 
337
        //
-
 
338
        //                    // Read 3 bytes
-
 
339
        //                    i2c_master_recv(0x5F, 3);
-
 
340
        //                    while (i2c_master_busy());
-
 
341
        //
-
 
342
        //                    break;
-
 
343
        //                break;
-
 
344
        //                case MSGTYPE_ADC_NEWVALUE:
-
 
345
        //                    // Get the value in the ADC
-
 
346
        //                    adc_last_value = *((unsigned int*)msgbuffer);
-
 
347
        //                    adc_last_value_shifted = adc_last_value >> 4;
-
 
348
        //                    DBG_PRINT_MAIN("Main: ADC Value = %d\r\n", adc_last_value);
-
 
349
        //
-
 
350
        //                    frame_tx_data = (void *) msgbuffer;
-
 
351
        //                    frame_tx_data->frame_type = XBEE_TX_DATA_PACKET;
-
 
352
        //                    frame_tx_data->frame_id = 0;
-
 
353
        //                    frame_tx_data->destination_64.UPPER_32.long_value = 0x00000000;
-
 
354
        //                    frame_tx_data->destination_64.LOWER_32.long_value = 0x00000000;
-
 
355
        //                    frame_tx_data->destination_16.INT_16.int_value = 0x0000;
-
 
356
        //                    frame_tx_data->broadcast_radius = 0;
-
 
357
        //                    frame_tx_data->options = 0x01;  // Disable ACK
-
 
358
        //
-
 
359
        //                    frame_tx_data->data[0] = adc_last_value_shifted;
-
 
360
        //
-
 
361
        //                    length = XBEE_TX_DATA_PACKET_FRAME_SIZE + 1;
-
 
362
        //
-
 
363
        //                    xbee_process_transmit_frame((void *) msgbuffer, length);
-
 
364
        //
-
 
365
        //                    Delay10KTCYx(255);
-
 
366
        //                    Delay10KTCYx(255);
-
 
367
        //                    Delay10KTCYx(255);
-
 
368
        //                    Delay10KTCYx(255);
-
 
369
        //
-
 
370
        //                    adc_start();
-
 
371
        //                    break;
-
 
372
        //                default:
-
 
373
        //                    DBG_PRINT_MAIN("Main: (ERROR) Unexpected msg in low queue, type = %d\r\n", msgtype);
-
 
374
        //                    break;
-
 
375
        //            };
-
 
376
        //            continue;
-
 
377
        //        }
-
 
378
    }
365
    }
379
}
366
}
380
367