git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@4351 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
parent
38ac197ecd
commit
5520d22609
|
@ -66,11 +66,9 @@ static void tmrfunc(void *p) {
|
|||
the pin connected to the CS/D3 contact of the card, this could disturb
|
||||
the transfer.*/
|
||||
blkstate_t state = blkGetDriverState(bbdp);
|
||||
if ((state == BLK_READING) || (state == BLK_WRITING))
|
||||
return;
|
||||
|
||||
/* Safe to perform the check.*/
|
||||
chSysLockFromIsr();
|
||||
if ((state != BLK_READING) && (state != BLK_WRITING)) {
|
||||
/* Safe to perform the check.*/
|
||||
if (cnt > 0) {
|
||||
if (blkIsInserted(bbdp)) {
|
||||
if (--cnt == 0) {
|
||||
|
@ -86,6 +84,7 @@ static void tmrfunc(void *p) {
|
|||
chEvtBroadcastI(&removed_event);
|
||||
}
|
||||
}
|
||||
}
|
||||
chVTSetI(&tmr, MS2ST(POLLING_DELAY), tmrfunc, bbdp);
|
||||
chSysUnlockFromIsr();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue