Added check4freeFDshortCmd.
This commit is contained in:
parent
a95e174356
commit
cb4412779f
@ -563,11 +563,17 @@ bool sendFDcmd_get(uint8_t *nextWrCmd, uint8_t *nextRdCmd, uint8_t *blockNum, ui
|
|||||||
|
|
||||||
uint8_t check4FDshortCmd(void)
|
uint8_t check4FDshortCmd(void)
|
||||||
{
|
{
|
||||||
// returns number of waiting command
|
// returns number of waiting command, max FDCMD_STACKDEPTH
|
||||||
return p_nextFDcmdsInQueue;
|
return p_nextFDcmdsInQueue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
uint8_t check4freeFDshortCmd(void)
|
||||||
|
{
|
||||||
|
// returns number of free places in short-command stack
|
||||||
|
return FDCMD_STACKDEPTH - p_nextFDcmdsInQueue;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// long command, 64 data bytes
|
// long command, 64 data bytes
|
||||||
static uint8_t longFDwrCmd[FDLONG_STACKDEPTH];
|
static uint8_t longFDwrCmd[FDLONG_STACKDEPTH];
|
||||||
@ -602,7 +608,7 @@ bool longFDcmd_set(uint8_t nextWrCmd, uint8_t nextRdCmd, uint8_t blockNum, uint8
|
|||||||
uint8_t nn;
|
uint8_t nn;
|
||||||
if (p_longFDcmdsInQueue>=FDLONG_STACKDEPTH)
|
if (p_longFDcmdsInQueue>=FDLONG_STACKDEPTH)
|
||||||
{
|
{
|
||||||
qCritical() << "cannot save cmd because stack is full";
|
qDebug() << "cannot save cmd because stack is full";
|
||||||
return false; // not possible
|
return false; // not possible
|
||||||
}
|
}
|
||||||
longFDwrCmd[p_longFDcmdsInQueue]=nextWrCmd;
|
longFDwrCmd[p_longFDcmdsInQueue]=nextWrCmd;
|
||||||
@ -613,7 +619,6 @@ bool longFDcmd_set(uint8_t nextWrCmd, uint8_t nextRdCmd, uint8_t blockNum, uint8
|
|||||||
longFDpara[p_longFDcmdsInQueue][nn]=data[nn];
|
longFDpara[p_longFDcmdsInQueue][nn]=data[nn];
|
||||||
|
|
||||||
p_longFDcmdsInQueue++;
|
p_longFDcmdsInQueue++;
|
||||||
|
|
||||||
return true; // ok, will be sent
|
return true; // ok, will be sent
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -659,5 +664,10 @@ uint8_t check4FDlongCmd(void)
|
|||||||
return p_longFDcmdsInQueue;
|
return p_longFDcmdsInQueue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint8_t check4freeFDlongCmd(void)
|
||||||
|
{
|
||||||
|
// returns number of free places in command stack
|
||||||
|
return FDLONG_STACKDEPTH - p_longFDcmdsInQueue;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user