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; } }
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; } }