コード例 #1
0
void CommandProcessCommands() {
	
	static int currentCommand = 0;
	while(currentCommand != commandControl->currentCommand) {
		Command* command = &commandControl->command[currentCommand];
		
		if(command->destination == DST_ARM9) {
		
			switch(command->commandType) {
				case UPDATE_ROW:
					RecvCommandUpdateRow(&command->updateRow);
					break;
				
				case UPDATE_POTPOS:
					RecvCommandUpdatePotPos(&command->updatePotPos);
					break;
				
				case NOTIFY_STOP:
					RecvCommandNotifyStop(&command->MRD_notifyStopCommand);
					break;
				
				default:
					break;
			}
		
		}
			
		currentCommand++;
		currentCommand %= MAX_COMMANDS;
	}
}
コード例 #2
0
void CommandRecvHandler(u32 value32, void *user_data)
{
	int cmd = value32 >> 16;
	switch (cmd)
	{
        case UPDATE_ROW:
		{
			UpdateRowCommand updateRow = { (u16)value32 };
            RecvCommandUpdateRow(&updateRow);
            break;
		}

        case UPDATE_POTPOS:
		{
			UpdatePotPosCommand updatePotPos = { (u16)value32 };
            RecvCommandUpdatePotPos(&updatePotPos);
            break;
		}

        case NOTIFY_STOP:
            RecvCommandNotifyStop();
            break;

        case SAMPLE_FINISH:
            RecvCommandSampleFinish();
            break;

        default:
            break;
	}
}
コード例 #3
0
ファイル: fifocommand9.cpp プロジェクト: alekhin0w/libntxm
void CommandRecvHandler(int bytes, void *user_data) {
    NTXMFifoMessage msg;

    fifoGetDatamsg(FIFO_NTXM, bytes, (u8*)&msg);

    switch(msg.commandType) {
        case DBG_OUT: // TODO it's not safe to do this in an interrupt handler
            iprintf(msg.dbgOut.msg);
            break;

        case UPDATE_ROW:
            RecvCommandUpdateRow(&msg.updateRow);
            break;

        case UPDATE_POTPOS:
            RecvCommandUpdatePotPos(&msg.updatePotPos);
            break;

        case NOTIFY_STOP:
            RecvCommandNotifyStop();
            break;

        case SAMPLE_FINISH:
            RecvCommandSampleFinish();
            break;

        default:
            break;
    }
}