Since I'm new to Kinetis and MQX and still low on the learning curve, I don't mind sharing. (That is if you don't mind that I might answer the wrong question!)
I took what was provided at the bottom of the main.c modules ad expanded it. Now my code is:
======
void Main_Task(uint32_t param);
TASK_TEMPLATE_STRUCT MQX_template_list[] =
{
{ 1L, Main_Task, 1024L, MQX_MAIN_TASK_PRIORITY, "Main", MQX_AUTO_START_TASK},
{ 0L, 0L, 0L, 0L, 0L, 0L}
};
static void Task_Start(void *arg) {
APP_init();
for (;; ) {
APP_task();
} /* Endfor */
}
void Main_Task(uint32_t param)
{
Prime_Init();
OSA_Init();
NVIC_SetPriority(I2C0_IRQn, 6U);
OSA_InstallIntHandler(I2C0_IRQn, MQX_I2C0_IRQHandler);
dbg_uart_init();
OS_Task_create(Task_Start, NULL, 9L, 4000L, "task_start", NULL);
OS_Task_create(FrntPnl_App, NULL, 12L, 2048L, "FrntPanel", NULL);
OS_Task_create(Prime_App, NULL, 10L, 4096L, "Prime", NULL);
OSA_Start();
}
======
The Task_Start() was left alone with APP_Task() only being modified by the addition of the call to _time_delay_ticks(1) to get it to relinquish the processor.
PrimeInit() initializes the hardware I/O for this platform. The I2C bus is used to interface to an EEPROM and a digital potentiometer. The FrntPanel task uses the MQX timer to get a small chunk of time every 5mS to scan for a switch closure. Finally the Prime_App() task takes input from the FrntPanel() task (through a FIFO queue) and makes changes to the internal sate machine.
At this point all I/O to the USB disk is via the original code - either demo or throughput test. I have not started modifying that task for this application. Before starting that, I noticed that when running the throughput test my FrntPanel() task essentially stopped working. Maybe this is not a fair test.(?) In the final application, the bandwidth required to the USB disk is expected to be about 50KBytes per second. The throughput test reports around 550KBytes per second for the USB disk I have on hand.