Bootloader MAC fixes from Mike

This commit is contained in:
bsongis
2014-04-08 10:26:08 +02:00
parent a72df4ca16
commit 30111d9299
6 changed files with 73 additions and 6 deletions
+20 -1
View File
@@ -161,6 +161,19 @@ int8_t STORAGE_GetCapacity (uint8_t lun, uint32_t *block_num, uint32_t *block_si
return 0;
}
uint8_t lunReady[2] ;
void usbPluggedIn()
{
if (lunReady[0] == 0) {
lunReady[0] = 1;
}
if (lunReady[1] == 0) {
lunReady[1] = 1;
}
}
/**
* @brief check whether the medium is ready
* @param lun : logical unit number
@@ -169,9 +182,15 @@ int8_t STORAGE_GetCapacity (uint8_t lun, uint32_t *block_num, uint32_t *block_si
int8_t STORAGE_IsReady (uint8_t lun)
{
if (lun == 1) {
return 0;
if (lunReady[1] == 0) {
return -1 ;
}
return 0 ;
}
else {
if (lunReady[0] == 0) {
return -1 ;
}
return SD_CARD_PRESENT() ? 0 : -1;
}
}