
#include "globals.h"
#include <stdio.h>

os_mbx_declare (ComBox, 4);		   /* Declare a mailbox called ComBox that can
									  contain 4 messages */

/*----------------------------------------------------------------------------
 *        Task 'UART_Task': Message sending task for serial interface
 *---------------------------------------------------------------------------*/
__task void UART_Task (void) {
    char* Message;								// pointer for handling received messages

    os_mbx_init (ComBox, sizeof(ComBox));	   	// Initialise the ComBox mailbox

    while (1) {
        os_mbx_wait (ComBox, (void**)&Message, 0xffff);	 // wait for message to arrive
        printf (Message);								 // send message out on UART
        _free_box(mpoolCom, Message);					 // free the mailbox slot for reuse
    }
};


/*----------------------------------------------------------------------------
 * end of file
 *---------------------------------------------------------------------------*/
