Beispiel #1
0
/**
 * Main message (infinite) loop.
 */
void loop_loop(int8_t once)
{
    do {
        message_t lmsg;
        if (g_message_buffer.rdpos == g_message_buffer.wrpos) {
            /* no message in the buffer: Run NOP message */
            lmsg.cmd = Cmd_Nop;
            lmsg.arg1i = 0;
        } else {
            /* a message in the buffer: retrieve and process */
            lmsg = g_message_buffer.msg_buf[g_message_buffer.rdpos];
            g_message_buffer.rdpos = iwrap(g_message_buffer.rdpos + 1);

            if (lmsg.cmd != Cmd_ClockTick) {
                usart_sendstr_P(PSTR("[Msg:0x"));
                usart_sendhexb(lmsg.cmd);
                usart_sendstr_P(PSTR("]"));
            }
        }

        int8_t used = 0;
        used |= voice_process(&lmsg);
        used |= vfs_process(&lmsg);
        used |= sound_process(&lmsg);
        used |= ir_process(&lmsg);
        used |= debug_process(&lmsg);
        used |= btn_process(&lmsg);
        used |= clock_process(&lmsg);

        if (!used && (lmsg.cmd != Cmd_Nop)) {
            usart_sendstr_P(PSTR("[Msg not recognized!]\n"));
        }

        /* reset watchdog timer */
        wdt_reset();
    } while (!once);
}
static void voice_finish(gfloat **d, gint *samples)
{
	voice_process(d, samples);
}